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'
72 - ssh-agent-credentials:
73 user: '{ssh-credentials}'
78 - patchset-created-event:
79 exclude-drafts: 'false'
80 exclude-trivial-rebase: 'false'
81 exclude-no-code-change: 'false'
82 - draft-published-event
83 - comment-added-contains-event:
84 comment-contains-value: 'recheck'
85 - comment-added-contains-event:
86 comment-contains-value: 'reverify'
88 - project-compare-type: 'ANT'
89 project-pattern: 'genesis'
91 - branch-compare-type: 'ANT'
92 branch-pattern: '**/{branch}'
95 pattern: 'common/ci/**'
97 pattern: 'common/manifests/**'
99 pattern: 'common/puppet-opnfv/**'
101 pattern: 'common/tools/**'
103 pattern: '{installer}/build/**'
105 pattern: '{installer}/ci/**'
107 pattern: '{installer}/include/**'
108 forbidden-file-paths:
110 pattern: 'common/docs/**'
112 pattern: '{installer}/docs/**'
116 - 'foreman-workspace-cleanup'
119 name: 'genesis-foreman-merge-{stream}'
121 project-type: freestyle
135 artifactDaysToKeep: -1
144 installer: '{installer}'
147 - gerrit-trigger-scm:
148 credentials-id: '{ssh-credentials}'
150 choosing-strategy: 'default'
153 - ssh-agent-credentials:
154 user: '{ssh-credentials}'
159 - change-merged-event
160 - comment-added-contains-event:
161 comment-contains-value: 'remerge'
163 - project-compare-type: 'ANT'
164 project-pattern: 'genesis'
166 - branch-compare-type: 'ANT'
167 branch-pattern: '**/{branch}'
170 pattern: 'common/ci/**'
172 pattern: 'common/manifests/**'
174 pattern: 'common/puppet-opnfv/**'
176 pattern: 'common/tools/**'
178 pattern: '{installer}/build/**'
180 pattern: '{installer}/ci/**'
182 pattern: '{installer}/include/**'
183 forbidden-file-paths:
185 pattern: 'common/docs/**'
187 pattern: '{installer}/docs/**'
191 - 'foreman-workspace-cleanup'
194 name: 'genesis-foreman-daily-{stream}'
196 project-type: freestyle
200 disabled: '{obj:disabled}'
209 installer: '{installer}'
210 gs-pathname: '{gs-pathname}'
214 credentials-id: '{ssh-credentials}'
221 artifactDaysToKeep: -1
222 artifactNumToKeep: -1
226 - project: 'genesis-foreman-build-{stream}'
230 - project: 'genesis-foreman-lab-reconfig-{stream}'
234 - project: 'genesis-foreman-deploy-{stream}'
238 - project: 'functest-foreman-{stream}'
241 build-step-failure-threshold: 'never'
242 failure-threshold: 'never'
243 unstable-threshold: 'FAILURE'
245 # - project: 'yardstick-foreman-{stream}'
248 # build-step-failure-threshold: 'never'
249 # failure-threshold: 'never'
250 # unstable-threshold: 'FAILURE'
253 - trigger-parameterized-builds:
254 - project: 'genesis-fuel-daily-{stream}'
255 trigger-with-no-params: true
258 name: 'genesis-foreman-deploy-runner-{stream}'
260 project-type: freestyle
269 artifactDaysToKeep: -1
270 artifactNumToKeep: -1
276 installer: '{installer}'
277 gs-pathname: '{gs-pathname}'
280 default: ssh://gerrit.opnfv.org:29418/$PROJECT
281 description: "Used for overriding the GIT URL coming from parameters macro."
285 credentials-id: '{ssh-credentials}'
291 use-build-blocker: true
293 - "genesis-fuel-daily.*"
294 - "genesis-fuel-deploy-runner-{stream}"
295 - "genesis-foreman-daily.*"
298 - 'foreman-lab-reconfig'
300 - project: 'genesis-foreman-deploy-{stream}'
305 name: 'genesis-foreman-build-{stream}'
307 project-type: freestyle
314 artifactDaysToKeep: -1
315 artifactNumToKeep: -1
321 installer: '{installer}'
322 gs-pathname: '{gs-pathname}'
325 credentials-id: '{ssh-credentials}'
331 - 'foreman-upload-artifact'
332 - 'foreman-workspace-cleanup'
335 name: 'genesis-foreman-deploy-{stream}'
337 project-type: freestyle
346 artifactDaysToKeep: -1
347 artifactNumToKeep: -1
353 installer: '{installer}'
354 gs-pathname: '{gs-pathname}'
357 default: ssh://gerrit.opnfv.org:29418/$PROJECT
358 description: "Used for overriding the GIT URL coming from parameters macro."
362 credentials-id: '{ssh-credentials}'
370 name: 'genesis-foreman-lab-reconfig-{stream}'
372 project-type: freestyle
381 artifactDaysToKeep: -1
382 artifactNumToKeep: -1
388 installer: '{installer}'
389 gs-pathname: '{gs-pathname}'
392 default: ssh://gerrit.opnfv.org:29418/$PROJECT
393 description: "Used for overriding the GIT URL coming from parameters macro."
397 credentials-id: '{ssh-credentials}'
403 use-build-blocker: true
405 - "genesis-fuel-daily.*"
408 - 'foreman-lab-reconfig'
411 name: 'genesis-foreman-verify-deploy-virtual-{stream}'
413 project-type: freestyle
422 artifactDaysToKeep: -1
423 artifactNumToKeep: -1
431 installer: '{installer}'
432 gs-pathname: '{gs-pathname}'
435 default: ssh://gerrit.opnfv.org:29418/$PROJECT
436 description: "Used for overriding the GIT URL coming from parameters macro."
438 - gerrit-trigger-scm:
439 credentials-id: '{ssh-credentials}'
440 refspec: '$GERRIT_REFSPEC'
441 choosing-strategy: 'gerrit'
444 - ssh-agent-credentials:
445 user: '{ssh-credentials}'
450 - patchset-created-event:
451 exclude-drafts: 'false'
452 exclude-trivial-rebase: 'false'
453 exclude-no-code-change: 'false'
454 - draft-published-event
455 - comment-added-contains-event:
456 comment-contains-value: 'recheck'
457 - comment-added-contains-event:
458 comment-contains-value: 'reverify'
460 - project-compare-type: 'ANT'
461 project-pattern: 'genesis'
463 - branch-compare-type: 'ANT'
464 branch-pattern: '**/{branch}'
467 pattern: 'common/ci/**'
469 pattern: 'common/manifests/**'
471 pattern: 'common/puppet-opnfv/**'
473 pattern: 'common/tools/**'
475 pattern: '{installer}/build/**'
477 pattern: '{installer}/ci/**'
479 pattern: '{installer}/include/**'
480 forbidden-file-paths:
482 pattern: 'common/docs/**'
484 pattern: '{installer}/docs/**'
485 dependency-jobs: 'genesis-foreman-verify-build-{stream}'
489 - 'foreman-deploy-virtual'
491 ########################
493 ########################
495 name: foreman-parameter
499 default: '{installer}'
500 description: "Installer to use."
502 name: BUILD_DIRECTORY
503 default: $WORKSPACE/build_output
504 description: "Directory where the build artifact will be located upon the completion of the build."
506 name: CACHE_DIRECTORY
507 default: $HOME/opnfv/cache/genesis-$INSTALLER{gs-pathname}
508 description: "Directory where the cache to be used during the build is located."
511 default: https://gerrit.opnfv.org/gerrit/$PROJECT
512 description: "Used for overriding the GIT URL coming from Global Jenkins configuration in case if the stuff is done on none-LF HW."
515 default: artifacts.opnfv.org/$PROJECT/$INSTALLER{gs-pathname}
516 description: "URL to Google Storage."
518 ########################
520 ########################
522 name: 'foreman-lab-reconfig'
530 # check to see if ucs login info file exists
531 if [ -e ~/.ssh/ucs_creds ];then
532 source ~/.ssh/ucs_creds
534 echo "Unable to find UCS credentials for LF lab reconfiguration...Exiting"
539 echo "Cloning releng repo..."
540 if ! GIT_SSL_NO_VERIFY=true git clone https://gerrit.opnfv.org/gerrit/releng; then
541 echo "Unable to clone releng repo...Exiting"
545 # log info to console
546 echo "Starting the lab reconfiguration for $INSTALLER..."
547 echo "--------------------------------------------------------"
551 $WORKSPACE/releng/utils/lab-reconfiguration/create_venv.sh
553 # disable nounset because 'activate' script contains unbound variable(s)
556 source $WORKSPACE/releng/utils/lab-reconfiguration/venv/bin/activate
557 # set nounset back again
560 # verify we are in venv
561 if [[ ! $(which python | grep venv) ]]; then
562 echo "Unable to activate venv...Exiting"
566 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
568 # while undergoing reboot
571 # check to see if slave is back up
574 while [ "$ping_counter" -lt 20 ]; do
575 if [[ $(ping -c 5 172.30.10.72) ]]; then
583 if [ "$ping_flag" -eq 1 ]; then
584 echo "Slave is pingable, now wait 180 seconds for services to start"
587 echo "Slave did not come back up after reboot: please check opnfv-jump-2"
595 echo "--------------------------------------------------------"
599 name: 'foreman-build'
607 # log info to console
608 echo "Starting the build of $INSTALLER. This could take some time..."
609 echo "--------------------------------------------------------"
612 # create the cache directory if it doesn't exist
613 [[ -d $CACHE_DIRECTORY ]] || mkdir -p $CACHE_DIRECTORY
615 # set OPNFV_ARTIFACT_VERSION
616 export OPNFV_ARTIFACT_VERSION=$(date -u +"%Y-%m-%d_%H-%M-%S")
619 cd $WORKSPACE/$INSTALLER/ci
620 ./build.sh -v $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY $BUILD_DIRECTORY
622 # list the contents of BUILD_OUTPUT directory
623 ls -al $BUILD_DIRECTORY
625 # save information regarding artifact into file
627 echo "OPNFV_ARTIFACT_VERSION=$OPNFV_ARTIFACT_VERSION"
628 echo "OPNFV_GIT_URL=$(git config --get remote.origin.url)"
629 echo "OPNFV_GIT_SHA1=$(git rev-parse HEAD)"
630 echo "OPNFV_ARTIFACT_URL=$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
631 echo "OPNFV_ARTIFACT_MD5SUM=$(md5sum $BUILD_DIRECTORY/OPNFV-CentOS-7-x86_64-$OPNFV_ARTIFACT_VERSION.iso | cut -d' ' -f1)"
632 echo "OPNFV_BUILD_URL=$BUILD_URL"
633 ) > $WORKSPACE/opnfv.properties
636 echo "--------------------------------------------------------"
640 name: 'foreman-deploy'
648 # log info to console
649 echo "Starting the deployment using $INSTALLER. This could take some time..."
650 echo "--------------------------------------------------------"
654 sudo $WORKSPACE/common/ci/clean.sh -base_config $WORKSPACE/$INSTALLER/ci/inventory/lf_pod2_ksgen_settings.yml
656 echo "Sleeping for 60 seconds between clean and deploy to allow nodes to power off"
659 # and then initiate deployment
660 sudo $WORKSPACE/$INSTALLER/ci/deploy.sh -base_config $WORKSPACE/$INSTALLER/ci/inventory/lf_pod2_ksgen_settings.yml
663 echo "--------------------------------------------------------"
667 name: 'foreman-deploy-virtual'
675 # log info to console
676 echo "Starting the virtual deployment using $INSTALLER. This could take some time..."
677 echo "--------------------------------------------------------"
680 # cleanup baremetal first (in case baremetal was being used on pod2, remove when moved to isolated Virtual pod)
681 sudo $WORKSPACE/common/ci/clean.sh
683 # initiate virtual deployment
684 sudo $WORKSPACE/$INSTALLER/ci/deploy.sh -virtual
687 echo "--------------------------------------------------------"
691 name: 'foreman-upload-artifact'
699 # log info to console
700 echo "Uploading the $INSTALLER artifact. This could take some time..."
701 echo "--------------------------------------------------------"
704 # source the opnfv.properties to get ARTIFACT_VERSION
705 source $WORKSPACE/opnfv.properties
707 # upload artifact and additional files to google storage
708 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
709 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.properties > gsutil.properties.log 2>&1
710 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/latest.properties > gsutil.latest.log 2>&1
713 echo "--------------------------------------------------------"
715 echo "Artifact is available as http://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
718 name: 'foreman-workspace-cleanup'
726 # delete everything that is in $WORKSPACE
727 /bin/rm -rf $WORKSPACE
729 ########################
731 ########################
733 name: 'foreman-master'
735 - timed: '0 11 * * *'
738 name: 'foreman-stable-arno'
740 - timed: '0 12 * * *'