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'
302 name: 'genesis-fuel-deploy-{stream}'
304 project-type: freestyle
314 installer: '{installer}'
315 gs-pathname: '{gs-pathname}'
318 default: ssh://gerrit.opnfv.org:29418/$PROJECT
319 description: "POD2 has some issues with cloning using https so that's why GIT_BASE is overriden here again."
323 credentials-id: '{ssh-credentials}'
330 artifactDaysToKeep: -1
331 artifactNumToKeep: -1
334 - 'fuel-download-artifact'
338 name: 'genesis-fuel-lab-reconfig-{stream}'
340 project-type: freestyle
349 artifactDaysToKeep: -1
350 artifactNumToKeep: -1
356 installer: '{installer}'
357 gs-pathname: '{gs-pathname}'
360 default: ssh://gerrit.opnfv.org:29418/$PROJECT
361 description: "Used for overriding the GIT URL coming from parameters macro."
365 credentials-id: '{ssh-credentials}'
371 use-build-blocker: true
373 - "genesis-foreman-daily.*"
376 - 'fuel-lab-reconfig'
379 name: 'genesis-fuel-verify-deploy-virtual-{stream}'
381 project-type: freestyle
391 installer: '{installer}'
396 credentials-id: '{ssh-credentials}'
403 artifactDaysToKeep: -1
404 artifactNumToKeep: -1
407 - 'fuel-deploy-virtual'
409 ########################
411 ########################
417 default: '{installer}'
418 description: "Installer to use."
420 name: BUILD_DIRECTORY
421 default: $WORKSPACE/build_output
422 description: "Directory where the build artifact will be located upon the completion of the build."
424 name: CACHE_DIRECTORY
425 default: $HOME/opnfv/cache/genesis-$INSTALLER
426 description: "Directory where the cache to be used during the build is located."
429 default: https://gerrit.opnfv.org/gerrit/$PROJECT
430 description: "Used for overriding the GIT URL coming from Global Jenkins configuration in case if the stuff is done on none-LF HW."
433 default: artifacts.opnfv.org/$PROJECT/$INSTALLER{gs-pathname}
434 description: "URL to Google Storage."
436 ########################
438 ########################
448 # log info to console
449 echo "Starting the build of $INSTALLER. This could take some time..."
450 echo "--------------------------------------------------------"
453 # create the cache directory if it doesn't exist
454 [[ -d $CACHE_DIRECTORY ]] || mkdir -p $CACHE_DIRECTORY
456 # set OPNFV_ARTIFACT_VERSION
457 export OPNFV_ARTIFACT_VERSION=$(date -u +"%Y-%m-%d_%H-%M-%S")
460 cd $WORKSPACE/$INSTALLER/ci
461 ./build.sh -v $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY $BUILD_DIRECTORY
463 # list the build artifacts
464 ls -al $BUILD_DIRECTORY
466 # save information regarding artifact into file
468 echo "OPNFV_ARTIFACT_VERSION=$OPNFV_ARTIFACT_VERSION"
469 echo "OPNFV_GIT_URL=$(git config --get remote.origin.url)"
470 echo "OPNFV_GIT_SHA1=$(git rev-parse HEAD)"
471 echo "OPNFV_ARTIFACT_URL=$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
472 echo "OPNFV_ARTIFACT_MD5SUM=$(md5sum $BUILD_DIRECTORY/opnfv-$OPNFV_ARTIFACT_VERSION.iso | cut -d' ' -f1)"
473 echo "OPNFV_BUILD_URL=$BUILD_URL"
474 ) > $WORKSPACE/opnfv.properties
477 echo "--------------------------------------------------------"
489 # source the file so we get OPNFV vars
490 source latest.properties
492 # echo the info about artifact that is used during the deployment
493 echo "Using $(echo $OPNFV_ARTIFACT_URL | cut -d'/' -f4) for deployment"
495 # create TMPDIR if it doesn't exist
496 export TMPDIR=$HOME/tmpdir
497 [[ -d $TMPDIR ]] || mkdir -p $TMPDIR
499 # change permissions down to TMPDIR
503 # set CONFDIR, BRIDGE
504 export CONFDIR=$WORKSPACE/fuel/deploy/baremetal/conf/linux_foundation_lab/pod2/ha
508 sudo $WORKSPACE/common/ci/clean.sh -base_config $WORKSPACE/foreman/ci/inventory/lf_pod2_ksgen_settings.yml
510 # prepare for Fuel Deployment
511 sudo $WORKSPACE/common/ci/setup.sh
513 # log info to console
514 echo "Starting the deployment using $INSTALLER. This could take some time..."
515 echo "--------------------------------------------------------"
518 # start the deployment
519 echo "Issuing command"
520 echo "sudo $WORKSPACE/fuel/ci/deploy.sh $WORKSPACE/opnfv.iso $CONFDIR/dea.yaml $CONFDIR/dha.yaml -s $TMPDIR -b $BRIDGE"
521 sudo $WORKSPACE/fuel/ci/deploy.sh $WORKSPACE/opnfv.iso $CONFDIR/dea.yaml $CONFDIR/dha.yaml -s $TMPDIR -b $BRIDGE
524 echo "--------------------------------------------------------"
528 name: 'fuel-deploy-virtual'
536 # log info to console
537 echo "Starting the deployment on virtual environment using $INSTALLER. This could take some time..."
538 echo "--------------------------------------------------------"
541 ssh -o BatchMode=yes -o TCPKeepAlive=yes cideploy@10.118.34.205 ./cideploy.sh
544 echo "--------------------------------------------------------"
548 name: 'fuel-upload-artifact'
556 # log info to console
557 echo "Uploading the $INSTALLER artifact. This could take some time..."
558 echo "--------------------------------------------------------"
561 # source the opnfv.properties to get ARTIFACT_VERSION
562 source $WORKSPACE/opnfv.properties
564 # upload artifact and additional files to google storage
565 gsutil cp $BUILD_DIRECTORY/opnfv-$OPNFV_ARTIFACT_VERSION.iso gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso > gsutil.iso.log 2>&1
566 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.properties > gsutil.properties.log 2>&1
567 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/latest.properties > gsutil.latest.log 2>&1
570 echo "--------------------------------------------------------"
572 echo "Artifact is available as http://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
575 name: 'fuel-download-artifact'
583 # get the latest.properties file in order to get info regarding latest artifact
584 curl -s -o $WORKSPACE/latest.properties http://$GS_URL/latest.properties
586 # check if we got the file
587 [[ -f latest.properties ]] || exit 1
589 # source the file so we get OPNFV vars
590 source latest.properties
592 # log info to console
593 echo "Downloading the $INSTALLER artifact using URL http://$OPNFV_ARTIFACT_URL"
594 echo "This could take some time..."
595 echo "--------------------------------------------------------"
599 curl -s -o $WORKSPACE/opnfv.iso http://$OPNFV_ARTIFACT_URL > gsutil.iso.log 2>&1
602 ls -al $WORKSPACE/opnfv.iso
605 echo "--------------------------------------------------------"
609 name: 'fuel-workspace-cleanup'
617 # delete everything that is in $WORKSPACE
618 /bin/rm -rf $WORKSPACE
621 name: 'fuel-lab-reconfig'
629 # check to see if ucs login info file exists
630 if [ -e ~/.ssh/ucs_creds ];then
631 source ~/.ssh/ucs_creds
633 echo "Unable to find UCS credentials for LF lab reconfiguration...Exiting"
638 echo "Cloning releng repo..."
639 if ! GIT_SSL_NO_VERIFY=true git clone https://gerrit.opnfv.org/gerrit/releng; then
640 echo "Unable to clone releng repo...Exiting"
644 # log info to console
645 echo "Starting the lab reconfiguration for $INSTALLER..."
646 echo "--------------------------------------------------------"
650 $WORKSPACE/releng/utils/lab-reconfiguration/create_venv.sh
652 # disable nounset because 'activate' script contains unbound variable(s)
655 source $WORKSPACE/releng/utils/lab-reconfiguration/venv/bin/activate
656 # set nounset back again
659 # verify we are in venv
660 if [[ ! $(which python | grep venv) ]]; then
661 echo "Unable to activate venv...Exiting"
665 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
667 # while undergoing reboot
670 # check to see if slave is back up
673 while [ "$ping_counter" -lt 20 ]; do
674 if [[ $(ping -c 5 172.30.10.72) ]]; then
682 if [ "$ping_flag" -eq 1 ]; then
683 echo "Slave is pingable, now wait 180 seconds for services to start"
686 echo "Slave did not come back up after reboot: please check opnfv-jump-2"
694 echo "--------------------------------------------------------"
697 ########################
699 ########################
706 name: 'fuel-stable-arno'