1 ########################
2 # Job configuration for genesis/fuel
3 ########################
13 - 'genesis-fuel-verify-{stream}'
14 - 'genesis-fuel-merge-{stream}'
15 - 'genesis-fuel-daily-{stream}'
16 - 'genesis-fuel-build-{stream}'
17 - 'genesis-fuel-deploy-{stream}'
18 - 'genesis-fuel-deploy-runner-{stream}'
19 - 'genesis-fuel-lab-reconfig-{stream}'
20 - 'genesis-fuel-deploy-virtual-{stream}'
22 # stream: branch with - in place of / (eg. stable-arno)
23 # branch: branch (eg. stable/arno)
32 ########################
34 ########################
37 name: 'genesis-fuel-verify-{stream}'
39 project-type: freestyle
53 artifactDaysToKeep: -1
62 installer: '{installer}'
63 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}'
97 pattern: '{installer}/**'
101 - 'fuel-workspace-cleanup'
104 name: 'genesis-fuel-merge-{stream}'
106 project-type: freestyle
120 artifactDaysToKeep: -1
129 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-fuel-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-fuel-build-{stream}'
201 - project: 'genesis-fuel-lab-reconfig-{stream}'
205 - project: 'genesis-fuel-deploy-{stream}'
209 - project: 'functest-opnfv-jump-1'
212 - project: 'yardstick-opnfv-jump-1'
216 name: 'genesis-fuel-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-foreman-daily.*"
252 - "genesis-foreman-deploy-runner-{stream}"
253 - "genesis-fuel-daily.*"
256 - 'fuel-lab-reconfig'
258 - project: 'genesis-fuel-deploy-{stream}'
263 name: 'genesis-fuel-build-{stream}'
265 project-type: freestyle
272 artifactDaysToKeep: -1
273 artifactNumToKeep: -1
279 installer: '{installer}'
280 gs-pathname: '{gs-pathname}'
284 credentials-id: '{ssh-credentials}'
290 - 'fuel-upload-artifact'
291 - 'fuel-workspace-cleanup'
294 name: 'genesis-fuel-deploy-{stream}'
296 project-type: freestyle
306 installer: '{installer}'
307 gs-pathname: '{gs-pathname}'
310 default: ssh://gerrit.opnfv.org:29418/$PROJECT
311 description: "POD2 has some issues with cloning using https so that's why GIT_BASE is overriden here again."
315 credentials-id: '{ssh-credentials}'
322 artifactDaysToKeep: -1
323 artifactNumToKeep: -1
326 - 'fuel-download-artifact'
330 name: 'genesis-fuel-lab-reconfig-{stream}'
332 project-type: freestyle
341 artifactDaysToKeep: -1
342 artifactNumToKeep: -1
348 installer: '{installer}'
349 gs-pathname: '{gs-pathname}'
352 default: ssh://gerrit.opnfv.org:29418/$PROJECT
353 description: "Used for overriding the GIT URL coming from parameters macro."
357 credentials-id: '{ssh-credentials}'
363 use-build-blocker: true
365 - "genesis-foreman-daily.*"
368 - 'fuel-lab-reconfig'
371 name: 'genesis-fuel-deploy-virtual-{stream}'
373 project-type: freestyle
383 installer: '{installer}'
388 credentials-id: '{ssh-credentials}'
395 artifactDaysToKeep: -1
396 artifactNumToKeep: -1
399 - 'fuel-deploy-virtual'
401 ########################
403 ########################
409 default: '{installer}'
410 description: "Installer to use."
412 name: BUILD_DIRECTORY
413 default: $WORKSPACE/build_output
414 description: "Directory where the build artifact will be located upon the completion of the build."
416 name: CACHE_DIRECTORY
417 default: $HOME/opnfv/cache/genesis-$INSTALLER
418 description: "Directory where the cache to be used during the build is located."
421 default: https://gerrit.opnfv.org/gerrit/$PROJECT
422 description: "Used for overriding the GIT URL coming from Global Jenkins configuration in case if the stuff is done on none-LF HW."
425 default: artifacts.opnfv.org/$PROJECT/$INSTALLER{gs-pathname}
426 description: "URL to Google Storage."
428 ########################
430 ########################
440 # log info to console
441 echo "Starting the build of $INSTALLER. This could take some time..."
442 echo "--------------------------------------------------------"
445 # create the cache directory if it doesn't exist
446 [[ -d $CACHE_DIRECTORY ]] || mkdir -p $CACHE_DIRECTORY
448 # set OPNFV_ARTIFACT_VERSION
449 export OPNFV_ARTIFACT_VERSION=$(date -u +"%Y-%m-%d_%H-%M-%S")
452 cd $WORKSPACE/$INSTALLER/ci
453 ./build.sh -v $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY $BUILD_DIRECTORY
455 # list the build artifacts
456 ls -al $BUILD_DIRECTORY
458 # save information regarding artifact into file
460 echo "OPNFV_ARTIFACT_VERSION=$OPNFV_ARTIFACT_VERSION"
461 echo "OPNFV_GIT_URL=$(git config --get remote.origin.url)"
462 echo "OPNFV_GIT_SHA1=$(git rev-parse HEAD)"
463 echo "OPNFV_ARTIFACT_URL=$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
464 echo "OPNFV_ARTIFACT_MD5SUM=$(md5sum $BUILD_DIRECTORY/opnfv-$OPNFV_ARTIFACT_VERSION.iso | cut -d' ' -f1)"
465 echo "OPNFV_BUILD_URL=$BUILD_URL"
466 ) > $WORKSPACE/opnfv.properties
469 echo "--------------------------------------------------------"
481 # source the file so we get OPNFV vars
482 source latest.properties
484 # echo the info about artifact that is used during the deployment
485 echo "Using $(echo $OPNFV_ARTIFACT_URL | cut -d'/' -f4) for deployment"
487 # create TMPDIR if it doesn't exist
488 export TMPDIR=$HOME/tmpdir
489 [[ -d $TMPDIR ]] || mkdir -p $TMPDIR
491 # change permissions down to TMPDIR
495 # set CONFDIR, BRIDGE
496 export CONFDIR=$WORKSPACE/fuel/deploy/baremetal/conf/linux_foundation_lab/pod2/ha
500 sudo $WORKSPACE/common/ci/clean.sh -base_config $WORKSPACE/foreman/ci/inventory/lf_pod2_ksgen_settings.yml
502 # prepare for Fuel Deployment
503 sudo $WORKSPACE/common/ci/setup.sh
505 # log info to console
506 echo "Starting the deployment using $INSTALLER. This could take some time..."
507 echo "--------------------------------------------------------"
510 # start the deployment
511 echo "Issuing command"
512 echo "sudo $WORKSPACE/fuel/ci/deploy.sh $WORKSPACE/opnfv.iso $CONFDIR/dea.yaml $CONFDIR/dha.yaml -s $TMPDIR -b $BRIDGE"
513 sudo $WORKSPACE/fuel/ci/deploy.sh $WORKSPACE/opnfv.iso $CONFDIR/dea.yaml $CONFDIR/dha.yaml -s $TMPDIR -b $BRIDGE
516 echo "--------------------------------------------------------"
520 name: 'fuel-deploy-virtual'
528 # log info to console
529 echo "Starting the deployment on virtual environment using $INSTALLER. This could take some time..."
530 echo "--------------------------------------------------------"
533 ssh -o BatchMode=yes -o TCPKeepAlive=yes cideploy@10.118.34.205 ./cideploy.sh
536 echo "--------------------------------------------------------"
540 name: 'fuel-upload-artifact'
548 # log info to console
549 echo "Uploading the $INSTALLER artifact. This could take some time..."
550 echo "--------------------------------------------------------"
553 # source the opnfv.properties to get ARTIFACT_VERSION
554 source $WORKSPACE/opnfv.properties
556 # upload artifact and additional files to google storage
557 gsutil cp $BUILD_DIRECTORY/opnfv-$OPNFV_ARTIFACT_VERSION.iso gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso > gsutil.iso.log 2>&1
558 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.properties > gsutil.properties.log 2>&1
559 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/latest.properties > gsutil.latest.log 2>&1
562 echo "--------------------------------------------------------"
564 echo "Artifact is available as http://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
567 name: 'fuel-download-artifact'
575 # get the latest.properties file in order to get info regarding latest artifact
576 curl -s -o $WORKSPACE/latest.properties http://$GS_URL/latest.properties
578 # check if we got the file
579 [[ -f latest.properties ]] || exit 1
581 # source the file so we get OPNFV vars
582 source latest.properties
584 # log info to console
585 echo "Downloading the $INSTALLER artifact using URL http://$OPNFV_ARTIFACT_URL"
586 echo "This could take some time..."
587 echo "--------------------------------------------------------"
591 curl -s -o $WORKSPACE/opnfv.iso http://$OPNFV_ARTIFACT_URL > gsutil.iso.log 2>&1
594 ls -al $WORKSPACE/opnfv.iso
597 echo "--------------------------------------------------------"
601 name: 'fuel-workspace-cleanup'
609 # delete everything that is in $WORKSPACE
610 /bin/rm -rf $WORKSPACE
613 name: 'fuel-lab-reconfig'
621 # check to see if ucs login info file exists
622 if [ -e ~/.ssh/ucs_creds ];then
623 source ~/.ssh/ucs_creds
625 echo "Unable to find UCS credentials for LF lab reconfiguration...Exiting"
630 echo "Cloning releng repo..."
631 if ! GIT_SSL_NO_VERIFY=true git clone https://gerrit.opnfv.org/gerrit/releng; then
632 echo "Unable to clone releng repo...Exiting"
636 # log info to console
637 echo "Starting the lab reconfiguration for $INSTALLER..."
638 echo "--------------------------------------------------------"
642 $WORKSPACE/releng/utils/lab-reconfiguration/create_venv.sh
644 # disable nounset because 'activate' script contains unbound variable(s)
647 source $WORKSPACE/releng/utils/lab-reconfiguration/venv/bin/activate
648 # set nounset back again
651 # verify we are in venv
652 if [[ ! $(which python | grep venv) ]]; then
653 echo "Unable to activate venv...Exiting"
657 python $WORKSPACE/releng/utils/lab-reconfiguration/reconfigUcsNet.py -i $ucs_host -u $ucs_user -p $ucs_password -f $WORKSPACE/releng/utils/lab-reconfiguration/fuel.yaml
659 # while undergoing reboot
662 # check to see if slave is back up
665 while [ "$ping_counter" -lt 20 ]; do
666 if [[ $(ping -c 5 172.30.10.72) ]]; then
674 if [ "$ping_flag" -eq 1 ]; then
675 echo "Slave is pingable, now wait 90 seconds for services to start"
678 echo "Slave did not come back up after reboot: please check opnfv-jump-2"
686 echo "--------------------------------------------------------"
689 ########################
691 ########################
698 name: 'fuel-stable-arno'