1 ########################
2 # Job configuration for genesis/foreman
3 ########################
13 - 'genesis-foreman-verify-build-{stream}'
14 - 'genesis-foreman-merge-{stream}'
15 - 'genesis-foreman-daily-{stream}'
16 - 'genesis-foreman-build-{stream}'
17 - 'genesis-foreman-deploy-{stream}'
18 - 'genesis-foreman-lab-reconfig-{stream}'
19 - 'genesis-foreman-deploy-runner-{stream}'
20 - 'genesis-foreman-verify-deploy-virtual-{stream}'
22 # stream: branch with - in place of / (eg. stable-arno)
23 # branch: branch (eg. stable/arno)
33 ########################
35 ########################
38 name: 'genesis-foreman-verify-build-{stream}'
52 artifactDaysToKeep: -1
61 installer: '{installer}'
62 gs-pathname: '{gs-pathname}'
65 credentials-id: '{ssh-credentials}'
66 refspec: '$GERRIT_REFSPEC'
67 choosing-strategy: 'gerrit'
72 - patchset-created-event:
73 exclude-drafts: 'false'
74 exclude-trivial-rebase: 'false'
75 exclude-no-code-change: 'false'
76 - draft-published-event
77 - comment-added-contains-event:
78 comment-contains-value: 'recheck'
79 - comment-added-contains-event:
80 comment-contains-value: 'reverify'
82 - project-compare-type: 'ANT'
83 project-pattern: 'genesis'
85 - branch-compare-type: 'ANT'
86 branch-pattern: '**/{branch}'
89 pattern: 'common/ci/**'
91 pattern: 'common/manifests/**'
93 pattern: 'common/puppet-opnfv/**'
95 pattern: 'common/tools/**'
97 pattern: '{installer}/build/**'
99 pattern: '{installer}/ci/**'
101 pattern: '{installer}/include/**'
102 forbidden-file-paths:
104 pattern: 'common/docs/**'
106 pattern: '{installer}/docs/**'
110 - 'foreman-workspace-cleanup'
113 name: 'genesis-foreman-merge-{stream}'
127 artifactDaysToKeep: -1
136 installer: '{installer}'
139 - gerrit-trigger-scm:
140 credentials-id: '{ssh-credentials}'
142 choosing-strategy: 'default'
147 - change-merged-event
148 - comment-added-contains-event:
149 comment-contains-value: 'remerge'
151 - project-compare-type: 'ANT'
152 project-pattern: 'genesis'
154 - branch-compare-type: 'ANT'
155 branch-pattern: '**/{branch}'
158 pattern: 'common/ci/**'
160 pattern: 'common/manifests/**'
162 pattern: 'common/puppet-opnfv/**'
164 pattern: 'common/tools/**'
166 pattern: '{installer}/build/**'
168 pattern: '{installer}/ci/**'
170 pattern: '{installer}/include/**'
171 forbidden-file-paths:
173 pattern: 'common/docs/**'
175 pattern: '{installer}/docs/**'
179 - 'foreman-workspace-cleanup'
182 name: 'genesis-foreman-daily-{stream}'
186 disabled: '{obj:disabled}'
195 installer: '{installer}'
196 gs-pathname: '{gs-pathname}'
200 credentials-id: '{ssh-credentials}'
207 artifactDaysToKeep: -1
208 artifactNumToKeep: -1
212 - project: 'genesis-foreman-build-{stream}'
216 - project: 'genesis-foreman-lab-reconfig-{stream}'
220 - project: 'genesis-foreman-deploy-{stream}'
224 - project: 'functest-foreman-{stream}'
227 build-step-failure-threshold: 'never'
228 failure-threshold: 'never'
229 unstable-threshold: 'FAILURE'
231 # - project: 'yardstick-foreman-{stream}'
234 # build-step-failure-threshold: 'never'
235 # failure-threshold: 'never'
236 # unstable-threshold: 'FAILURE'
239 - trigger-parameterized-builds:
240 - project: 'genesis-fuel-daily-{stream}'
241 trigger-with-no-params: true
244 name: 'genesis-foreman-deploy-runner-{stream}'
253 artifactDaysToKeep: -1
254 artifactNumToKeep: -1
260 installer: '{installer}'
261 gs-pathname: '{gs-pathname}'
264 default: ssh://gerrit.opnfv.org:29418/$PROJECT
265 description: "Used for overriding the GIT URL coming from parameters macro."
269 credentials-id: '{ssh-credentials}'
275 use-build-blocker: true
277 - "genesis-fuel-daily.*"
278 - "genesis-fuel-deploy-runner-{stream}"
279 - "genesis-foreman-daily.*"
282 - 'foreman-lab-reconfig'
284 - project: 'genesis-foreman-deploy-{stream}'
289 name: 'genesis-foreman-build-{stream}'
296 artifactDaysToKeep: -1
297 artifactNumToKeep: -1
303 installer: '{installer}'
304 gs-pathname: '{gs-pathname}'
307 credentials-id: '{ssh-credentials}'
313 - 'foreman-upload-artifact'
314 - 'foreman-workspace-cleanup'
317 name: 'genesis-foreman-deploy-{stream}'
326 artifactDaysToKeep: -1
327 artifactNumToKeep: -1
333 installer: '{installer}'
334 gs-pathname: '{gs-pathname}'
337 default: ssh://gerrit.opnfv.org:29418/$PROJECT
338 description: "Used for overriding the GIT URL coming from parameters macro."
342 credentials-id: '{ssh-credentials}'
350 name: 'genesis-foreman-lab-reconfig-{stream}'
359 artifactDaysToKeep: -1
360 artifactNumToKeep: -1
366 installer: '{installer}'
367 gs-pathname: '{gs-pathname}'
370 default: ssh://gerrit.opnfv.org:29418/$PROJECT
371 description: "Used for overriding the GIT URL coming from parameters macro."
375 credentials-id: '{ssh-credentials}'
381 use-build-blocker: true
383 - "genesis-fuel-daily.*"
386 - 'foreman-lab-reconfig'
389 name: 'genesis-foreman-verify-deploy-virtual-{stream}'
398 artifactDaysToKeep: -1
399 artifactNumToKeep: -1
407 installer: '{installer}'
408 gs-pathname: '{gs-pathname}'
411 default: ssh://gerrit.opnfv.org:29418/$PROJECT
412 description: "Used for overriding the GIT URL coming from parameters macro."
414 - gerrit-trigger-scm:
415 credentials-id: '{ssh-credentials}'
416 refspec: '$GERRIT_REFSPEC'
417 choosing-strategy: 'gerrit'
422 - patchset-created-event:
423 exclude-drafts: 'false'
424 exclude-trivial-rebase: 'false'
425 exclude-no-code-change: 'false'
426 - draft-published-event
427 - comment-added-contains-event:
428 comment-contains-value: 'recheck'
429 - comment-added-contains-event:
430 comment-contains-value: 'reverify'
432 - project-compare-type: 'ANT'
433 project-pattern: 'genesis'
435 - branch-compare-type: 'ANT'
436 branch-pattern: '**/{branch}'
439 pattern: 'common/ci/**'
441 pattern: 'common/manifests/**'
443 pattern: 'common/puppet-opnfv/**'
445 pattern: 'common/tools/**'
447 pattern: '{installer}/build/**'
449 pattern: '{installer}/ci/**'
451 pattern: '{installer}/include/**'
452 forbidden-file-paths:
454 pattern: 'common/docs/**'
456 pattern: '{installer}/docs/**'
457 dependency-jobs: 'genesis-foreman-verify-build-{stream}'
460 - 'foreman-deploy-virtual'
462 ########################
464 ########################
466 name: foreman-parameter
470 default: '{installer}'
471 description: "Installer to use."
473 name: BUILD_DIRECTORY
474 default: $WORKSPACE/build_output
475 description: "Directory where the build artifact will be located upon the completion of the build."
477 name: CACHE_DIRECTORY
478 default: $HOME/opnfv/cache/genesis-$INSTALLER{gs-pathname}
479 description: "Directory where the cache to be used during the build is located."
482 default: https://gerrit.opnfv.org/gerrit/$PROJECT
483 description: "Used for overriding the GIT URL coming from Global Jenkins configuration in case if the stuff is done on none-LF HW."
486 default: artifacts.opnfv.org/$PROJECT/$INSTALLER{gs-pathname}
487 description: "URL to Google Storage."
489 ########################
491 ########################
493 name: 'foreman-lab-reconfig'
501 # check to see if ucs login info file exists
502 if [ -e ~/.ssh/ucs_creds ];then
503 source ~/.ssh/ucs_creds
505 echo "Unable to find UCS credentials for LF lab reconfiguration...Exiting"
510 echo "Cloning releng repo..."
511 if ! GIT_SSL_NO_VERIFY=true git clone https://gerrit.opnfv.org/gerrit/releng; then
512 echo "Unable to clone releng repo...Exiting"
516 # log info to console
517 echo "Starting the lab reconfiguration for $INSTALLER..."
518 echo "--------------------------------------------------------"
522 $WORKSPACE/releng/utils/lab-reconfiguration/create_venv.sh
524 # disable nounset because 'activate' script contains unbound variable(s)
527 source $WORKSPACE/releng/utils/lab-reconfiguration/venv/bin/activate
528 # set nounset back again
531 # verify we are in venv
532 if [[ ! $(which python | grep venv) ]]; then
533 echo "Unable to activate venv...Exiting"
537 python $WORKSPACE/releng/utils/lab-reconfiguration/reconfigUcsNet.py -i $ucs_host -u $ucs_user -p $ucs_password -f $WORKSPACE/releng/utils/lab-reconfiguration/foreman.yaml
539 # while undergoing reboot
542 # check to see if slave is back up
545 while [ "$ping_counter" -lt 20 ]; do
546 if [[ $(ping -c 5 172.30.10.72) ]]; then
554 if [ "$ping_flag" -eq 1 ]; then
555 echo "Slave is pingable, now wait 180 seconds for services to start"
558 echo "Slave did not come back up after reboot: please check opnfv-jump-2"
566 echo "--------------------------------------------------------"
570 name: 'foreman-build'
578 # log info to console
579 echo "Starting the build of $INSTALLER. This could take some time..."
580 echo "--------------------------------------------------------"
583 # create the cache directory if it doesn't exist
584 [[ -d $CACHE_DIRECTORY ]] || mkdir -p $CACHE_DIRECTORY
586 # set OPNFV_ARTIFACT_VERSION
587 export OPNFV_ARTIFACT_VERSION=$(date -u +"%Y-%m-%d_%H-%M-%S")
590 cd $WORKSPACE/$INSTALLER/ci
591 ./build.sh -v $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY $BUILD_DIRECTORY
593 # list the contents of BUILD_OUTPUT directory
594 ls -al $BUILD_DIRECTORY
596 # save information regarding artifact into file
598 echo "OPNFV_ARTIFACT_VERSION=$OPNFV_ARTIFACT_VERSION"
599 echo "OPNFV_GIT_URL=$(git config --get remote.origin.url)"
600 echo "OPNFV_GIT_SHA1=$(git rev-parse HEAD)"
601 echo "OPNFV_ARTIFACT_URL=$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
602 echo "OPNFV_ARTIFACT_MD5SUM=$(md5sum $BUILD_DIRECTORY/OPNFV-CentOS-7-x86_64-$OPNFV_ARTIFACT_VERSION.iso | cut -d' ' -f1)"
603 echo "OPNFV_BUILD_URL=$BUILD_URL"
604 ) > $WORKSPACE/opnfv.properties
607 echo "--------------------------------------------------------"
611 name: 'foreman-deploy'
619 # log info to console
620 echo "Starting the deployment using $INSTALLER. This could take some time..."
621 echo "--------------------------------------------------------"
625 sudo $WORKSPACE/common/ci/clean.sh -base_config $WORKSPACE/$INSTALLER/ci/inventory/lf_pod2_ksgen_settings.yml
627 echo "Sleeping for 60 seconds between clean and deploy to allow nodes to power off"
630 # and then initiate deployment
631 sudo $WORKSPACE/$INSTALLER/ci/deploy.sh -base_config $WORKSPACE/$INSTALLER/ci/inventory/lf_pod2_ksgen_settings.yml
634 echo "--------------------------------------------------------"
638 name: 'foreman-deploy-virtual'
646 # log info to console
647 echo "Starting the virtual deployment using $INSTALLER. This could take some time..."
648 echo "--------------------------------------------------------"
651 # cleanup baremetal first (in case baremetal was being used on pod2, remove when moved to isolated Virtual pod)
652 sudo $WORKSPACE/common/ci/clean.sh
654 # initiate virtual deployment
655 sudo $WORKSPACE/$INSTALLER/ci/deploy.sh -virtual
658 echo "--------------------------------------------------------"
662 name: 'foreman-upload-artifact'
670 # log info to console
671 echo "Uploading the $INSTALLER artifact. This could take some time..."
672 echo "--------------------------------------------------------"
675 # source the opnfv.properties to get ARTIFACT_VERSION
676 source $WORKSPACE/opnfv.properties
678 # upload artifact and additional files to google storage
679 gsutil cp $BUILD_DIRECTORY/OPNFV-CentOS-7-x86_64-$OPNFV_ARTIFACT_VERSION.iso gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso > gsutil.iso.log 2>&1
680 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.properties > gsutil.properties.log 2>&1
681 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/latest.properties > gsutil.latest.log 2>&1
684 echo "--------------------------------------------------------"
686 echo "Artifact is available as http://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
689 name: 'foreman-workspace-cleanup'
697 # delete everything that is in $WORKSPACE
698 /bin/rm -rf $WORKSPACE
700 ########################
702 ########################
704 name: 'foreman-master'
706 - timed: '0 11 * * *'
709 name: 'foreman-stable-arno'
711 - timed: '0 12 * * *'