1 ########################
2 # Job configuration for genesis/foreman
3 ########################
13 - 'genesis-foreman-verify-{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-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-{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}'
95 pattern: '{installer}/**'
99 - 'foreman-workspace-cleanup'
102 name: 'genesis-foreman-merge-{stream}'
104 project-type: freestyle
118 artifactDaysToKeep: -1
127 installer: '{installer}'
130 - gerrit-trigger-scm:
131 credentials-id: '{ssh-credentials}'
133 choosing-strategy: 'default'
136 - ssh-agent-credentials:
137 user: '{ssh-credentials}'
142 - change-merged-event
143 - comment-added-contains-event:
144 comment-contains-value: 'remerge'
146 - project-compare-type: 'ANT'
147 project-pattern: 'genesis'
149 - branch-compare-type: 'ANT'
150 branch-pattern: '**/{branch}'
155 pattern: '{installer}/**'
159 - 'fuel-workspace-cleanup'
162 name: 'genesis-foreman-daily-{stream}'
164 project-type: freestyle
177 installer: '{installer}'
178 gs-pathname: '{gs-pathname}'
182 credentials-id: '{ssh-credentials}'
189 artifactDaysToKeep: -1
190 artifactNumToKeep: -1
194 - project: 'genesis-foreman-build-{stream}'
198 - project: 'genesis-foreman-lab-reconfig-{stream}'
202 - project: 'genesis-foreman-deploy-{stream}'
206 - project: 'functest-opnfv-jump-2'
209 - project: 'yardstick-opnfv-jump-2'
213 name: 'genesis-foreman-deploy-runner-{stream}'
215 project-type: freestyle
224 artifactDaysToKeep: -1
225 artifactNumToKeep: -1
231 installer: '{installer}'
232 gs-pathname: '{gs-pathname}'
235 default: ssh://gerrit.opnfv.org:29418/$PROJECT
236 description: "Used for overriding the GIT URL coming from parameters macro."
240 credentials-id: '{ssh-credentials}'
246 use-build-blocker: true
248 - "genesis-fuel-daily.*"
249 - "genesis-fuel-deploy-runner-{stream}"
250 - "genesis-foreman-daily.*"
253 - 'foreman-lab-reconfig'
255 - project: 'genesis-foreman-deploy-{stream}'
260 name: 'genesis-foreman-build-{stream}'
262 project-type: freestyle
269 artifactDaysToKeep: -1
270 artifactNumToKeep: -1
276 installer: '{installer}'
277 gs-pathname: '{gs-pathname}'
280 credentials-id: '{ssh-credentials}'
286 - 'foreman-upload-artifact'
287 - 'fuel-workspace-cleanup'
290 name: 'genesis-foreman-deploy-{stream}'
292 project-type: freestyle
301 artifactDaysToKeep: -1
302 artifactNumToKeep: -1
308 installer: '{installer}'
309 gs-pathname: '{gs-pathname}'
312 default: ssh://gerrit.opnfv.org:29418/$PROJECT
313 description: "Used for overriding the GIT URL coming from parameters macro."
317 credentials-id: '{ssh-credentials}'
325 name: 'genesis-foreman-lab-reconfig-{stream}'
327 project-type: freestyle
336 artifactDaysToKeep: -1
337 artifactNumToKeep: -1
343 installer: '{installer}'
344 gs-pathname: '{gs-pathname}'
347 default: ssh://gerrit.opnfv.org:29418/$PROJECT
348 description: "Used for overriding the GIT URL coming from parameters macro."
352 credentials-id: '{ssh-credentials}'
358 use-build-blocker: true
360 - "genesis-fuel-daily.*"
363 - 'foreman-lab-reconfig'
366 name: 'genesis-foreman-deploy-virtual-{stream}'
368 project-type: freestyle
377 artifactDaysToKeep: -1
378 artifactNumToKeep: -1
384 installer: '{installer}'
385 gs-pathname: '{gs-pathname}'
388 default: ssh://gerrit.opnfv.org:29418/$PROJECT
389 description: "Used for overriding the GIT URL coming from parameters macro."
393 credentials-id: '{ssh-credentials}'
398 - 'foreman-deploy-virtual'
400 ########################
402 ########################
404 name: foreman-parameter
408 default: '{installer}'
409 description: "Installer to use."
411 name: BUILD_DIRECTORY
412 default: $WORKSPACE/build_output
413 description: "Directory where the build artifact will be located upon the completion of the build."
415 name: CACHE_DIRECTORY
416 default: $HOME/opnfv/cache/genesis-$INSTALLER{gs-pathname}
417 description: "Directory where the cache to be used during the build is located."
420 default: https://gerrit.opnfv.org/gerrit/$PROJECT
421 description: "Used for overriding the GIT URL coming from Global Jenkins configuration in case if the stuff is done on none-LF HW."
424 default: artifacts.opnfv.org/$PROJECT/$INSTALLER{gs-pathname}
425 description: "URL to Google Storage."
427 ########################
429 ########################
431 name: 'foreman-lab-reconfig'
439 # check to see if ucs login info file exists
440 if [ -e ~/.ssh/ucs_creds ];then
441 source ~/.ssh/ucs_creds
443 echo "Unable to find UCS credentials for LF lab reconfiguration...Exiting"
448 echo "Cloning releng repo..."
449 if ! GIT_SSL_NO_VERIFY=true git clone https://gerrit.opnfv.org/gerrit/releng; then
450 echo "Unable to clone releng repo...Exiting"
454 # log info to console
455 echo "Starting the lab reconfiguration for $INSTALLER..."
456 echo "--------------------------------------------------------"
460 $WORKSPACE/releng/utils/lab-reconfiguration/create_venv.sh
462 # disable nounset because 'activate' script contains unbound variable(s)
465 source $WORKSPACE/releng/utils/lab-reconfiguration/venv/bin/activate
466 # set nounset back again
469 # verify we are in venv
470 if [[ ! $(which python | grep venv) ]]; then
471 echo "Unable to activate venv...Exiting"
475 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
477 # while undergoing reboot
480 # check to see if slave is back up
483 while [ "$ping_counter" -lt 20 ]; do
484 if [[ $(ping -c 5 172.30.10.72) ]]; then
492 if [ "$ping_flag" -eq 1 ]; then
493 echo "Slave is pingable, now wait 90 seconds for services to start"
496 echo "Slave did not come back up after reboot: please check opnfv-jump-2"
504 echo "--------------------------------------------------------"
508 name: 'foreman-build'
516 # log info to console
517 echo "Starting the build of $INSTALLER. This could take some time..."
518 echo "--------------------------------------------------------"
521 # create the cache directory if it doesn't exist
522 [[ -d $CACHE_DIRECTORY ]] || mkdir -p $CACHE_DIRECTORY
524 # set OPNFV_ARTIFACT_VERSION
525 export OPNFV_ARTIFACT_VERSION=$(date -u +"%Y-%m-%d_%H-%M-%S")
528 cd $WORKSPACE/$INSTALLER/ci
529 ./build.sh -v $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY $BUILD_DIRECTORY
531 # list the contents of BUILD_OUTPUT directory
532 ls -al $BUILD_DIRECTORY
534 # save information regarding artifact into file
536 echo "OPNFV_ARTIFACT_VERSION=$OPNFV_ARTIFACT_VERSION"
537 echo "OPNFV_GIT_URL=$(git config --get remote.origin.url)"
538 echo "OPNFV_GIT_SHA1=$(git rev-parse HEAD)"
539 echo "OPNFV_ARTIFACT_URL=$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
540 echo "OPNFV_ARTIFACT_MD5SUM=$(md5sum $BUILD_DIRECTORY/OPNFV-CentOS-7-x86_64-$OPNFV_ARTIFACT_VERSION.iso | cut -d' ' -f1)"
541 echo "OPNFV_BUILD_URL=$BUILD_URL"
542 ) > $WORKSPACE/opnfv.properties
545 echo "--------------------------------------------------------"
549 name: 'foreman-deploy'
557 # log info to console
558 echo "Starting the deployment using $INSTALLER. This could take some time..."
559 echo "--------------------------------------------------------"
563 sudo $WORKSPACE/common/ci/clean.sh -base_config $WORKSPACE/$INSTALLER/ci/inventory/lf_pod2_ksgen_settings.yml
565 # and then initiate deployment
566 sudo $WORKSPACE/$INSTALLER/ci/deploy.sh -base_config $WORKSPACE/$INSTALLER/ci/inventory/lf_pod2_ksgen_settings.yml
569 echo "--------------------------------------------------------"
573 name: 'foreman-deploy-virtual'
581 # log info to console
582 echo "Starting the virtual deployment using $INSTALLER. This could take some time..."
583 echo "--------------------------------------------------------"
586 # cleanup baremetal first (in case baremetal was being used on pod2, remove when moved to isolated Virtual pod)
587 sudo $WORKSPACE/common/ci/clean.sh
589 # initiate virtual deployment
590 sudo $WORKSPACE/$INSTALLER/ci/deploy.sh -virtual
593 echo "--------------------------------------------------------"
597 name: 'foreman-upload-artifact'
605 # log info to console
606 echo "Uploading the $INSTALLER artifact. This could take some time..."
607 echo "--------------------------------------------------------"
610 # source the opnfv.properties to get ARTIFACT_VERSION
611 source $WORKSPACE/opnfv.properties
613 # upload artifact and additional files to google storage
614 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
615 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.properties > gsutil.properties.log 2>&1
616 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/latest.properties > gsutil.latest.log 2>&1
619 echo "--------------------------------------------------------"
621 echo "Artifact is available as http://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
624 name: 'foreman-workspace-cleanup'
632 # delete everything that is in $WORKSPACE
633 /bin/rm -rf $WORKSPACE
635 ########################
637 ########################
639 name: 'foreman-master'
641 - pollscm: '0 21 * * *'
644 name: 'foreman-stable-arno'
646 - pollscm: '0 1 * * *'