X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=blobdiff_plain;f=jjb%2Flf-ci-jobs.yaml;h=f0972607bd692bb06f78969ee11beca6ab0e2d78;hb=e20b15582fcad2d7ac73e310bdab8a6c7db55025;hp=f9aff9082395eeb7e63aca1d4386d47dd3f6b472;hpb=9cb04c8a479acc4e67891bdf425c62afae7445fa;p=releng%2Fglobal-jjb.git diff --git a/jjb/lf-ci-jobs.yaml b/jjb/lf-ci-jobs.yaml index f9aff908..f0972607 100644 --- a/jjb/lf-ci-jobs.yaml +++ b/jjb/lf-ci-jobs.yaml @@ -1,49 +1,4 @@ --- -- job-group: - name: '{project-name}-ci-jobs' - - jobs: - - gerrit-jenkins-cfg-merge - - gerrit-jenkins-sandbox-cleanup - - gerrit-jjb-deploy-job - - gerrit-jjb-merge - - gerrit-jjb-verify - -- job-group: - name: '{project-name}-github-ci-jobs' - - jobs: - - github-jenkins-cfg-merge - - github-jenkins-sandbox-cleanup - - github-jjb-deploy-job - - github-jjb-merge - - github-jjb-verify - -- job-group: - name: '{project-name}-info-yaml-jobs' - - jobs: - - gerrit-info-yaml-verify - -- job-group: - name: '{project-name}-github-info-yaml-jobs' - - jobs: - - github-info-yaml-verify - -- job-group: - name: '{project-name}-packer-jobs' - - jobs: - - gerrit-packer-merge - - gerrit-packer-verify - -- job-group: - name: '{project-name}-github-packer-jobs' - - jobs: - - github-packer-merge - - github-packer-verify #################### # COMMON FUNCTIONS # @@ -81,8 +36,9 @@ github-url: 'https://github.com' stream: master submodule-recursive: true + submodule-timeout: 10 packer-cloud-settings: packer-cloud-env - packer-version: 1.2.3 + packer-version: 1.2.5 ##################### # Job Configuration # @@ -121,6 +77,10 @@ name: JJB_VERSION default: '{jjb-version}' description: Jenkins Job Builder version to download and install. + - string: + name: XDG_CACHE_HOME + default: '{jjb-cache}' + description: Jenkins Job Builder cache location. - parameter: name: lf-packer-parameters @@ -141,32 +101,25 @@ build-timeout: 10 disable-job: false github-url: 'https://github.com' - jjb-version: 2.2.1 + jjb-cache: '$HOME/.cache/jenkins_jobs' + jjb-version: 2.8.0 stream: master submodule-recursive: true + submodule-timeout: 10 gerrit_trigger_file_paths: - compare-type: REG_EXP - pattern: '.*\.groovy' - - compare-type: REG_EXP - pattern: '.*\.sh' - - compare-type: REG_EXP - pattern: '.*\.bat' - - compare-type: REG_EXP - pattern: '.*\.ps1' + pattern: 'jjb/.*' - compare-type: REG_EXP - pattern: '.*\.(yaml|yml)' + pattern: 'global-jjb' - compare-type: REG_EXP - pattern: '.*\/global-jjb' + pattern: 'shell/.*' # github_included_regions MUST match gerrit_trigger_file_paths github_included_regions: - - '.*\.groovy' - - '.*\.sh' - - '.*\.bat' - - '.*\.ps1' - - '.*\.(yaml|yml)' - - '.*\/global-jjb' + - 'jjb/.*' + - 'global-jjb' + - 'shell/.*' ##################### # Job Configuration # @@ -188,6 +141,7 @@ branch: '{branch}' lftools-version: '{lftools-version}' - lf-infra-jjb-parameters: + jjb-cache: '{jjb-cache}' jjb-version: '{jjb-version}' wrappers: @@ -214,6 +168,7 @@ disable-job: false git-url: '$GIT_URL/$GERRIT_PROJECT' stream: master + submodule-timeout: 10 gerrit_merge_triggers: - comment-added-contains-event: comment-contains-value: (un)?lock branch$ @@ -249,6 +204,7 @@ refspec: '' branch: '{branch}' submodule-recursive: false + submodule-timeout: '{submodule-timeout}' choosing-strategy: default jenkins-ssh-credential: '{jenkins-ssh-credential}' @@ -281,7 +237,7 @@ - inject: properties-content: 'jenkins_silos={jenkins-silos}' - shell: !include-raw-escape: ../shell/jenkins-configure-clouds.sh - - shell: rm "$HOME/.config/jenkins_jobs/jenkins_jobs.ini" + - shell: rm -f "$HOME/.config/jenkins_jobs/jenkins_jobs.ini" - builder: name: lf-jenkins-cfg-global-vars @@ -290,7 +246,7 @@ - inject: properties-content: 'jenkins_silos={jenkins-silos}' - shell: !include-raw-escape: ../shell/jenkins-configure-global-vars.sh - - shell: rm "$HOME/.config/jenkins_jobs/jenkins_jobs.ini" + - shell: rm -f "$HOME/.config/jenkins_jobs/jenkins_jobs.ini" - lf_jenkins_configuration: &lf_jenkins_cfg_merge name: lf-jenkins-cfg-merge @@ -305,6 +261,7 @@ git-url: '$GIT_URL/$GERRIT_PROJECT' github-url: 'https://github.com' jenkins-silos: production sandbox + submodule-timeout: 10 gerrit_merge_triggers: - change-merged-event @@ -346,8 +303,7 @@ jenkins-ssh-credential: '{jenkins-ssh-credential}' builders: - - shell: !include-raw-escape: - - ../shell/lftools-install.sh + - lf-infra-pre-build - lf-jenkins-cfg-global-vars: jenkins-silos: '{jenkins-silos}' - lf-jenkins-cfg-clouds: @@ -367,6 +323,7 @@ refspec: 'refs/heads/{branch}' branch: '{branch}' submodule-recursive: true + submodule-timeout: '{submodule-timeout}' choosing-strategy: default jenkins-ssh-credential: '{jenkins-ssh-credential}' @@ -401,6 +358,7 @@ refspec: '' branch: 'refs/heads/{branch}' submodule-recursive: true + submodule-timeout: '{submodule-timeout}' choosing-strategy: default jenkins-ssh-credential: '{jenkins-ssh-credential}' @@ -423,6 +381,143 @@ white-list-target-branches: - '{branch}' +########################################### +# Jenkins Configuration Management Verify # +########################################### + +- lf_jenkins_configuration: &lf_jenkins_cfg_verify + name: lf-jenkins-cfg-verify + + ###################### + # Default parameters # + ###################### + + branch: master + build-days-to-keep: 7 + disable-job: false + git-url: '$GIT_URL/$GERRIT_PROJECT' + github-url: 'https://github.com' + openstack-cloud: vex + submodule-timeout: 10 + + gerrit_verify_triggers: + - patchset-created-event: + exclude-drafts: true + exclude-trivial-rebase: false + exclude-no-code-change: false + - draft-published-event + - comment-added-contains-event: + comment-contains-value: '^Patch Set[ ]+[0-9]+:([ ]+|[\n]+)(recheck|reverify)$' + + gerrit_trigger_file_paths: + - compare-type: REG_EXP + pattern: 'jenkins-config\/.*' + + # github_included_regions MUST match gerrit_trigger_file_paths + github_included_regions: + - 'jenkins-config\/.*' + + ##################### + # Job Configuration # + ##################### + + project-type: freestyle + node: '{build-node}' + concurrent: true + disabled: '{disable-job}' + + properties: + - lf-infra-properties: + project: '{project}' + build-days-to-keep: 1 + + parameters: + - lf-infra-parameters: + project: '{project}' + stream: '' + branch: master + lftools-version: '{lftools-version}' + + wrappers: + - lf-infra-wrappers: + build-timeout: 10 + jenkins-ssh-credential: '{jenkins-ssh-credential}' + - config-file-provider: + # Listed after to override openstack-infra-wrappers clouds.yaml + # definition + files: + - file-id: clouds-yaml + target: '$HOME/.config/openstack/clouds.yaml' + - file-id: npmrc + target: '$HOME/.npmrc' + - file-id: pipconf + target: '$HOME/.config/pip/pip.conf' + + builders: + - lf-infra-pre-build + - inject: + properties-content: OS_CLOUD={openstack-cloud} + - shell: !include-raw-escape: ../shell/jenkins-verify-images.sh + + publishers: + - lf-infra-publish + +- job-template: + name: '{project-name}-jenkins-cfg-verify' + id: gerrit-jenkins-cfg-verify + <<: *lf_jenkins_cfg_verify + + scm: + - lf-infra-gerrit-scm: + git-url: '{git-url}' + refspec: 'refs/heads/{branch}' + branch: '{branch}' + submodule-recursive: true + submodule-timeout: '{submodule-timeout}' + choosing-strategy: default + jenkins-ssh-credential: '{jenkins-ssh-credential}' + + triggers: + - gerrit: + server-name: '{gerrit-server-name}' + trigger-on: '{obj:gerrit_verify_triggers}' + projects: + - project-compare-type: ANT + project-pattern: '{project}' + branches: + - branch-compare-type: ANT + branch-pattern: '**/{branch}' + file-paths: '{obj:gerrit_trigger_file_paths}' + +- job-template: + name: '{project-name}-jenkins-cfg-verify' + id: github-jenkins-cfg-verify + <<: *lf_jenkins_cfg_verify + + properties: + - github: + url: '{github-url}/{github-org}/{project}' + + scm: + - lf-infra-github-scm: + url: '{git-clone-url}{github-org}/{project}' + refspec: '+refs/pull/*:refs/remotes/origin/pr/*' + branch: '$sha1' + submodule-recursive: '{submodule-recursive}' + submodule-timeout: '{submodule-timeout}' + choosing-strategy: default + jenkins-ssh-credential: '{jenkins-ssh-credential}' + + triggers: + - github-pull-request: + trigger-phrase: '^(recheck|reverify)$' + only-trigger-phrase: false + status-context: 'Jenkins CFG Verify' + permit-all: true + github-hooks: true + included-regions: '{obj:github_included_regions}' + white-list-target-branches: + - '{branch}' ########################### # JENKINS SANDBOX CLEANUP # @@ -451,6 +546,7 @@ parameters: - lf-infra-jjb-parameters: + jjb-cache: '{jjb-cache}' jjb-version: '{jjb-version}' triggers: @@ -496,6 +592,7 @@ git-url: '$GIT_URL/$PROJECT' github-url: 'https://github.com' stream: master + submodule-timeout: 10 gerrit_jjb_deploy_job_triggers: - comment-added-contains-event: comment-contains-value: 'jjb-deploy[:]* (?!\*+$).+$' @@ -546,6 +643,7 @@ refspec: 'refs/heads/{branch}' branch: '{branch}' submodule-recursive: true + submodule-timeout: '{submodule-timeout}' choosing-strategy: default jenkins-ssh-credential: '{jenkins-ssh-credential}' @@ -583,6 +681,7 @@ refspec: '+refs/pull/*:refs/remotes/origin/pr/*' branch: '$sha1' submodule-recursive: true + submodule-timeout: '{submodule-timeout}' choosing-strategy: default jenkins-ssh-credential: '{jenkins-ssh-credential}' @@ -617,6 +716,7 @@ ##################### builders: + - lf-infra-pre-build - lf-infra-jjbini - shell: !include-raw-escape: - ../shell/jjb-install.sh @@ -638,6 +738,7 @@ refspec: '' branch: '{branch}' submodule-recursive: '{submodule-recursive}' + submodule-timeout: '{submodule-timeout}' choosing-strategy: default jenkins-ssh-credential: '{jenkins-ssh-credential}' @@ -677,6 +778,7 @@ refspec: '' branch: 'refs/heads/{branch}' submodule-recursive: '{submodule-recursive}' + submodule-timeout: '{submodule-timeout}' choosing-strategy: default jenkins-ssh-credential: '{jenkins-ssh-credential}' @@ -725,6 +827,7 @@ concurrent: true builders: + - lf-infra-pre-build - lf-infra-jjbini - shell: !include-raw-escape: - ../shell/git-validate-jira-urls.sh @@ -757,6 +860,7 @@ refspec: '$GERRIT_REFSPEC' branch: '$GERRIT_BRANCH' submodule-recursive: '{submodule-recursive}' + submodule-timeout: '{submodule-timeout}' choosing-strategy: gerrit jenkins-ssh-credential: '{jenkins-ssh-credential}' @@ -796,6 +900,7 @@ refspec: '+refs/pull/*:refs/remotes/origin/pr/*' branch: '$sha1' submodule-recursive: '{submodule-recursive}' + submodule-timeout: '{submodule-timeout}' choosing-strategy: default jenkins-ssh-credential: '{jenkins-ssh-credential}' @@ -825,7 +930,7 @@ builders: - shell: | - cd jjb/global-jjb + cd global-jjb git fetch https://gerrit.linuxfoundation.org/infra/releng/global-jjb $GERRIT_REFSPEC git cherry-pick FETCH_HEAD - lf-infra-jjbini @@ -849,6 +954,7 @@ ###################### git-url: '$GIT_URL/$PROJECT' + submodule-timeout: 10 ##################### # Job Configuration # @@ -860,6 +966,7 @@ refspec: '' branch: 'master' submodule-recursive: true + submodule-timeout: '{submodule-timeout}' choosing-strategy: default jenkins-ssh-credential: '{jenkins-ssh-credential}' @@ -915,6 +1022,7 @@ project-pattern: '**' spdx-disable: false stream: master + submodule-timeout: 10 ##################### # Job Configuration # @@ -966,6 +1074,7 @@ branch: '$GERRIT_BRANCH' # Submodules are out of the project's control submodule-recursive: false + submodule-timeout: '{submodule-timeout}' choosing-strategy: gerrit jenkins-ssh-credential: '{jenkins-ssh-credential}' @@ -1006,6 +1115,7 @@ branch: '$sha1' # Submodules are out of the project's control submodule-recursive: false + submodule-timeout: '{submodule-timeout}' choosing-strategy: default jenkins-ssh-credential: '{jenkins-ssh-credential}' @@ -1065,6 +1175,7 @@ refspec: '$GERRIT_REFSPEC' branch: '$GERRIT_BRANCH' submodule-recursive: '{submodule-recursive}' + submodule-timeout: '{submodule-timeout}' choosing-strategy: gerrit jenkins-ssh-credential: '{jenkins-ssh-credential}' @@ -1100,6 +1211,7 @@ refspec: '+refs/pull/*:refs/remotes/origin/pr/*' branch: '$sha1' submodule-recursive: '{submodule-recursive}' + submodule-timeout: '{submodule-timeout}' choosing-strategy: default jenkins-ssh-credential: '{jenkins-ssh-credential}' @@ -1129,12 +1241,19 @@ branch: master build-days-to-keep: 7 build-timeout: 10 - cron: '@daily' + cron: '@hourly' disable-job: false git-url: '$GIT_URL/$PROJECT' github-url: 'https://github.com' openstack-cloud: vex + openstack-image-cleanup: true + openstack-image-cleanup-age: 30 + openstack-image-protect: true + openstack-server-cleanup: true + openstack-stack-cleanup: true + openstack-volume-cleanup: true stream: master + submodule-timeout: 10 ##################### # Job Configuration # @@ -1155,6 +1274,11 @@ stream: '{stream}' branch: '{branch}' lftools-version: '{lftools-version}' + - string: + name: JENKINS_URLS + default: '{jenkins-urls}' + description: | + Space separated list of Jenkins URLs to check for active builds. wrappers: - lf-infra-wrappers: @@ -1174,10 +1298,40 @@ - timed: '{obj:cron}' builders: + - lf-infra-pre-build - inject: properties-content: OS_CLOUD={openstack-cloud} - - shell: !include-raw-escape: ../shell/openstack-install.sh - - shell: !include-raw-escape: ../shell/openstack-protect-in-use-images.sh + # Stacks + - conditional-step: + condition-kind: boolean-expression + condition-expression: '{openstack-stack-cleanup}' + steps: + - shell: !include-raw-escape: ../shell/openstack-cleanup-orphaned-stacks.sh + # Servers + - conditional-step: + condition-kind: boolean-expression + condition-expression: '{openstack-server-cleanup}' + steps: + - shell: !include-raw-escape: ../shell/openstack-cleanup-orphaned-servers.sh + # Volumes + - conditional-step: + condition-kind: boolean-expression + condition-expression: '{openstack-volume-cleanup}' + steps: + - shell: !include-raw-escape: ../shell/openstack-cleanup-orphaned-volumes.sh + # Images + - conditional-step: + condition-kind: boolean-expression + condition-expression: '{openstack-image-protect}' + steps: + - shell: !include-raw-escape: ../shell/openstack-protect-in-use-images.sh + - conditional-step: + condition-kind: boolean-expression + condition-expression: '{openstack-image-cleanup}' + steps: + - inject: + properties-content: OS_IMAGE_CLEANUP_AGE={openstack-image-cleanup-age} + - shell: !include-raw-escape: ../shell/openstack-cleanup-old-images.sh publishers: - lf-infra-publish @@ -1193,6 +1347,7 @@ refspec: 'refs/heads/{branch}' branch: '{branch}' submodule-recursive: true + submodule-timeout: '{submodule-timeout}' choosing-strategy: default jenkins-ssh-credential: '{jenkins-ssh-credential}' @@ -1207,6 +1362,7 @@ refspec: '' branch: 'refs/heads/{branch}' submodule-recursive: true + submodule-timeout: '{submodule-timeout}' choosing-strategy: default jenkins-ssh-credential: '{jenkins-ssh-credential}' @@ -1217,12 +1373,30 @@ - lf_packer_merge: &lf_packer_merge name: lf-packer-merge + ###################### + # Default parameters # + ###################### + + openstack: true + openstack-cloud: vex + ##################### # Job Configuration # ##################### + parameters: + - lf-infra-parameters: + project: '{project}' + stream: '{stream}' + branch: '{branch}' + lftools-version: '{lftools-version}' + - lf-packer-parameters: + packer-version: '{packer-version}' + builders: - lf-infra-packer-build: + openstack: '{openstack}' + openstack-cloud: '{openstack-cloud}' packer-cloud-settings: '{packer-cloud-settings}' packer-version: '{packer-version}' platform: '{platforms}' @@ -1256,6 +1430,7 @@ refspec: '$GERRIT_REFSPEC' branch: '$GERRIT_BRANCH' submodule-recursive: '{submodule-recursive}' + submodule-timeout: '{submodule-timeout}' choosing-strategy: gerrit jenkins-ssh-credential: '{jenkins-ssh-credential}' @@ -1307,9 +1482,12 @@ scm: - lf-infra-github-scm: url: '{git-clone-url}{github-org}/{project}' - refspec: '' - branch: 'refs/heads/{branch}' + refspec: > + +refs/heads/*:refs/remotes/origin/* + +refs/pull/*:refs/remotes/origin/pr/* + branch: '$GERRIT_REFSPEC' submodule-recursive: '{submodule-recursive}' + submodule-timeout: '{submodule-timeout}' choosing-strategy: default jenkins-ssh-credential: '{jenkins-ssh-credential}' @@ -1353,6 +1531,8 @@ ###################### build-timeout: 10 + openstack: true + openstack-cloud: vex gerrit_verify_triggers: - patchset-created-event: @@ -1379,6 +1559,8 @@ builders: - lf-infra-packer-validate: + openstack: '{openstack}' + openstack-cloud: '{openstack-cloud}' packer-cloud-settings: '{packer-cloud-settings}' packer-version: '{packer-version}' @@ -1405,6 +1587,7 @@ refspec: '$GERRIT_REFSPEC' branch: '$GERRIT_BRANCH' submodule-recursive: '{submodule-recursive}' + submodule-timeout: '{submodule-timeout}' choosing-strategy: gerrit jenkins-ssh-credential: '{jenkins-ssh-credential}' @@ -1444,6 +1627,7 @@ refspec: '+refs/pull/*:refs/remotes/origin/pr/*' branch: '$sha1' submodule-recursive: '{submodule-recursive}' + submodule-timeout: '{submodule-timeout}' choosing-strategy: default jenkins-ssh-credential: '{jenkins-ssh-credential}'