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-virtual-master'
19 - 'genesis-fuel-deploy-runner-{stream}'
21 # stream: branch with - in place of / (eg. stable-arno)
22 # branch: branch (eg. stable/arno)
31 ########################
33 ########################
36 name: 'genesis-fuel-verify-{stream}'
38 project-type: freestyle
52 artifactDaysToKeep: -1
61 installer: '{installer}'
62 gs-pathname: '{gs-pathname}'
66 credentials-id: '{ssh-credentials}'
67 refspec: '$GERRIT_REFSPEC'
68 choosing-strategy: 'gerrit'
71 - ssh-agent-credentials:
72 user: '{ssh-credentials}'
77 - patchset-created-event:
78 exclude-drafts: 'false'
79 exclude-trivial-rebase: 'false'
80 exclude-no-code-change: 'false'
81 - draft-published-event
82 - comment-added-contains-event:
83 comment-contains-value: 'recheck'
84 - comment-added-contains-event:
85 comment-contains-value: 'reverify'
87 - project-compare-type: 'ANT'
88 project-pattern: 'genesis'
90 - branch-compare-type: 'ANT'
91 branch-pattern: '**/{branch}'
96 pattern: '{installer}/**'
100 - 'fuel-workspace-cleanup'
103 name: 'genesis-fuel-merge-{stream}'
105 project-type: freestyle
119 artifactDaysToKeep: -1
128 installer: '{installer}'
132 - gerrit-trigger-scm:
133 credentials-id: '{ssh-credentials}'
135 choosing-strategy: 'default'
138 - ssh-agent-credentials:
139 user: '{ssh-credentials}'
144 - change-merged-event
145 - comment-added-contains-event:
146 comment-contains-value: 'remerge'
148 - project-compare-type: 'ANT'
149 project-pattern: 'genesis'
151 - branch-compare-type: 'ANT'
152 branch-pattern: '**/{branch}'
157 pattern: '{installer}/**'
161 - 'fuel-workspace-cleanup'
164 name: 'genesis-fuel-daily-{stream}'
166 project-type: freestyle
179 installer: '{installer}'
180 gs-pathname: '{gs-pathname}'
184 credentials-id: '{ssh-credentials}'
191 artifactDaysToKeep: -1
192 artifactNumToKeep: -1
196 - project: 'genesis-fuel-build-{stream}'
200 - project: 'genesis-fuel-deploy-runner-{stream}'
204 - project: 'functest-opnfv-jump-1'
207 - project: 'yardstick-opnfv-jump-1'
211 name: 'genesis-fuel-build-{stream}'
213 project-type: freestyle
220 artifactDaysToKeep: -1
221 artifactNumToKeep: -1
227 installer: '{installer}'
228 gs-pathname: '{gs-pathname}'
232 credentials-id: '{ssh-credentials}'
238 - 'fuel-upload-artifact'
239 - 'fuel-workspace-cleanup'
242 name: 'genesis-fuel-deploy-{stream}'
244 project-type: freestyle
254 installer: '{installer}'
255 gs-pathname: '{gs-pathname}'
258 default: ssh://gerrit.opnfv.org:29418/$PROJECT
259 description: "POD1 has some issues with cloning using https so that's why GIT_BASE is overriden here again."
263 credentials-id: '{ssh-credentials}'
270 artifactDaysToKeep: -1
271 artifactNumToKeep: -1
274 - 'fuel-download-artifact'
275 - 'fuel-deploy-{stream}'
278 name: 'genesis-fuel-deploy-runner-{stream}'
280 project-type: freestyle
289 artifactDaysToKeep: -1
290 artifactNumToKeep: -1
296 installer: '{installer}'
297 gs-pathname: '{gs-pathname}'
300 default: ssh://gerrit.opnfv.org:29418/$PROJECT
301 description: "Used for overriding the GIT URL coming from parameters macro."
305 credentials-id: '{ssh-credentials}'
310 - 'fuel-lab-reconfig'
312 - project: 'genesis-fuel-deploy-{stream}'
317 name: 'genesis-fuel-deploy-virtual-master'
319 project-type: freestyle
329 installer: '{installer}'
334 credentials-id: '{ssh-credentials}'
341 artifactDaysToKeep: -1
342 artifactNumToKeep: -1
345 - 'fuel-deploy-virtual'
347 ########################
349 ########################
355 default: '{installer}'
356 description: "Installer to use."
358 name: BUILD_DIRECTORY
359 default: $WORKSPACE/build_output
360 description: "Directory where the build artifact will be located upon the completion of the build."
362 name: CACHE_DIRECTORY
363 default: $HOME/opnfv/cache/genesis-$INSTALLER
364 description: "Directory where the cache to be used during the build is located."
367 default: https://gerrit.opnfv.org/gerrit/$PROJECT
368 description: "Used for overriding the GIT URL coming from Global Jenkins configuration in case if the stuff is done on none-LF HW."
371 default: artifacts.opnfv.org/$PROJECT/$INSTALLER{gs-pathname}
372 description: "URL to Google Storage."
374 ########################
376 ########################
386 # log info to console
387 echo "Starting the build of $INSTALLER. This could take some time..."
388 echo "--------------------------------------------------------"
391 # create the cache directory if it doesn't exist
392 [[ -d $CACHE_DIRECTORY ]] || mkdir -p $CACHE_DIRECTORY
394 # set OPNFV_ARTIFACT_VERSION
395 export OPNFV_ARTIFACT_VERSION=$(date -u +"%Y-%m-%d_%H-%M-%S")
398 cd $WORKSPACE/$INSTALLER/ci
399 ./build.sh -v $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY $BUILD_DIRECTORY
401 # list the build artifacts
402 ls -al $BUILD_DIRECTORY
404 # save information regarding artifact into file
406 echo "OPNFV_ARTIFACT_VERSION=$OPNFV_ARTIFACT_VERSION"
407 echo "OPNFV_GIT_URL=$(git config --get remote.origin.url)"
408 echo "OPNFV_GIT_SHA1=$(git rev-parse HEAD)"
409 echo "OPNFV_ARTIFACT_URL=$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
410 echo "OPNFV_ARTIFACT_MD5SUM=$(md5sum $BUILD_DIRECTORY/opnfv-$OPNFV_ARTIFACT_VERSION.iso | cut -d' ' -f1)"
411 echo "OPNFV_BUILD_URL=$BUILD_URL"
412 ) > $WORKSPACE/opnfv.properties
415 echo "--------------------------------------------------------"
419 name: 'fuel-deploy-master'
427 # source the file so we get OPNFV vars
428 source latest.properties
430 # echo the info about artifact that is used during the deployment
431 echo "Using $(echo $OPNFV_ARTIFACT_URL | cut -d'/' -f4) for deployment"
433 # create TMPDIR if it doesn't exist
434 export TMPDIR=$HOME/tmpdir
435 [[ -d $TMPDIR ]] || mkdir -p $TMPDIR
437 # change permissions down to TMPDIR
442 export TOPDIR=$WORKSPACE/fuel/prototypes/auto-deploy
444 # log info to console
445 echo "Starting the deployment using $INSTALLER. This could take some time..."
446 echo "--------------------------------------------------------"
449 # start the deployment
450 echo "Issuing command"
451 echo "sudo TMPDIR=${TMPDIR} ${TOPDIR}/deploy/deploy.sh ${WORKSPACE}/opnfv.iso ${TOPDIR}/configs/lf_pod1/dea_no-ha.yaml ${TOPDIR}/configs/lf_pod1/dha.yaml"
452 sudo TMPDIR=${TMPDIR} ${TOPDIR}/deploy/deploy.sh ${WORKSPACE}/opnfv.iso ${TOPDIR}/configs/lf_pod1/dea_no-ha.yaml ${TOPDIR}/configs/lf_pod1/dha.yaml
455 echo "--------------------------------------------------------"
459 name: 'fuel-deploy-stable-arno'
467 # source the file so we get OPNFV vars
468 source latest.properties
470 # echo the info about artifact that is used during the deployment
471 echo "Using $(echo $OPNFV_ARTIFACT_URL | cut -d'/' -f4) for deployment"
473 # create TMPDIR if it doesn't exist
474 export TMPDIR=$HOME/tmp/$JOB_NAME
475 [[ -d $TMPDIR ]] || mkdir -p $TMPDIR
477 # change permissions down to TMPDIR
481 # log info to console
482 echo "Starting the deployment using $INSTALLER. This could take some time..."
483 echo "--------------------------------------------------------"
486 # start the deployment
487 echo "Issuing command"
488 echo "sudo $WORKSPACE/fuel/ci/deploy.sh $WORKSPACE/opnfv.iso $WORKSPACE/fuel/deploy/baremetal/conf/linux_foundation_lab/ha/dea.yaml $WORKSPACE/fuel/deploy/baremetal/conf/linux_foundation_lab/ha/dha.yaml -s $TMPDIR"
490 sudo $WORKSPACE/fuel/ci/deploy.sh $WORKSPACE/opnfv.iso $WORKSPACE/fuel/deploy/baremetal/conf/linux_foundation_lab/ha/dea.yaml $WORKSPACE/fuel/deploy/baremetal/conf/linux_foundation_lab/ha/dha.yaml -s $TMPDIR
492 echo "--------------------------------------------------------"
496 name: 'fuel-deploy-virtual'
504 # log info to console
505 echo "Starting the deployment on virtual environment using $INSTALLER. This could take some time..."
506 echo "--------------------------------------------------------"
509 ssh -o BatchMode=yes -o TCPKeepAlive=yes cideploy@10.118.34.205 ./cideploy.sh
512 echo "--------------------------------------------------------"
516 name: 'fuel-upload-artifact'
524 # log info to console
525 echo "Uploading the $INSTALLER artifact. This could take some time..."
526 echo "--------------------------------------------------------"
529 # source the opnfv.properties to get ARTIFACT_VERSION
530 source $WORKSPACE/opnfv.properties
532 # upload artifact and additional files to google storage
533 gsutil cp $BUILD_DIRECTORY/opnfv-$OPNFV_ARTIFACT_VERSION.iso gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso > gsutil.iso.log 2>&1
534 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.properties > gsutil.properties.log 2>&1
535 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/latest.properties > gsutil.latest.log 2>&1
538 echo "--------------------------------------------------------"
540 echo "Artifact is available as http://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
543 name: 'fuel-download-artifact'
551 # get the latest.properties file in order to get info regarding latest artifact
552 curl -s -o $WORKSPACE/latest.properties http://$GS_URL/latest.properties
554 # check if we got the file
555 [[ -f latest.properties ]] || exit 1
557 # source the file so we get OPNFV vars
558 source latest.properties
560 # log info to console
561 echo "Downloading the $INSTALLER artifact using URL http://$OPNFV_ARTIFACT_URL"
562 echo "This could take some time..."
563 echo "--------------------------------------------------------"
567 curl -s -o $WORKSPACE/opnfv.iso http://$OPNFV_ARTIFACT_URL > gsutil.iso.log 2>&1
570 ls -al $WORKSPACE/opnfv.iso
573 echo "--------------------------------------------------------"
577 name: 'fuel-workspace-cleanup'
585 # delete everything that is in $WORKSPACE
586 /bin/rm -rf $WORKSPACE
589 name: 'fuel-lab-reconfig'
597 # check to see if ucs login info file exists
598 if [ -e ~/.ssh/ucs_creds ];then
599 source ~/.ssh/ucs_creds
601 echo "Unable to find UCS credentials for LF lab reconfiguration...Exiting"
606 echo "Cloning releng repo..."
607 if ! GIT_SSL_NO_VERIFY=true git clone https://gerrit.opnfv.org/gerrit/releng; then
608 echo "Unable to clone releng repo...Exiting"
612 # log info to console
613 echo "Starting the lab reconfiguration for $INSTALLER..."
614 echo "--------------------------------------------------------"
618 $WORKSPACE/releng/utils/lab-reconfiguration/create_venv.sh
620 # disable nounset because 'activate' script contains unbound variable(s)
623 source $WORKSPACE/releng/utils/lab-reconfiguration/venv/bin/activate
624 # set nounset back again
627 # verify we are in venv
628 if [[ ! $(which python | grep venv) ]]; then
629 echo "Unable to activate venv...Exiting"
633 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
635 # while undergoing reboot
638 # check to see if slave is back up
641 while [ "$ping_counter" -lt 20 ]; do
642 if [[ $(ping -c 5 172.30.10.72) ]]; then
650 if [ "$ping_flag" -eq 1 ]; then
651 echo "Slave is pingable, now wait 60 seconds for services to start"
654 echo "Slave did not come back up after reboot: please check opnfv-jump-2"
662 echo "--------------------------------------------------------"
665 ########################
667 ########################
671 - timed: '0 21 * * *'
674 name: 'fuel-stable-arno'