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
375 artifactDaysToKeep: -1
376 artifactNumToKeep: -1
384 installer: '{installer}'
385 gs-pathname: '{gs-pathname}'
387 - gerrit-trigger-scm:
388 credentials-id: '{ssh-credentials}'
389 refspec: '$GERRIT_REFSPEC'
390 choosing-strategy: 'gerrit'
393 - ssh-agent-credentials:
394 user: '{ssh-credentials}'
399 - patchset-created-event:
400 exclude-drafts: 'false'
401 exclude-trivial-rebase: 'false'
402 exclude-no-code-change: 'false'
403 - draft-published-event
404 - comment-added-contains-event:
405 comment-contains-value: 'recheck'
406 - comment-added-contains-event:
407 comment-contains-value: 'reverify'
409 - project-compare-type: 'ANT'
410 project-pattern: 'genesis'
412 - branch-compare-type: 'ANT'
413 branch-pattern: '**/{branch}'
418 pattern: '{installer}/**'
419 dependency-jobs: 'genesis-foreman-verify-{stream}'
423 - 'foreman-deploy-virtual'
425 ########################
427 ########################
429 name: foreman-parameter
433 default: '{installer}'
434 description: "Installer to use."
436 name: BUILD_DIRECTORY
437 default: $WORKSPACE/build_output
438 description: "Directory where the build artifact will be located upon the completion of the build."
440 name: CACHE_DIRECTORY
441 default: $HOME/opnfv/cache/genesis-$INSTALLER{gs-pathname}
442 description: "Directory where the cache to be used during the build is located."
445 default: https://gerrit.opnfv.org/gerrit/$PROJECT
446 description: "Used for overriding the GIT URL coming from Global Jenkins configuration in case if the stuff is done on none-LF HW."
449 default: artifacts.opnfv.org/$PROJECT/$INSTALLER{gs-pathname}
450 description: "URL to Google Storage."
452 ########################
454 ########################
456 name: 'foreman-lab-reconfig'
464 # check to see if ucs login info file exists
465 if [ -e ~/.ssh/ucs_creds ];then
466 source ~/.ssh/ucs_creds
468 echo "Unable to find UCS credentials for LF lab reconfiguration...Exiting"
473 echo "Cloning releng repo..."
474 if ! GIT_SSL_NO_VERIFY=true git clone https://gerrit.opnfv.org/gerrit/releng; then
475 echo "Unable to clone releng repo...Exiting"
479 # log info to console
480 echo "Starting the lab reconfiguration for $INSTALLER..."
481 echo "--------------------------------------------------------"
485 $WORKSPACE/releng/utils/lab-reconfiguration/create_venv.sh
487 # disable nounset because 'activate' script contains unbound variable(s)
490 source $WORKSPACE/releng/utils/lab-reconfiguration/venv/bin/activate
491 # set nounset back again
494 # verify we are in venv
495 if [[ ! $(which python | grep venv) ]]; then
496 echo "Unable to activate venv...Exiting"
500 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
502 # while undergoing reboot
505 # check to see if slave is back up
508 while [ "$ping_counter" -lt 20 ]; do
509 if [[ $(ping -c 5 172.30.10.72) ]]; then
517 if [ "$ping_flag" -eq 1 ]; then
518 echo "Slave is pingable, now wait 90 seconds for services to start"
521 echo "Slave did not come back up after reboot: please check opnfv-jump-2"
529 echo "--------------------------------------------------------"
533 name: 'foreman-build'
541 # log info to console
542 echo "Starting the build of $INSTALLER. This could take some time..."
543 echo "--------------------------------------------------------"
546 # create the cache directory if it doesn't exist
547 [[ -d $CACHE_DIRECTORY ]] || mkdir -p $CACHE_DIRECTORY
549 # set OPNFV_ARTIFACT_VERSION
550 export OPNFV_ARTIFACT_VERSION=$(date -u +"%Y-%m-%d_%H-%M-%S")
553 cd $WORKSPACE/$INSTALLER/ci
554 ./build.sh -v $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY $BUILD_DIRECTORY
556 # list the contents of BUILD_OUTPUT directory
557 ls -al $BUILD_DIRECTORY
559 # save information regarding artifact into file
561 echo "OPNFV_ARTIFACT_VERSION=$OPNFV_ARTIFACT_VERSION"
562 echo "OPNFV_GIT_URL=$(git config --get remote.origin.url)"
563 echo "OPNFV_GIT_SHA1=$(git rev-parse HEAD)"
564 echo "OPNFV_ARTIFACT_URL=$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
565 echo "OPNFV_ARTIFACT_MD5SUM=$(md5sum $BUILD_DIRECTORY/OPNFV-CentOS-7-x86_64-$OPNFV_ARTIFACT_VERSION.iso | cut -d' ' -f1)"
566 echo "OPNFV_BUILD_URL=$BUILD_URL"
567 ) > $WORKSPACE/opnfv.properties
570 echo "--------------------------------------------------------"
574 name: 'foreman-deploy'
582 # log info to console
583 echo "Starting the deployment using $INSTALLER. This could take some time..."
584 echo "--------------------------------------------------------"
588 sudo $WORKSPACE/common/ci/clean.sh -base_config $WORKSPACE/$INSTALLER/ci/inventory/lf_pod2_ksgen_settings.yml
590 # and then initiate deployment
591 sudo $WORKSPACE/$INSTALLER/ci/deploy.sh -base_config $WORKSPACE/$INSTALLER/ci/inventory/lf_pod2_ksgen_settings.yml
594 echo "--------------------------------------------------------"
598 name: 'foreman-deploy-virtual'
606 # log info to console
607 echo "Starting the virtual deployment using $INSTALLER. This could take some time..."
608 echo "--------------------------------------------------------"
611 # cleanup baremetal first (in case baremetal was being used on pod2, remove when moved to isolated Virtual pod)
612 sudo $WORKSPACE/common/ci/clean.sh
614 # initiate virtual deployment
615 sudo $WORKSPACE/$INSTALLER/ci/deploy.sh -virtual
618 echo "--------------------------------------------------------"
622 name: 'foreman-upload-artifact'
630 # log info to console
631 echo "Uploading the $INSTALLER artifact. This could take some time..."
632 echo "--------------------------------------------------------"
635 # source the opnfv.properties to get ARTIFACT_VERSION
636 source $WORKSPACE/opnfv.properties
638 # upload artifact and additional files to google storage
639 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
640 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.properties > gsutil.properties.log 2>&1
641 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/latest.properties > gsutil.latest.log 2>&1
644 echo "--------------------------------------------------------"
646 echo "Artifact is available as http://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
649 name: 'foreman-workspace-cleanup'
657 # delete everything that is in $WORKSPACE
658 /bin/rm -rf $WORKSPACE
660 ########################
662 ########################
664 name: 'foreman-master'
666 - pollscm: '0 21 * * *'
669 name: 'foreman-stable-arno'
671 - pollscm: '0 1 * * *'