X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=blobdiff_plain;f=jjb%2Flf-ci-jobs.yaml;h=46089ae7a819a9bcf61240c97b5942c81cc2d586;hb=1dfa47374063e36176a5c26346cb7953d92c6618;hp=cebe4bc933c5174c5fb340579559aadf640db949;hpb=d5701687893b11024f892c00a5e81ca6d94d0866;p=releng%2Fglobal-jjb.git diff --git a/jjb/lf-ci-jobs.yaml b/jjb/lf-ci-jobs.yaml index cebe4bc9..46089ae7 100644 --- a/jjb/lf-ci-jobs.yaml +++ b/jjb/lf-ci-jobs.yaml @@ -8,6 +8,7 @@ jjb-version: 1.6.2 jobs: + - gerrit-jjb-deploy-job - gerrit-jjb-merge - gerrit-jjb-verify @@ -20,6 +21,7 @@ jjb-version: 1.6.2 jobs: + - github-jjb-deploy-job - github-jjb-merge - github-jjb-verify @@ -61,6 +63,15 @@ - file-id: jjbini target: '$HOME/.config/jenkins_jobs/jenkins_jobs.ini' +- builder: + name: lf-infra-jjbini-sandbox + # TODO: Consolidate this into jjbini when JJB2.0 is available. + builders: + - config-file-provider: + files: + - file-id: jjbini-sandbox + target: '$HOME/.config/jenkins_jobs/jenkins_jobs.ini' + - lf_packer_file_paths: &lf_packer_file_paths name: lf-packer-file-paths file-paths: @@ -182,6 +193,206 @@ publishers: - lf-infra-publish +###################### +# Gerrit Branch Lock # +###################### + +- job-template: + name: '{project-name}-gerrit-branch-lock-{stream}' + id: gerrit-branch-lock + + ###################### + # Default parameters # + ###################### + + branch: master + git-url: '$GIT_URL/$GERRIT_PROJECT' + stream: master + gerrit_merge_triggers: + - comment-added-contains-event: + comment-contains-value: (un)?lock branch$ + + ##################### + # Job Configuration # + ##################### + + project-type: freestyle + node: '{build-node}' + + properties: + - lf-infra-properties: + project: '{project}' + build-days-to-keep: 1 + + parameters: + - lf-infra-parameters: + project: '{project}' + stream: '{stream}' + branch: '{branch}' + lftools-version: '{lftools-version}' + + wrappers: + - lf-infra-wrappers: + build-timeout: 5 + jenkins-ssh-credential: '{jenkins-ssh-credential}' + + scm: + - lf-infra-gerrit-scm: + git-url: '{git-url}' + refspec: '' + branch: '{branch}' + submodule-recursive: false + choosing-strategy: default + jenkins-ssh-credential: '{jenkins-ssh-credential}' + + triggers: + - gerrit: + server-name: '{gerrit-server-name}' + trigger-on: '{obj:gerrit_merge_triggers}' + projects: + - project-compare-type: ANT + project-pattern: '{project}' + branches: + - branch-compare-type: ANT + branch-pattern: '**/{branch}' + + builders: + - shell: !include-raw-escape: ../shell/gerrit-branch-lock.sh + + + publishers: + - lf-infra-publish + +################## +# JJB DEPLOY JOB # +################## + +- lf_jjb_deploy_job: &lf_jjb_deploy_job + name: lf-jjb-deploy-job + + # Deploy jobs to jenkins-sandbox system via code review comment + # + # This job checks out the current code review patch and then runs a + # `jenkins-jobs update` to push a patch defined by the comment. + # + # Comment Trigger: jjb-deploy JOB_NAME + # + # JOB_NAME can include the * wildcard character to push multiple jobs + # matching the pattern. For example `jjb-deploy builder-jjb-*`` will push + # all builder-jjb-* jobs to the sandbox system. + # + # Required parameters: + # + # :build-node: The node to run build on. + # :jenkins-ssh-credential: Credential to use for SSH. (Generally should + # be configured in defaults.yaml) + # + # Optional parameters: + # + # :git-url: URL clone project from. (default: $GIT_URL/$PROJECT) + # :gerrit_jjb_deploy_job_triggers: Override Gerrit Triggers. + + ###################### + # Default parameters # + ###################### + + branch: master + git-url: '$GIT_URL/$GERRIT_PROJECT' + stream: master + gerrit_jjb_deploy_job_triggers: + - comment-added-contains-event: + comment-contains-value: jjb-deploy (?!\*+$).+$ + + ##################### + # Job Configuration # + ##################### + + project-type: freestyle + node: '{build-node}' + concurrent: true + + properties: + - lf-infra-properties: + project: '{project}' + build-days-to-keep: 1 + + parameters: + - lf-infra-parameters: + project: '{project}' + stream: '{stream}' + branch: '{branch}' + lftools-version: '{lftools-version}' + + wrappers: + - lf-infra-wrappers: + build-timeout: 5 + jenkins-ssh-credential: '{jenkins-ssh-credential}' + + builders: + - lf-pip-install: + pip-packages: jenkins-job-builder + - lf-infra-jjbini-sandbox + - shell: !include-raw-escape: ../shell/jjb-deploy-job.sh + + publishers: + - lf-infra-publish + +- job-template: + name: '{project-name}-jjb-deploy-job' + id: gerrit-jjb-deploy-job + <<: *lf_jjb_deploy_job + + scm: + - lf-infra-gerrit-scm: + git-url: '{git-url}' + refspec: 'refs/heads/{branch}' + branch: '{branch}' + submodule-recursive: true + choosing-strategy: default + jenkins-ssh-credential: '{jenkins-ssh-credential}' + + triggers: + - gerrit: + server-name: '{gerrit-server-name}' + trigger-on: '{obj:gerrit_jjb_deploy_job_triggers}' + projects: + - project-compare-type: ANT + project-pattern: '{project}' + branches: + - branch-compare-type: ANT + branch-pattern: '**/{branch}' + +- job-template: + name: '{project-name}-jjb-deploy-job' + id: github-jjb-deploy-job + <<: *lf_jjb_deploy_job + + properties: + - github: + url: '{git-url}/{github-org}/{project}' + + scm: + - lf-infra-github-scm: + url: '{git-clone-url}{github-org}/{project}' + refspec: '+refs/pull/*:refs/remotes/origin/pr/*' + branch: '{branch}' + submodule-recursive: true + choosing-strategy: default + jenkins-ssh-credential: '{jenkins-ssh-credential}' + + triggers: + - lf-infra-github-pr-trigger: + trigger-phrase: '^jjb-deploy (?!\*+$).+$' + only-trigger-phrase: true + status-context: 'JJB Deploy Job' + permit-all: true + github-hooks: true + github-org: '' + github_pr_whitelist: + - '' + github_pr_admin_list: + - '' + ############# # JJB Merge # #############