1 ########################
2 # Job configuration for genesis/fuel
3 ########################
13 - 'genesis-fuel-verify-build-{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-verify-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-build-{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-fuel-{stream}'
212 build-step-failure-threshold: 'never'
213 failure-threshold: 'never'
214 unstable-threshold: 'FAILURE'
216 - project: 'yardstick-fuel-{stream}'
219 build-step-failure-threshold: 'never'
220 failure-threshold: 'never'
221 unstable-threshold: 'FAILURE'
224 name: 'genesis-fuel-deploy-runner-{stream}'
226 project-type: freestyle
235 artifactDaysToKeep: -1
236 artifactNumToKeep: -1
242 installer: '{installer}'
243 gs-pathname: '{gs-pathname}'
246 default: ssh://gerrit.opnfv.org:29418/$PROJECT
247 description: "Used for overriding the GIT URL coming from parameters macro."
251 credentials-id: '{ssh-credentials}'
257 use-build-blocker: true
259 - "genesis-foreman-daily.*"
260 - "genesis-foreman-deploy-runner-{stream}"
261 - "genesis-fuel-daily.*"
264 - 'fuel-lab-reconfig'
266 - project: 'genesis-fuel-deploy-{stream}'
271 name: 'genesis-fuel-build-{stream}'
273 project-type: freestyle
280 artifactDaysToKeep: -1
281 artifactNumToKeep: -1
287 installer: '{installer}'
288 gs-pathname: '{gs-pathname}'
292 credentials-id: '{ssh-credentials}'
298 - 'fuel-upload-artifact'
299 - 'fuel-workspace-cleanup'
303 recipients: jonas.bjurel@ericsson.com stefan.k.berg@ericsson.com
306 name: 'genesis-fuel-deploy-{stream}'
308 project-type: freestyle
318 installer: '{installer}'
319 gs-pathname: '{gs-pathname}'
322 default: ssh://gerrit.opnfv.org:29418/$PROJECT
323 description: "POD2 has some issues with cloning using https so that's why GIT_BASE is overriden here again."
327 credentials-id: '{ssh-credentials}'
334 artifactDaysToKeep: -1
335 artifactNumToKeep: -1
338 - 'fuel-download-artifact'
343 recipients: jonas.bjurel@ericsson.com stefan.k.berg@ericsson.com
346 name: 'genesis-fuel-lab-reconfig-{stream}'
348 project-type: freestyle
357 artifactDaysToKeep: -1
358 artifactNumToKeep: -1
364 installer: '{installer}'
365 gs-pathname: '{gs-pathname}'
368 default: ssh://gerrit.opnfv.org:29418/$PROJECT
369 description: "Used for overriding the GIT URL coming from parameters macro."
373 credentials-id: '{ssh-credentials}'
379 use-build-blocker: true
381 - "genesis-foreman-daily.*"
384 - 'fuel-lab-reconfig'
387 name: 'genesis-fuel-verify-deploy-virtual-{stream}'
389 project-type: freestyle
399 installer: '{installer}'
404 credentials-id: '{ssh-credentials}'
411 artifactDaysToKeep: -1
412 artifactNumToKeep: -1
415 - 'fuel-deploy-virtual'
417 ########################
419 ########################
425 default: '{installer}'
426 description: "Installer to use."
428 name: BUILD_DIRECTORY
429 default: $WORKSPACE/build_output
430 description: "Directory where the build artifact will be located upon the completion of the build."
432 name: CACHE_DIRECTORY
433 default: $HOME/opnfv/cache/genesis-$INSTALLER
434 description: "Directory where the cache to be used during the build is located."
437 default: https://gerrit.opnfv.org/gerrit/$PROJECT
438 description: "Used for overriding the GIT URL coming from Global Jenkins configuration in case if the stuff is done on none-LF HW."
441 default: artifacts.opnfv.org/$PROJECT/$INSTALLER{gs-pathname}
442 description: "URL to Google Storage."
444 ########################
446 ########################
456 # log info to console
457 echo "Starting the build of $INSTALLER. This could take some time..."
458 echo "--------------------------------------------------------"
461 # create the cache directory if it doesn't exist
462 [[ -d $CACHE_DIRECTORY ]] || mkdir -p $CACHE_DIRECTORY
464 # set OPNFV_ARTIFACT_VERSION
465 export OPNFV_ARTIFACT_VERSION=$(date -u +"%Y-%m-%d_%H-%M-%S")
468 cd $WORKSPACE/$INSTALLER/ci
469 ./build.sh -v $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY $BUILD_DIRECTORY
471 # list the build artifacts
472 ls -al $BUILD_DIRECTORY
474 # save information regarding artifact into file
476 echo "OPNFV_ARTIFACT_VERSION=$OPNFV_ARTIFACT_VERSION"
477 echo "OPNFV_GIT_URL=$(git config --get remote.origin.url)"
478 echo "OPNFV_GIT_SHA1=$(git rev-parse HEAD)"
479 echo "OPNFV_ARTIFACT_URL=$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
480 echo "OPNFV_ARTIFACT_MD5SUM=$(md5sum $BUILD_DIRECTORY/opnfv-$OPNFV_ARTIFACT_VERSION.iso | cut -d' ' -f1)"
481 echo "OPNFV_BUILD_URL=$BUILD_URL"
482 ) > $WORKSPACE/opnfv.properties
485 echo "--------------------------------------------------------"
497 # source the file so we get OPNFV vars
498 source latest.properties
500 # echo the info about artifact that is used during the deployment
501 echo "Using $(echo $OPNFV_ARTIFACT_URL | cut -d'/' -f4) for deployment"
503 # create TMPDIR if it doesn't exist
504 export TMPDIR=$HOME/tmpdir
505 [[ -d $TMPDIR ]] || mkdir -p $TMPDIR
507 # change permissions down to TMPDIR
511 # set CONFDIR, BRIDGE
512 export CONFDIR=$WORKSPACE/fuel/deploy/templates/hardware_environment/old_conf/linux_foundation_lab/pod2/ha
516 sudo $WORKSPACE/common/ci/clean.sh -base_config $WORKSPACE/foreman/ci/inventory/lf_pod2_ksgen_settings.yml
518 # prepare for Fuel Deployment
519 sudo $WORKSPACE/common/ci/setup.sh
521 # log info to console
522 echo "Starting the deployment using $INSTALLER. This could take some time..."
523 echo "--------------------------------------------------------"
526 # start the deployment
527 echo "Issuing command"
528 echo "sudo $WORKSPACE/fuel/ci/deploy.sh -iso $WORKSPACE/opnfv.iso -dea $CONFDIR/dea.yaml -dha $CONFDIR/dha.yaml -s $TMPDIR -b $BRIDGE"
529 sudo $WORKSPACE/fuel/ci/deploy.sh -iso $WORKSPACE/opnfv.iso -dea $CONFDIR/dea.yaml -dha $CONFDIR/dha.yaml -s $TMPDIR -b $BRIDGE
532 echo "--------------------------------------------------------"
536 name: 'fuel-deploy-virtual'
544 # log info to console
545 echo "Starting the deployment on virtual environment using $INSTALLER. This could take some time..."
546 echo "--------------------------------------------------------"
549 ssh -o BatchMode=yes -o TCPKeepAlive=yes cideploy@10.118.34.205 ./cideploy.sh
552 echo "--------------------------------------------------------"
556 name: 'fuel-upload-artifact'
564 # log info to console
565 echo "Uploading the $INSTALLER artifact. This could take some time..."
566 echo "--------------------------------------------------------"
569 # source the opnfv.properties to get ARTIFACT_VERSION
570 source $WORKSPACE/opnfv.properties
572 # upload artifact and additional files to google storage
573 gsutil cp $BUILD_DIRECTORY/opnfv-$OPNFV_ARTIFACT_VERSION.iso gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso > gsutil.iso.log 2>&1
574 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.properties > gsutil.properties.log 2>&1
575 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/latest.properties > gsutil.latest.log 2>&1
578 echo "--------------------------------------------------------"
580 echo "Artifact is available as http://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
583 name: 'fuel-download-artifact'
591 # get the latest.properties file in order to get info regarding latest artifact
592 curl -s -o $WORKSPACE/latest.properties http://$GS_URL/latest.properties
594 # check if we got the file
595 [[ -f latest.properties ]] || exit 1
597 # source the file so we get OPNFV vars
598 source latest.properties
600 # log info to console
601 echo "Downloading the $INSTALLER artifact using URL http://$OPNFV_ARTIFACT_URL"
602 echo "This could take some time..."
603 echo "--------------------------------------------------------"
607 curl -s -o $WORKSPACE/opnfv.iso http://$OPNFV_ARTIFACT_URL > gsutil.iso.log 2>&1
610 ls -al $WORKSPACE/opnfv.iso
613 echo "--------------------------------------------------------"
617 name: 'fuel-workspace-cleanup'
625 # delete everything that is in $WORKSPACE
626 /bin/rm -rf $WORKSPACE
629 name: 'fuel-lab-reconfig'
637 # check to see if ucs login info file exists
638 if [ -e ~/.ssh/ucs_creds ];then
639 source ~/.ssh/ucs_creds
641 echo "Unable to find UCS credentials for LF lab reconfiguration...Exiting"
646 echo "Cloning releng repo..."
647 if ! GIT_SSL_NO_VERIFY=true git clone https://gerrit.opnfv.org/gerrit/releng; then
648 echo "Unable to clone releng repo...Exiting"
652 # log info to console
653 echo "Starting the lab reconfiguration for $INSTALLER..."
654 echo "--------------------------------------------------------"
658 $WORKSPACE/releng/utils/lab-reconfiguration/create_venv.sh
660 # disable nounset because 'activate' script contains unbound variable(s)
663 source $WORKSPACE/releng/utils/lab-reconfiguration/venv/bin/activate
664 # set nounset back again
667 # verify we are in venv
668 if [[ ! $(which python | grep venv) ]]; then
669 echo "Unable to activate venv...Exiting"
673 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
675 # while undergoing reboot
678 # check to see if slave is back up
681 while [ "$ping_counter" -lt 20 ]; do
682 if [[ $(ping -c 5 172.30.10.72) ]]; then
690 if [ "$ping_flag" -eq 1 ]; then
691 echo "Slave is pingable, now wait 180 seconds for services to start"
694 echo "Slave did not come back up after reboot: please check opnfv-jump-2"
702 echo "--------------------------------------------------------"
705 ########################
707 ########################
714 name: 'fuel-stable-arno'