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}'
40 project-type: freestyle
54 artifactDaysToKeep: -1
63 installer: '{installer}'
64 gs-pathname: '{gs-pathname}'
67 credentials-id: '{ssh-credentials}'
68 refspec: '$GERRIT_REFSPEC'
69 choosing-strategy: 'gerrit'
74 - patchset-created-event:
75 exclude-drafts: 'false'
76 exclude-trivial-rebase: 'false'
77 exclude-no-code-change: 'false'
78 - draft-published-event
79 - comment-added-contains-event:
80 comment-contains-value: 'recheck'
81 - comment-added-contains-event:
82 comment-contains-value: 'reverify'
84 - project-compare-type: 'ANT'
85 project-pattern: 'genesis'
87 - branch-compare-type: 'ANT'
88 branch-pattern: '**/{branch}'
91 pattern: 'common/ci/**'
93 pattern: 'common/manifests/**'
95 pattern: 'common/puppet-opnfv/**'
97 pattern: 'common/tools/**'
99 pattern: '{installer}/build/**'
101 pattern: '{installer}/ci/**'
103 pattern: '{installer}/include/**'
104 forbidden-file-paths:
106 pattern: 'common/docs/**'
108 pattern: '{installer}/docs/**'
112 - 'foreman-workspace-cleanup'
115 name: 'genesis-foreman-merge-{stream}'
117 project-type: freestyle
131 artifactDaysToKeep: -1
140 installer: '{installer}'
143 - gerrit-trigger-scm:
144 credentials-id: '{ssh-credentials}'
146 choosing-strategy: 'default'
151 - change-merged-event
152 - comment-added-contains-event:
153 comment-contains-value: 'remerge'
155 - project-compare-type: 'ANT'
156 project-pattern: 'genesis'
158 - branch-compare-type: 'ANT'
159 branch-pattern: '**/{branch}'
162 pattern: 'common/ci/**'
164 pattern: 'common/manifests/**'
166 pattern: 'common/puppet-opnfv/**'
168 pattern: 'common/tools/**'
170 pattern: '{installer}/build/**'
172 pattern: '{installer}/ci/**'
174 pattern: '{installer}/include/**'
175 forbidden-file-paths:
177 pattern: 'common/docs/**'
179 pattern: '{installer}/docs/**'
183 - 'foreman-workspace-cleanup'
186 name: 'genesis-foreman-daily-{stream}'
188 project-type: freestyle
192 disabled: '{obj:disabled}'
201 installer: '{installer}'
202 gs-pathname: '{gs-pathname}'
206 credentials-id: '{ssh-credentials}'
213 artifactDaysToKeep: -1
214 artifactNumToKeep: -1
218 - project: 'genesis-foreman-build-{stream}'
222 - project: 'genesis-foreman-lab-reconfig-{stream}'
226 - project: 'genesis-foreman-deploy-{stream}'
230 - project: 'functest-foreman-{stream}'
233 build-step-failure-threshold: 'never'
234 failure-threshold: 'never'
235 unstable-threshold: 'FAILURE'
237 # - project: 'yardstick-foreman-{stream}'
240 # build-step-failure-threshold: 'never'
241 # failure-threshold: 'never'
242 # unstable-threshold: 'FAILURE'
245 - trigger-parameterized-builds:
246 - project: 'genesis-fuel-daily-{stream}'
247 trigger-with-no-params: true
250 name: 'genesis-foreman-deploy-runner-{stream}'
252 project-type: freestyle
261 artifactDaysToKeep: -1
262 artifactNumToKeep: -1
268 installer: '{installer}'
269 gs-pathname: '{gs-pathname}'
272 default: ssh://gerrit.opnfv.org:29418/$PROJECT
273 description: "Used for overriding the GIT URL coming from parameters macro."
277 credentials-id: '{ssh-credentials}'
283 use-build-blocker: true
285 - "genesis-fuel-daily.*"
286 - "genesis-fuel-deploy-runner-{stream}"
287 - "genesis-foreman-daily.*"
290 - 'foreman-lab-reconfig'
292 - project: 'genesis-foreman-deploy-{stream}'
297 name: 'genesis-foreman-build-{stream}'
299 project-type: freestyle
306 artifactDaysToKeep: -1
307 artifactNumToKeep: -1
313 installer: '{installer}'
314 gs-pathname: '{gs-pathname}'
317 credentials-id: '{ssh-credentials}'
323 - 'foreman-upload-artifact'
324 - 'foreman-workspace-cleanup'
327 name: 'genesis-foreman-deploy-{stream}'
329 project-type: freestyle
338 artifactDaysToKeep: -1
339 artifactNumToKeep: -1
345 installer: '{installer}'
346 gs-pathname: '{gs-pathname}'
349 default: ssh://gerrit.opnfv.org:29418/$PROJECT
350 description: "Used for overriding the GIT URL coming from parameters macro."
354 credentials-id: '{ssh-credentials}'
362 name: 'genesis-foreman-lab-reconfig-{stream}'
364 project-type: freestyle
373 artifactDaysToKeep: -1
374 artifactNumToKeep: -1
380 installer: '{installer}'
381 gs-pathname: '{gs-pathname}'
384 default: ssh://gerrit.opnfv.org:29418/$PROJECT
385 description: "Used for overriding the GIT URL coming from parameters macro."
389 credentials-id: '{ssh-credentials}'
395 use-build-blocker: true
397 - "genesis-fuel-daily.*"
400 - 'foreman-lab-reconfig'
403 name: 'genesis-foreman-verify-deploy-virtual-{stream}'
405 project-type: freestyle
414 artifactDaysToKeep: -1
415 artifactNumToKeep: -1
423 installer: '{installer}'
424 gs-pathname: '{gs-pathname}'
427 default: ssh://gerrit.opnfv.org:29418/$PROJECT
428 description: "Used for overriding the GIT URL coming from parameters macro."
430 - gerrit-trigger-scm:
431 credentials-id: '{ssh-credentials}'
432 refspec: '$GERRIT_REFSPEC'
433 choosing-strategy: 'gerrit'
438 - patchset-created-event:
439 exclude-drafts: 'false'
440 exclude-trivial-rebase: 'false'
441 exclude-no-code-change: 'false'
442 - draft-published-event
443 - comment-added-contains-event:
444 comment-contains-value: 'recheck'
445 - comment-added-contains-event:
446 comment-contains-value: 'reverify'
448 - project-compare-type: 'ANT'
449 project-pattern: 'genesis'
451 - branch-compare-type: 'ANT'
452 branch-pattern: '**/{branch}'
455 pattern: 'common/ci/**'
457 pattern: 'common/manifests/**'
459 pattern: 'common/puppet-opnfv/**'
461 pattern: 'common/tools/**'
463 pattern: '{installer}/build/**'
465 pattern: '{installer}/ci/**'
467 pattern: '{installer}/include/**'
468 forbidden-file-paths:
470 pattern: 'common/docs/**'
472 pattern: '{installer}/docs/**'
473 dependency-jobs: 'genesis-foreman-verify-build-{stream}'
477 - 'foreman-deploy-virtual'
479 ########################
481 ########################
483 name: foreman-parameter
487 default: '{installer}'
488 description: "Installer to use."
490 name: BUILD_DIRECTORY
491 default: $WORKSPACE/build_output
492 description: "Directory where the build artifact will be located upon the completion of the build."
494 name: CACHE_DIRECTORY
495 default: $HOME/opnfv/cache/genesis-$INSTALLER{gs-pathname}
496 description: "Directory where the cache to be used during the build is located."
499 default: https://gerrit.opnfv.org/gerrit/$PROJECT
500 description: "Used for overriding the GIT URL coming from Global Jenkins configuration in case if the stuff is done on none-LF HW."
503 default: artifacts.opnfv.org/$PROJECT/$INSTALLER{gs-pathname}
504 description: "URL to Google Storage."
506 ########################
508 ########################
510 name: 'foreman-lab-reconfig'
518 # check to see if ucs login info file exists
519 if [ -e ~/.ssh/ucs_creds ];then
520 source ~/.ssh/ucs_creds
522 echo "Unable to find UCS credentials for LF lab reconfiguration...Exiting"
527 echo "Cloning releng repo..."
528 if ! GIT_SSL_NO_VERIFY=true git clone https://gerrit.opnfv.org/gerrit/releng; then
529 echo "Unable to clone releng repo...Exiting"
533 # log info to console
534 echo "Starting the lab reconfiguration for $INSTALLER..."
535 echo "--------------------------------------------------------"
539 $WORKSPACE/releng/utils/lab-reconfiguration/create_venv.sh
541 # disable nounset because 'activate' script contains unbound variable(s)
544 source $WORKSPACE/releng/utils/lab-reconfiguration/venv/bin/activate
545 # set nounset back again
548 # verify we are in venv
549 if [[ ! $(which python | grep venv) ]]; then
550 echo "Unable to activate venv...Exiting"
554 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
556 # while undergoing reboot
559 # check to see if slave is back up
562 while [ "$ping_counter" -lt 20 ]; do
563 if [[ $(ping -c 5 172.30.10.72) ]]; then
571 if [ "$ping_flag" -eq 1 ]; then
572 echo "Slave is pingable, now wait 180 seconds for services to start"
575 echo "Slave did not come back up after reboot: please check opnfv-jump-2"
583 echo "--------------------------------------------------------"
587 name: 'foreman-build'
595 # log info to console
596 echo "Starting the build of $INSTALLER. This could take some time..."
597 echo "--------------------------------------------------------"
600 # create the cache directory if it doesn't exist
601 [[ -d $CACHE_DIRECTORY ]] || mkdir -p $CACHE_DIRECTORY
603 # set OPNFV_ARTIFACT_VERSION
604 export OPNFV_ARTIFACT_VERSION=$(date -u +"%Y-%m-%d_%H-%M-%S")
607 cd $WORKSPACE/$INSTALLER/ci
608 ./build.sh -v $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY $BUILD_DIRECTORY
610 # list the contents of BUILD_OUTPUT directory
611 ls -al $BUILD_DIRECTORY
613 # save information regarding artifact into file
615 echo "OPNFV_ARTIFACT_VERSION=$OPNFV_ARTIFACT_VERSION"
616 echo "OPNFV_GIT_URL=$(git config --get remote.origin.url)"
617 echo "OPNFV_GIT_SHA1=$(git rev-parse HEAD)"
618 echo "OPNFV_ARTIFACT_URL=$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
619 echo "OPNFV_ARTIFACT_MD5SUM=$(md5sum $BUILD_DIRECTORY/OPNFV-CentOS-7-x86_64-$OPNFV_ARTIFACT_VERSION.iso | cut -d' ' -f1)"
620 echo "OPNFV_BUILD_URL=$BUILD_URL"
621 ) > $WORKSPACE/opnfv.properties
624 echo "--------------------------------------------------------"
628 name: 'foreman-deploy'
636 # log info to console
637 echo "Starting the deployment using $INSTALLER. This could take some time..."
638 echo "--------------------------------------------------------"
642 sudo $WORKSPACE/common/ci/clean.sh -base_config $WORKSPACE/$INSTALLER/ci/inventory/lf_pod2_ksgen_settings.yml
644 echo "Sleeping for 60 seconds between clean and deploy to allow nodes to power off"
647 # and then initiate deployment
648 sudo $WORKSPACE/$INSTALLER/ci/deploy.sh -base_config $WORKSPACE/$INSTALLER/ci/inventory/lf_pod2_ksgen_settings.yml
651 echo "--------------------------------------------------------"
655 name: 'foreman-deploy-virtual'
663 # log info to console
664 echo "Starting the virtual deployment using $INSTALLER. This could take some time..."
665 echo "--------------------------------------------------------"
668 # cleanup baremetal first (in case baremetal was being used on pod2, remove when moved to isolated Virtual pod)
669 sudo $WORKSPACE/common/ci/clean.sh
671 # initiate virtual deployment
672 sudo $WORKSPACE/$INSTALLER/ci/deploy.sh -virtual
675 echo "--------------------------------------------------------"
679 name: 'foreman-upload-artifact'
687 # log info to console
688 echo "Uploading the $INSTALLER artifact. This could take some time..."
689 echo "--------------------------------------------------------"
692 # source the opnfv.properties to get ARTIFACT_VERSION
693 source $WORKSPACE/opnfv.properties
695 # upload artifact and additional files to google storage
696 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
697 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.properties > gsutil.properties.log 2>&1
698 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/latest.properties > gsutil.latest.log 2>&1
701 echo "--------------------------------------------------------"
703 echo "Artifact is available as http://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
706 name: 'foreman-workspace-cleanup'
714 # delete everything that is in $WORKSPACE
715 /bin/rm -rf $WORKSPACE
717 ########################
719 ########################
721 name: 'foreman-master'
723 - timed: '0 11 * * *'
726 name: 'foreman-stable-arno'
728 - timed: '0 12 * * *'