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}'
458 pattern: 'common/ci/**'
460 pattern: 'common/manifests/**'
462 pattern: 'common/puppet-opnfv/**'
464 pattern: 'common/tools/**'
466 pattern: '{installer}/build/**'
468 pattern: '{installer}/ci/**'
470 pattern: '{installer}/include/**'
471 forbidden-file-paths:
473 pattern: 'common/docs/**'
475 pattern: '{installer}/docs/**'
476 dependency-jobs: 'genesis-foreman-verify-build-{stream}'
480 - 'foreman-deploy-virtual'
482 ########################
484 ########################
486 name: foreman-parameter
490 default: '{installer}'
491 description: "Installer to use."
493 name: BUILD_DIRECTORY
494 default: $WORKSPACE/build_output
495 description: "Directory where the build artifact will be located upon the completion of the build."
497 name: CACHE_DIRECTORY
498 default: $HOME/opnfv/cache/genesis-$INSTALLER{gs-pathname}
499 description: "Directory where the cache to be used during the build is located."
502 default: https://gerrit.opnfv.org/gerrit/$PROJECT
503 description: "Used for overriding the GIT URL coming from Global Jenkins configuration in case if the stuff is done on none-LF HW."
506 default: artifacts.opnfv.org/$PROJECT/$INSTALLER{gs-pathname}
507 description: "URL to Google Storage."
509 ########################
511 ########################
513 name: 'foreman-lab-reconfig'
521 # check to see if ucs login info file exists
522 if [ -e ~/.ssh/ucs_creds ];then
523 source ~/.ssh/ucs_creds
525 echo "Unable to find UCS credentials for LF lab reconfiguration...Exiting"
530 echo "Cloning releng repo..."
531 if ! GIT_SSL_NO_VERIFY=true git clone https://gerrit.opnfv.org/gerrit/releng; then
532 echo "Unable to clone releng repo...Exiting"
536 # log info to console
537 echo "Starting the lab reconfiguration for $INSTALLER..."
538 echo "--------------------------------------------------------"
542 $WORKSPACE/releng/utils/lab-reconfiguration/create_venv.sh
544 # disable nounset because 'activate' script contains unbound variable(s)
547 source $WORKSPACE/releng/utils/lab-reconfiguration/venv/bin/activate
548 # set nounset back again
551 # verify we are in venv
552 if [[ ! $(which python | grep venv) ]]; then
553 echo "Unable to activate venv...Exiting"
557 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
559 # while undergoing reboot
562 # check to see if slave is back up
565 while [ "$ping_counter" -lt 20 ]; do
566 if [[ $(ping -c 5 172.30.10.72) ]]; then
574 if [ "$ping_flag" -eq 1 ]; then
575 echo "Slave is pingable, now wait 180 seconds for services to start"
578 echo "Slave did not come back up after reboot: please check opnfv-jump-2"
586 echo "--------------------------------------------------------"
590 name: 'foreman-build'
598 # log info to console
599 echo "Starting the build of $INSTALLER. This could take some time..."
600 echo "--------------------------------------------------------"
603 # create the cache directory if it doesn't exist
604 [[ -d $CACHE_DIRECTORY ]] || mkdir -p $CACHE_DIRECTORY
606 # set OPNFV_ARTIFACT_VERSION
607 export OPNFV_ARTIFACT_VERSION=$(date -u +"%Y-%m-%d_%H-%M-%S")
610 cd $WORKSPACE/$INSTALLER/ci
611 ./build.sh -v $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY $BUILD_DIRECTORY
613 # list the contents of BUILD_OUTPUT directory
614 ls -al $BUILD_DIRECTORY
616 # save information regarding artifact into file
618 echo "OPNFV_ARTIFACT_VERSION=$OPNFV_ARTIFACT_VERSION"
619 echo "OPNFV_GIT_URL=$(git config --get remote.origin.url)"
620 echo "OPNFV_GIT_SHA1=$(git rev-parse HEAD)"
621 echo "OPNFV_ARTIFACT_URL=$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
622 echo "OPNFV_ARTIFACT_MD5SUM=$(md5sum $BUILD_DIRECTORY/OPNFV-CentOS-7-x86_64-$OPNFV_ARTIFACT_VERSION.iso | cut -d' ' -f1)"
623 echo "OPNFV_BUILD_URL=$BUILD_URL"
624 ) > $WORKSPACE/opnfv.properties
627 echo "--------------------------------------------------------"
631 name: 'foreman-deploy'
639 # log info to console
640 echo "Starting the deployment using $INSTALLER. This could take some time..."
641 echo "--------------------------------------------------------"
645 sudo $WORKSPACE/common/ci/clean.sh -base_config $WORKSPACE/$INSTALLER/ci/inventory/lf_pod2_ksgen_settings.yml
647 echo "Sleeping for 60 seconds between clean and deploy to allow nodes to power off"
650 # and then initiate deployment
651 sudo $WORKSPACE/$INSTALLER/ci/deploy.sh -base_config $WORKSPACE/$INSTALLER/ci/inventory/lf_pod2_ksgen_settings.yml
654 echo "--------------------------------------------------------"
658 name: 'foreman-deploy-virtual'
666 # log info to console
667 echo "Starting the virtual deployment using $INSTALLER. This could take some time..."
668 echo "--------------------------------------------------------"
671 # cleanup baremetal first (in case baremetal was being used on pod2, remove when moved to isolated Virtual pod)
672 sudo $WORKSPACE/common/ci/clean.sh
674 # initiate virtual deployment
675 sudo $WORKSPACE/$INSTALLER/ci/deploy.sh -virtual
678 echo "--------------------------------------------------------"
682 name: 'foreman-upload-artifact'
690 # log info to console
691 echo "Uploading the $INSTALLER artifact. This could take some time..."
692 echo "--------------------------------------------------------"
695 # source the opnfv.properties to get ARTIFACT_VERSION
696 source $WORKSPACE/opnfv.properties
698 # upload artifact and additional files to google storage
699 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
700 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.properties > gsutil.properties.log 2>&1
701 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/latest.properties > gsutil.latest.log 2>&1
704 echo "--------------------------------------------------------"
706 echo "Artifact is available as http://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
709 name: 'foreman-workspace-cleanup'
717 # delete everything that is in $WORKSPACE
718 /bin/rm -rf $WORKSPACE
720 ########################
722 ########################
724 name: 'foreman-master'
726 - timed: '0 11 * * *'
729 name: 'foreman-stable-arno'
731 - timed: '0 17 * * *'