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-deploy-runner-{stream}'
19 - 'genesis-foreman-deploy-virtual-{stream}'
21 # stream: branch with - in place of / (eg. stable-arno)
22 # branch: branch (eg. stable/arno)
30 ########################
32 ########################
35 name: 'genesis-foreman-verify-{stream}'
37 project-type: freestyle
51 artifactDaysToKeep: -1
60 installer: '{installer}'
61 gs-pathname: '{gs-pathname}'
64 credentials-id: '{ssh-credentials}'
65 refspec: '$GERRIT_REFSPEC'
66 choosing-strategy: 'gerrit'
69 - ssh-agent-credentials:
70 user: '{ssh-credentials}'
75 - patchset-created-event:
76 exclude-drafts: 'false'
77 exclude-trivial-rebase: 'false'
78 exclude-no-code-change: 'false'
79 - draft-published-event
80 - comment-added-contains-event:
81 comment-contains-value: 'recheck'
82 - comment-added-contains-event:
83 comment-contains-value: 'reverify'
85 - project-compare-type: 'ANT'
86 project-pattern: 'genesis'
88 - branch-compare-type: 'ANT'
89 branch-pattern: '**/{branch}'
94 pattern: '{installer}/**'
98 - 'foreman-workspace-cleanup'
101 name: 'genesis-foreman-merge-{stream}'
103 project-type: freestyle
117 artifactDaysToKeep: -1
126 installer: '{installer}'
129 - gerrit-trigger-scm:
130 credentials-id: '{ssh-credentials}'
132 choosing-strategy: 'default'
135 - ssh-agent-credentials:
136 user: '{ssh-credentials}'
141 - change-merged-event
142 - comment-added-contains-event:
143 comment-contains-value: 'remerge'
145 - project-compare-type: 'ANT'
146 project-pattern: 'genesis'
148 - branch-compare-type: 'ANT'
149 branch-pattern: '**/{branch}'
154 pattern: '{installer}/**'
158 - 'fuel-workspace-cleanup'
161 name: 'genesis-foreman-daily-{stream}'
163 project-type: freestyle
176 installer: '{installer}'
177 gs-pathname: '{gs-pathname}'
180 credentials-id: '{ssh-credentials}'
187 artifactDaysToKeep: -1
188 artifactNumToKeep: -1
192 - project: 'genesis-foreman-build-{stream}'
196 # - project: 'genesis-foreman-deploy-runner-{stream}'
200 # - project: 'functest-opnfv-jump-2'
203 # - project: 'yardstick-opnfv-jump-2'
207 name: 'genesis-foreman-build-{stream}'
209 project-type: freestyle
216 artifactDaysToKeep: -1
217 artifactNumToKeep: -1
223 installer: '{installer}'
224 gs-pathname: '{gs-pathname}'
227 credentials-id: '{ssh-credentials}'
233 - 'foreman-upload-artifact'
234 - 'fuel-workspace-cleanup'
237 name: 'genesis-foreman-deploy-{stream}'
239 project-type: freestyle
248 artifactDaysToKeep: -1
249 artifactNumToKeep: -1
255 installer: '{installer}'
256 gs-pathname: '{gs-pathname}'
259 default: ssh://gerrit.opnfv.org:29418/$PROJECT
260 description: "Used for overriding the GIT URL coming from parameters macro."
264 credentials-id: '{ssh-credentials}'
272 name: 'genesis-foreman-deploy-runner-{stream}'
274 project-type: freestyle
283 artifactDaysToKeep: -1
284 artifactNumToKeep: -1
290 installer: '{installer}'
291 gs-pathname: '{gs-pathname}'
294 default: ssh://gerrit.opnfv.org:29418/$PROJECT
295 description: "Used for overriding the GIT URL coming from parameters macro."
299 credentials-id: '{ssh-credentials}'
304 - 'foreman-lab-reconfig'
306 - project: 'genesis-foreman-deploy-{stream}'
311 name: 'genesis-foreman-deploy-virtual-{stream}'
313 project-type: freestyle
322 artifactDaysToKeep: -1
323 artifactNumToKeep: -1
329 installer: '{installer}'
330 gs-pathname: '{gs-pathname}'
333 default: ssh://gerrit.opnfv.org:29418/$PROJECT
334 description: "Used for overriding the GIT URL coming from parameters macro."
338 credentials-id: '{ssh-credentials}'
343 - 'foreman-deploy-virtual'
345 ########################
347 ########################
349 name: foreman-parameter
353 default: '{installer}'
354 description: "Installer to use."
356 name: BUILD_DIRECTORY
357 default: $WORKSPACE/build_output
358 description: "Directory where the build artifact will be located upon the completion of the build."
360 name: CACHE_DIRECTORY
361 default: $HOME/opnfv/cache/genesis-$INSTALLER{gs-pathname}
362 description: "Directory where the cache to be used during the build is located."
365 default: https://gerrit.opnfv.org/gerrit/$PROJECT
366 description: "Used for overriding the GIT URL coming from Global Jenkins configuration in case if the stuff is done on none-LF HW."
369 default: artifacts.opnfv.org/$PROJECT/$INSTALLER{gs-pathname}
370 description: "URL to Google Storage."
372 ########################
374 ########################
376 name: 'foreman-lab-reconfig'
384 # check to see if ucs login info file exists
385 if [ -e ~/.ssh/ucs_creds ];then
386 source ~/.ssh/ucs_creds
388 echo "Unable to find UCS credentials for LF lab reconfiguration...Exiting"
393 echo "Cloning releng repo..."
394 if ! GIT_SSL_NO_VERIFY=true git clone https://gerrit.opnfv.org/gerrit/releng; then
395 echo "Unable to clone releng repo...Exiting"
399 # log info to console
400 echo "Starting the lab reconfiguration for $INSTALLER..."
401 echo "--------------------------------------------------------"
405 $WORKSPACE/releng/utils/lab-reconfiguration/create_venv.sh
407 # disable nounset because 'activate' script contains unbound variable(s)
410 source $WORKSPACE/releng/utils/lab-reconfiguration/venv/bin/activate
411 # set nounset back again
414 # verify we are in venv
415 if [[ ! $(which python | grep venv) ]]; then
416 echo "Unable to activate venv...Exiting"
420 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
422 # while undergoing reboot
425 # check to see if slave is back up
428 while [ "$ping_counter" -lt 20 ]; do
429 if [[ $(ping -c 5 172.30.10.72) ]]; then
437 if [ "$ping_flag" -eq 1 ]; then
438 echo "Slave is pingable, now wait 60 seconds for services to start"
441 echo "Slave did not come back up after reboot: please check opnfv-jump-2"
449 echo "--------------------------------------------------------"
453 name: 'foreman-build'
461 # log info to console
462 echo "Starting the build of $INSTALLER. This could take some time..."
463 echo "--------------------------------------------------------"
466 # create the cache directory if it doesn't exist
467 [[ -d $CACHE_DIRECTORY ]] || mkdir -p $CACHE_DIRECTORY
469 # set OPNFV_ARTIFACT_VERSION
470 export OPNFV_ARTIFACT_VERSION=$(date -u +"%Y-%m-%d_%H-%M-%S")
473 cd $WORKSPACE/$INSTALLER/ci
474 ./build.sh -v $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY $BUILD_DIRECTORY
476 # list the contents of BUILD_OUTPUT directory
477 ls -al $BUILD_DIRECTORY
479 # save information regarding artifact into file
481 echo "OPNFV_ARTIFACT_VERSION=$OPNFV_ARTIFACT_VERSION"
482 echo "OPNFV_GIT_URL=$(git config --get remote.origin.url)"
483 echo "OPNFV_GIT_SHA1=$(git rev-parse HEAD)"
484 echo "OPNFV_ARTIFACT_URL=$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
485 echo "OPNFV_ARTIFACT_MD5SUM=$(md5sum $BUILD_DIRECTORY/OPNFV-CentOS-7-x86_64-$OPNFV_ARTIFACT_VERSION.iso | cut -d' ' -f1)"
486 echo "OPNFV_BUILD_URL=$BUILD_URL"
487 ) > $WORKSPACE/opnfv.properties
490 echo "--------------------------------------------------------"
494 name: 'foreman-deploy'
502 # log info to console
503 echo "Starting the deployment using $INSTALLER. This could take some time..."
504 echo "--------------------------------------------------------"
508 sudo $WORKSPACE/common/ci/clean.sh -base_config $WORKSPACE/$INSTALLER/ci/inventory/lf_pod2_ksgen_settings.yml
510 # and then initiate deployment
511 sudo $WORKSPACE/$INSTALLER/ci/deploy.sh -base_config $WORKSPACE/$INSTALLER/ci/inventory/lf_pod2_ksgen_settings.yml
514 echo "--------------------------------------------------------"
518 name: 'foreman-deploy-virtual'
526 # log info to console
527 echo "Starting the virtual deployment using $INSTALLER. This could take some time..."
528 echo "--------------------------------------------------------"
531 # cleanup baremetal first (in case baremetal was being used on pod2, remove when moved to isolated Virtual pod)
532 sudo $WORKSPACE/common/ci/clean.sh
534 # initiate virtual deployment
535 sudo $WORKSPACE/$INSTALLER/ci/deploy.sh -virtual
538 echo "--------------------------------------------------------"
542 name: 'foreman-upload-artifact'
550 # log info to console
551 echo "Uploading the $INSTALLER artifact. This could take some time..."
552 echo "--------------------------------------------------------"
555 # source the opnfv.properties to get ARTIFACT_VERSION
556 source $WORKSPACE/opnfv.properties
558 # upload artifact and additional files to google storage
559 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
560 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.properties > gsutil.properties.log 2>&1
561 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/latest.properties > gsutil.latest.log 2>&1
564 echo "--------------------------------------------------------"
566 echo "Artifact is available as http://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
569 name: 'foreman-workspace-cleanup'
577 # delete everything that is in $WORKSPACE
578 /bin/rm -rf $WORKSPACE
580 ########################
582 ########################
584 name: 'foreman-master'
586 - pollscm: '0 21 * * *'
589 name: 'foreman-stable-arno'
591 - pollscm: '0 3 * * *'