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'
101 - project: 'genesis-foreman-deploy-virtual-{stream}'
105 name: 'genesis-foreman-merge-{stream}'
107 project-type: freestyle
121 artifactDaysToKeep: -1
130 installer: '{installer}'
133 - gerrit-trigger-scm:
134 credentials-id: '{ssh-credentials}'
136 choosing-strategy: 'default'
139 - ssh-agent-credentials:
140 user: '{ssh-credentials}'
145 - change-merged-event
146 - comment-added-contains-event:
147 comment-contains-value: 'remerge'
149 - project-compare-type: 'ANT'
150 project-pattern: 'genesis'
152 - branch-compare-type: 'ANT'
153 branch-pattern: '**/{branch}'
158 pattern: '{installer}/**'
162 - 'fuel-workspace-cleanup'
165 name: 'genesis-foreman-daily-{stream}'
167 project-type: freestyle
180 installer: '{installer}'
181 gs-pathname: '{gs-pathname}'
185 credentials-id: '{ssh-credentials}'
192 artifactDaysToKeep: -1
193 artifactNumToKeep: -1
197 - project: 'genesis-foreman-build-{stream}'
201 - project: 'genesis-foreman-lab-reconfig-{stream}'
205 - project: 'genesis-foreman-deploy-{stream}'
209 - project: 'functest-opnfv-jump-2'
212 - project: 'yardstick-opnfv-jump-2'
216 name: 'genesis-foreman-deploy-runner-{stream}'
218 project-type: freestyle
227 artifactDaysToKeep: -1
228 artifactNumToKeep: -1
234 installer: '{installer}'
235 gs-pathname: '{gs-pathname}'
238 default: ssh://gerrit.opnfv.org:29418/$PROJECT
239 description: "Used for overriding the GIT URL coming from parameters macro."
243 credentials-id: '{ssh-credentials}'
249 use-build-blocker: true
251 - "genesis-fuel-daily.*"
252 - "genesis-fuel-deploy-runner-{stream}"
253 - "genesis-foreman-daily.*"
256 - 'foreman-lab-reconfig'
258 - project: 'genesis-foreman-deploy-{stream}'
263 name: 'genesis-foreman-build-{stream}'
265 project-type: freestyle
272 artifactDaysToKeep: -1
273 artifactNumToKeep: -1
279 installer: '{installer}'
280 gs-pathname: '{gs-pathname}'
283 credentials-id: '{ssh-credentials}'
289 - 'foreman-upload-artifact'
290 - 'fuel-workspace-cleanup'
293 name: 'genesis-foreman-deploy-{stream}'
295 project-type: freestyle
304 artifactDaysToKeep: -1
305 artifactNumToKeep: -1
311 installer: '{installer}'
312 gs-pathname: '{gs-pathname}'
315 default: ssh://gerrit.opnfv.org:29418/$PROJECT
316 description: "Used for overriding the GIT URL coming from parameters macro."
320 credentials-id: '{ssh-credentials}'
328 name: 'genesis-foreman-lab-reconfig-{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}'
361 use-build-blocker: true
363 - "genesis-fuel-daily.*"
366 - 'foreman-lab-reconfig'
369 name: 'genesis-foreman-deploy-virtual-{stream}'
371 project-type: freestyle
380 artifactDaysToKeep: -1
381 artifactNumToKeep: -1
387 installer: '{installer}'
388 gs-pathname: '{gs-pathname}'
391 default: ssh://gerrit.opnfv.org:29418/$PROJECT
392 description: "Used for overriding the GIT URL coming from parameters macro."
396 credentials-id: '{ssh-credentials}'
401 - 'foreman-deploy-virtual'
403 ########################
405 ########################
407 name: foreman-parameter
411 default: '{installer}'
412 description: "Installer to use."
414 name: BUILD_DIRECTORY
415 default: $WORKSPACE/build_output
416 description: "Directory where the build artifact will be located upon the completion of the build."
418 name: CACHE_DIRECTORY
419 default: $HOME/opnfv/cache/genesis-$INSTALLER{gs-pathname}
420 description: "Directory where the cache to be used during the build is located."
423 default: https://gerrit.opnfv.org/gerrit/$PROJECT
424 description: "Used for overriding the GIT URL coming from Global Jenkins configuration in case if the stuff is done on none-LF HW."
427 default: artifacts.opnfv.org/$PROJECT/$INSTALLER{gs-pathname}
428 description: "URL to Google Storage."
430 ########################
432 ########################
434 name: 'foreman-lab-reconfig'
442 # check to see if ucs login info file exists
443 if [ -e ~/.ssh/ucs_creds ];then
444 source ~/.ssh/ucs_creds
446 echo "Unable to find UCS credentials for LF lab reconfiguration...Exiting"
451 echo "Cloning releng repo..."
452 if ! GIT_SSL_NO_VERIFY=true git clone https://gerrit.opnfv.org/gerrit/releng; then
453 echo "Unable to clone releng repo...Exiting"
457 # log info to console
458 echo "Starting the lab reconfiguration for $INSTALLER..."
459 echo "--------------------------------------------------------"
463 $WORKSPACE/releng/utils/lab-reconfiguration/create_venv.sh
465 # disable nounset because 'activate' script contains unbound variable(s)
468 source $WORKSPACE/releng/utils/lab-reconfiguration/venv/bin/activate
469 # set nounset back again
472 # verify we are in venv
473 if [[ ! $(which python | grep venv) ]]; then
474 echo "Unable to activate venv...Exiting"
478 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
480 # while undergoing reboot
483 # check to see if slave is back up
486 while [ "$ping_counter" -lt 20 ]; do
487 if [[ $(ping -c 5 172.30.10.72) ]]; then
495 if [ "$ping_flag" -eq 1 ]; then
496 echo "Slave is pingable, now wait 90 seconds for services to start"
499 echo "Slave did not come back up after reboot: please check opnfv-jump-2"
507 echo "--------------------------------------------------------"
511 name: 'foreman-build'
519 # log info to console
520 echo "Starting the build of $INSTALLER. This could take some time..."
521 echo "--------------------------------------------------------"
524 # create the cache directory if it doesn't exist
525 [[ -d $CACHE_DIRECTORY ]] || mkdir -p $CACHE_DIRECTORY
527 # set OPNFV_ARTIFACT_VERSION
528 export OPNFV_ARTIFACT_VERSION=$(date -u +"%Y-%m-%d_%H-%M-%S")
531 cd $WORKSPACE/$INSTALLER/ci
532 ./build.sh -v $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY $BUILD_DIRECTORY
534 # list the contents of BUILD_OUTPUT directory
535 ls -al $BUILD_DIRECTORY
537 # save information regarding artifact into file
539 echo "OPNFV_ARTIFACT_VERSION=$OPNFV_ARTIFACT_VERSION"
540 echo "OPNFV_GIT_URL=$(git config --get remote.origin.url)"
541 echo "OPNFV_GIT_SHA1=$(git rev-parse HEAD)"
542 echo "OPNFV_ARTIFACT_URL=$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
543 echo "OPNFV_ARTIFACT_MD5SUM=$(md5sum $BUILD_DIRECTORY/OPNFV-CentOS-7-x86_64-$OPNFV_ARTIFACT_VERSION.iso | cut -d' ' -f1)"
544 echo "OPNFV_BUILD_URL=$BUILD_URL"
545 ) > $WORKSPACE/opnfv.properties
548 echo "--------------------------------------------------------"
552 name: 'foreman-deploy'
560 # log info to console
561 echo "Starting the deployment using $INSTALLER. This could take some time..."
562 echo "--------------------------------------------------------"
566 sudo $WORKSPACE/common/ci/clean.sh -base_config $WORKSPACE/$INSTALLER/ci/inventory/lf_pod2_ksgen_settings.yml
568 # and then initiate deployment
569 sudo $WORKSPACE/$INSTALLER/ci/deploy.sh -base_config $WORKSPACE/$INSTALLER/ci/inventory/lf_pod2_ksgen_settings.yml
572 echo "--------------------------------------------------------"
576 name: 'foreman-deploy-virtual'
584 # log info to console
585 echo "Starting the virtual deployment using $INSTALLER. This could take some time..."
586 echo "--------------------------------------------------------"
589 # cleanup baremetal first (in case baremetal was being used on pod2, remove when moved to isolated Virtual pod)
590 sudo $WORKSPACE/common/ci/clean.sh
592 # initiate virtual deployment
593 sudo $WORKSPACE/$INSTALLER/ci/deploy.sh -virtual
596 echo "--------------------------------------------------------"
600 name: 'foreman-upload-artifact'
608 # log info to console
609 echo "Uploading the $INSTALLER artifact. This could take some time..."
610 echo "--------------------------------------------------------"
613 # source the opnfv.properties to get ARTIFACT_VERSION
614 source $WORKSPACE/opnfv.properties
616 # upload artifact and additional files to google storage
617 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
618 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.properties > gsutil.properties.log 2>&1
619 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/latest.properties > gsutil.latest.log 2>&1
622 echo "--------------------------------------------------------"
624 echo "Artifact is available as http://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
627 name: 'foreman-workspace-cleanup'
635 # delete everything that is in $WORKSPACE
636 /bin/rm -rf $WORKSPACE
638 ########################
640 ########################
642 name: 'foreman-master'
644 - pollscm: '0 21 * * *'
647 name: 'foreman-stable-arno'
649 - pollscm: '0 1 * * *'