{"id":14984766,"url":"https://github.com/statemood/jenkins-library","last_synced_at":"2025-04-06T20:13:11.442Z","repository":{"id":45204414,"uuid":"151795907","full_name":"Statemood/jenkins-library","owner":"Statemood","description":"Shared Library for Jenkine Pipeline","archived":false,"fork":false,"pushed_at":"2024-11-04T10:42:57.000Z","size":2796,"stargazers_count":55,"open_issues_count":1,"forks_count":37,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-06T20:13:07.199Z","etag":null,"topics":["docker","groovy","jenkins","jenkins-library","jenkins-pipeline","jenkins-shared-library","kubernetes","library","pipeline","shared-library"],"latest_commit_sha":null,"homepage":null,"language":"Groovy","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Statemood.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-10-06T01:56:24.000Z","updated_at":"2024-12-16T03:24:02.000Z","dependencies_parsed_at":"2024-12-24T00:11:07.030Z","dependency_job_id":"6b0d1ab2-1f23-4dc7-82fe-fa564c4e7673","html_url":"https://github.com/Statemood/jenkins-library","commit_stats":{"total_commits":620,"total_committers":6,"mean_commits":"103.33333333333333","dds":0.5258064516129033,"last_synced_commit":"e582dd2ce19dd870e85047cf3b881d1c63c74880"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Statemood%2Fjenkins-library","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Statemood%2Fjenkins-library/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Statemood%2Fjenkins-library/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Statemood%2Fjenkins-library/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Statemood","download_url":"https://codeload.github.com/Statemood/jenkins-library/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247543595,"owners_count":20955865,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","groovy","jenkins","jenkins-library","jenkins-pipeline","jenkins-shared-library","kubernetes","library","pipeline","shared-library"],"created_at":"2024-09-24T14:09:38.511Z","updated_at":"2025-04-06T20:13:11.412Z","avatar_url":"https://github.com/Statemood.png","language":"Groovy","funding_links":[],"categories":[],"sub_categories":[],"readme":"# jenkins-library\nShared Library for Jenkins Pipeline\n\n- 关于Shared Library的更多信息请参考[Using libraries](https://jenkins.io/doc/book/pipeline/shared-libraries/#using-libraries) \n\n## 配置 Jenkins 使用 Shared Library\n若要使用 Shared Library, 您可以通过两种方式进行配置:\n- Declarative Pipeline\n  通过简单配置使用 `Jenkinsfile` 进行控制\n\n  Jenkinsfile 在执行时, 也是调用了 **Jenkins Shared Library**\n\n- Scripted Pipeline\n  通过一些配置使用 `Script` 进行控制\n\n### Declarative Pipeline\n#### 1. 创建一个流水线(Pipeline)项目\n创建项目\n\n#### 2. 配置使用 Jenkinsfile\n在项目配置界面，**流水线** 处，选择 `Pipeline script from SCM`\n  - SCM\n    - Git\n      - Repository URL\n      - https://github.com/Statemood/jenkins-library\n      - Branch Specifier (blank for 'any')\n      - origin/master\n    - 脚本路径\n      - Jenkinsfile\n\n或选择 `Pipeline script`, 然后输入如下配置\n\n```groovy\n@Library('github.com/Statemood/jenkins-library@dev') _\n\nentry([git_repo: 'https://github.com/Statemood/simple-java-maven-app.git'])\n```\n\n保存即可开始使用。\n\n\n#### 3. 配置 Global Pipeline Libraries\n- 配置方式参考 https://jenkins.io/doc/book/pipeline/shared-libraries/#global-shared-libraries\n\n\n## 依赖项\nBUILD_USER \u0026 BUILD_USER_ID 需要 [build user vars](https://plugins.jenkins.io/build-user-vars-plugin) 插件","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstatemood%2Fjenkins-library","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstatemood%2Fjenkins-library","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstatemood%2Fjenkins-library/lists"}