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)
31 ########################
33 ########################
36 name: 'genesis-foreman-verify-build-{stream}'
38 project-type: freestyle
52 artifactDaysToKeep: -1
61 installer: '{installer}'
62 gs-pathname: '{gs-pathname}'
65 credentials-id: '{ssh-credentials}'
66 refspec: '$GERRIT_REFSPEC'
67 choosing-strategy: 'gerrit'
70 - ssh-agent-credentials:
71 user: '{ssh-credentials}'
76 - patchset-created-event:
77 exclude-drafts: 'false'
78 exclude-trivial-rebase: 'false'
79 exclude-no-code-change: 'false'
80 - draft-published-event
81 - comment-added-contains-event:
82 comment-contains-value: 'recheck'
83 - comment-added-contains-event:
84 comment-contains-value: 'reverify'
86 - project-compare-type: 'ANT'
87 project-pattern: 'genesis'
89 - branch-compare-type: 'ANT'
90 branch-pattern: '**/{branch}'
93 pattern: 'common/ci/**'
95 pattern: 'common/manifests/**'
97 pattern: 'common/puppet-opnfv/**'
99 pattern: 'common/tools/**'
101 pattern: '{installer}/build/**'
103 pattern: '{installer}/ci/**'
105 pattern: '{installer}/include/**'
106 forbidden-file-paths:
108 pattern: 'common/docs/**'
110 pattern: '{installer}/docs/**'
114 - 'foreman-workspace-cleanup'
117 name: 'genesis-foreman-merge-{stream}'
119 project-type: freestyle
133 artifactDaysToKeep: -1
142 installer: '{installer}'
145 - gerrit-trigger-scm:
146 credentials-id: '{ssh-credentials}'
148 choosing-strategy: 'default'
151 - ssh-agent-credentials:
152 user: '{ssh-credentials}'
157 - change-merged-event
158 - comment-added-contains-event:
159 comment-contains-value: 'remerge'
161 - project-compare-type: 'ANT'
162 project-pattern: 'genesis'
164 - branch-compare-type: 'ANT'
165 branch-pattern: '**/{branch}'
168 pattern: 'common/ci/**'
170 pattern: 'common/manifests/**'
172 pattern: 'common/puppet-opnfv/**'
174 pattern: 'common/tools/**'
176 pattern: '{installer}/build/**'
178 pattern: '{installer}/ci/**'
180 pattern: '{installer}/include/**'
181 forbidden-file-paths:
183 pattern: 'common/docs/**'
185 pattern: '{installer}/docs/**'
189 - 'foreman-workspace-cleanup'
192 name: 'genesis-foreman-daily-{stream}'
194 project-type: freestyle
207 installer: '{installer}'
208 gs-pathname: '{gs-pathname}'
212 credentials-id: '{ssh-credentials}'
219 artifactDaysToKeep: -1
220 artifactNumToKeep: -1
224 - project: 'genesis-foreman-build-{stream}'
228 - project: 'genesis-foreman-lab-reconfig-{stream}'
232 - project: 'genesis-foreman-deploy-{stream}'
236 - project: 'functest-foreman-{stream}'
239 build-step-failure-threshold: 'never'
240 failure-threshold: 'never'
241 unstable-threshold: 'FAILURE'
243 - project: 'yardstick-foreman-{stream}'
246 build-step-failure-threshold: 'never'
247 failure-threshold: 'never'
248 unstable-threshold: 'FAILURE'
251 name: 'genesis-foreman-deploy-runner-{stream}'
253 project-type: freestyle
262 artifactDaysToKeep: -1
263 artifactNumToKeep: -1
269 installer: '{installer}'
270 gs-pathname: '{gs-pathname}'
273 default: ssh://gerrit.opnfv.org:29418/$PROJECT
274 description: "Used for overriding the GIT URL coming from parameters macro."
278 credentials-id: '{ssh-credentials}'
284 use-build-blocker: true
286 - "genesis-fuel-daily.*"
287 - "genesis-fuel-deploy-runner-{stream}"
288 - "genesis-foreman-daily.*"
291 - 'foreman-lab-reconfig'
293 - project: 'genesis-foreman-deploy-{stream}'
298 name: 'genesis-foreman-build-{stream}'
300 project-type: freestyle
307 artifactDaysToKeep: -1
308 artifactNumToKeep: -1
314 installer: '{installer}'
315 gs-pathname: '{gs-pathname}'
318 credentials-id: '{ssh-credentials}'
324 - 'foreman-upload-artifact'
325 - 'foreman-workspace-cleanup'
328 name: 'genesis-foreman-deploy-{stream}'
330 project-type: freestyle
339 artifactDaysToKeep: -1
340 artifactNumToKeep: -1
346 installer: '{installer}'
347 gs-pathname: '{gs-pathname}'
350 default: ssh://gerrit.opnfv.org:29418/$PROJECT
351 description: "Used for overriding the GIT URL coming from parameters macro."
355 credentials-id: '{ssh-credentials}'
363 name: 'genesis-foreman-lab-reconfig-{stream}'
365 project-type: freestyle
374 artifactDaysToKeep: -1
375 artifactNumToKeep: -1
381 installer: '{installer}'
382 gs-pathname: '{gs-pathname}'
385 default: ssh://gerrit.opnfv.org:29418/$PROJECT
386 description: "Used for overriding the GIT URL coming from parameters macro."
390 credentials-id: '{ssh-credentials}'
396 use-build-blocker: true
398 - "genesis-fuel-daily.*"
401 - 'foreman-lab-reconfig'
404 name: 'genesis-foreman-verify-deploy-virtual-{stream}'
406 project-type: freestyle
413 artifactDaysToKeep: -1
414 artifactNumToKeep: -1
422 installer: '{installer}'
423 gs-pathname: '{gs-pathname}'
426 default: ssh://gerrit.opnfv.org:29418/$PROJECT
427 description: "Used for overriding the GIT URL coming from parameters macro."
429 - gerrit-trigger-scm:
430 credentials-id: '{ssh-credentials}'
431 refspec: '$GERRIT_REFSPEC'
432 choosing-strategy: 'gerrit'
435 - ssh-agent-credentials:
436 user: '{ssh-credentials}'
441 - patchset-created-event:
442 exclude-drafts: 'false'
443 exclude-trivial-rebase: 'false'
444 exclude-no-code-change: 'false'
445 - draft-published-event
446 - comment-added-contains-event:
447 comment-contains-value: 'recheck'
448 - comment-added-contains-event:
449 comment-contains-value: 'reverify'
451 - project-compare-type: 'ANT'
452 project-pattern: 'genesis'
454 - branch-compare-type: 'ANT'
455 branch-pattern: '**/{branch}'
460 pattern: '{installer}/**'
461 dependency-jobs: 'genesis-foreman-verify-build-{stream}'
465 - 'foreman-deploy-virtual'
467 ########################
469 ########################
471 name: foreman-parameter
475 default: '{installer}'
476 description: "Installer to use."
478 name: BUILD_DIRECTORY
479 default: $WORKSPACE/build_output
480 description: "Directory where the build artifact will be located upon the completion of the build."
482 name: CACHE_DIRECTORY
483 default: $HOME/opnfv/cache/genesis-$INSTALLER{gs-pathname}
484 description: "Directory where the cache to be used during the build is located."
487 default: https://gerrit.opnfv.org/gerrit/$PROJECT
488 description: "Used for overriding the GIT URL coming from Global Jenkins configuration in case if the stuff is done on none-LF HW."
491 default: artifacts.opnfv.org/$PROJECT/$INSTALLER{gs-pathname}
492 description: "URL to Google Storage."
494 ########################
496 ########################
498 name: 'foreman-lab-reconfig'
506 # check to see if ucs login info file exists
507 if [ -e ~/.ssh/ucs_creds ];then
508 source ~/.ssh/ucs_creds
510 echo "Unable to find UCS credentials for LF lab reconfiguration...Exiting"
515 echo "Cloning releng repo..."
516 if ! GIT_SSL_NO_VERIFY=true git clone https://gerrit.opnfv.org/gerrit/releng; then
517 echo "Unable to clone releng repo...Exiting"
521 # log info to console
522 echo "Starting the lab reconfiguration for $INSTALLER..."
523 echo "--------------------------------------------------------"
527 $WORKSPACE/releng/utils/lab-reconfiguration/create_venv.sh
529 # disable nounset because 'activate' script contains unbound variable(s)
532 source $WORKSPACE/releng/utils/lab-reconfiguration/venv/bin/activate
533 # set nounset back again
536 # verify we are in venv
537 if [[ ! $(which python | grep venv) ]]; then
538 echo "Unable to activate venv...Exiting"
542 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
544 # while undergoing reboot
547 # check to see if slave is back up
550 while [ "$ping_counter" -lt 20 ]; do
551 if [[ $(ping -c 5 172.30.10.72) ]]; then
559 if [ "$ping_flag" -eq 1 ]; then
560 echo "Slave is pingable, now wait 180 seconds for services to start"
563 echo "Slave did not come back up after reboot: please check opnfv-jump-2"
571 echo "--------------------------------------------------------"
575 name: 'foreman-build'
583 # log info to console
584 echo "Starting the build of $INSTALLER. This could take some time..."
585 echo "--------------------------------------------------------"
588 # create the cache directory if it doesn't exist
589 [[ -d $CACHE_DIRECTORY ]] || mkdir -p $CACHE_DIRECTORY
591 # set OPNFV_ARTIFACT_VERSION
592 export OPNFV_ARTIFACT_VERSION=$(date -u +"%Y-%m-%d_%H-%M-%S")
595 cd $WORKSPACE/$INSTALLER/ci
596 ./build.sh -v $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY $BUILD_DIRECTORY
598 # list the contents of BUILD_OUTPUT directory
599 ls -al $BUILD_DIRECTORY
601 # save information regarding artifact into file
603 echo "OPNFV_ARTIFACT_VERSION=$OPNFV_ARTIFACT_VERSION"
604 echo "OPNFV_GIT_URL=$(git config --get remote.origin.url)"
605 echo "OPNFV_GIT_SHA1=$(git rev-parse HEAD)"
606 echo "OPNFV_ARTIFACT_URL=$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
607 echo "OPNFV_ARTIFACT_MD5SUM=$(md5sum $BUILD_DIRECTORY/OPNFV-CentOS-7-x86_64-$OPNFV_ARTIFACT_VERSION.iso | cut -d' ' -f1)"
608 echo "OPNFV_BUILD_URL=$BUILD_URL"
609 ) > $WORKSPACE/opnfv.properties
612 echo "--------------------------------------------------------"
616 name: 'foreman-deploy'
624 # log info to console
625 echo "Starting the deployment using $INSTALLER. This could take some time..."
626 echo "--------------------------------------------------------"
630 sudo $WORKSPACE/common/ci/clean.sh -base_config $WORKSPACE/$INSTALLER/ci/inventory/lf_pod2_ksgen_settings.yml
632 # and then initiate deployment
633 sudo $WORKSPACE/$INSTALLER/ci/deploy.sh -base_config $WORKSPACE/$INSTALLER/ci/inventory/lf_pod2_ksgen_settings.yml
636 echo "--------------------------------------------------------"
640 name: 'foreman-deploy-virtual'
648 # log info to console
649 echo "Starting the virtual deployment using $INSTALLER. This could take some time..."
650 echo "--------------------------------------------------------"
653 # cleanup baremetal first (in case baremetal was being used on pod2, remove when moved to isolated Virtual pod)
654 sudo $WORKSPACE/common/ci/clean.sh
656 # initiate virtual deployment
657 sudo $WORKSPACE/$INSTALLER/ci/deploy.sh -virtual
660 echo "--------------------------------------------------------"
664 name: 'foreman-upload-artifact'
672 # log info to console
673 echo "Uploading the $INSTALLER artifact. This could take some time..."
674 echo "--------------------------------------------------------"
677 # source the opnfv.properties to get ARTIFACT_VERSION
678 source $WORKSPACE/opnfv.properties
680 # upload artifact and additional files to google storage
681 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
682 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.properties > gsutil.properties.log 2>&1
683 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/latest.properties > gsutil.latest.log 2>&1
686 echo "--------------------------------------------------------"
688 echo "Artifact is available as http://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
691 name: 'foreman-workspace-cleanup'
699 # delete everything that is in $WORKSPACE
700 /bin/rm -rf $WORKSPACE
702 ########################
704 ########################
706 name: 'foreman-master'
708 - timed: '0 11 * * *'
711 name: 'foreman-stable-arno'
713 - timed: '0 17 * * *'