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)
34 ########################
36 ########################
39 name: 'genesis-fuel-verify-build-{stream}'
53 artifactDaysToKeep: -1
61 - genesis-fuel-parameter:
62 installer: '{installer}'
63 gs-pathname: '{gs-pathname}'
67 credentials-id: '{ssh-credentials}'
68 refspec: '$GERRIT_REFSPEC'
69 choosing-strategy: 'gerrit'
74 - patchset-created-event:
75 exclude-drafts: 'false'
76 exclude-trivial-rebase: 'false'
77 exclude-no-code-change: 'false'
78 - draft-published-event
79 - comment-added-contains-event:
80 comment-contains-value: 'recheck'
81 - comment-added-contains-event:
82 comment-contains-value: 'reverify'
84 - project-compare-type: 'ANT'
85 project-pattern: 'genesis'
87 - branch-compare-type: 'ANT'
88 branch-pattern: '**/{branch}'
91 pattern: 'common/ci/**'
93 pattern: 'common/manifests/**'
95 pattern: 'common/puppet-opnfv/**'
97 pattern: 'common/tools/**'
99 pattern: '{installer}/build/**'
101 pattern: '{installer}/ci/**'
103 pattern: '{installer}/deploy/**'
105 pattern: '{installer}/include/**'
107 pattern: '{installer}/prototypes/**'
108 forbidden-file-paths:
110 pattern: 'common/docs/**'
112 pattern: '{installer}/docs/**'
116 - 'fuel-workspace-cleanup'
119 name: 'genesis-fuel-merge-{stream}'
133 artifactDaysToKeep: -1
141 - genesis-fuel-parameter:
142 installer: '{installer}'
146 - gerrit-trigger-scm:
147 credentials-id: '{ssh-credentials}'
149 choosing-strategy: 'default'
154 - change-merged-event
155 - comment-added-contains-event:
156 comment-contains-value: 'remerge'
158 - project-compare-type: 'ANT'
159 project-pattern: 'genesis'
161 - branch-compare-type: 'ANT'
162 branch-pattern: '**/{branch}'
165 pattern: 'common/ci/**'
167 pattern: 'common/manifests/**'
169 pattern: 'common/puppet-opnfv/**'
171 pattern: 'common/tools/**'
173 pattern: '{installer}/build/**'
175 pattern: '{installer}/ci/**'
177 pattern: '{installer}/deploy/**'
179 pattern: '{installer}/include/**'
181 pattern: '{installer}/prototypes/**'
182 forbidden-file-paths:
184 pattern: 'common/docs/**'
186 pattern: '{installer}/docs/**'
190 - 'fuel-workspace-cleanup'
193 name: 'genesis-fuel-daily-{stream}'
197 disabled: '{obj:disabled}'
200 - 'genesis-fuel-{stream}-trigger'
205 - genesis-fuel-parameter:
206 installer: '{installer}'
207 gs-pathname: '{gs-pathname}'
211 credentials-id: '{ssh-credentials}'
218 artifactDaysToKeep: -1
219 artifactNumToKeep: -1
223 - project: 'genesis-fuel-build-{stream}'
227 - project: 'genesis-fuel-lab-reconfig-{stream}'
231 - project: 'genesis-fuel-deploy-{stream}'
235 - project: 'functest-fuel-{stream}'
238 build-step-failure-threshold: 'never'
239 failure-threshold: 'never'
240 unstable-threshold: 'FAILURE'
242 # - project: 'yardstick-fuel-{stream}'
245 # build-step-failure-threshold: 'never'
246 # failure-threshold: 'never'
247 # unstable-threshold: 'FAILURE'
250 - trigger-parameterized-builds:
251 - project: 'genesis-foreman-daily-{stream}'
252 trigger-with-no-params: true
255 name: 'genesis-fuel-deploy-runner-{stream}'
262 artifactDaysToKeep: -1
263 artifactNumToKeep: -1
268 - genesis-fuel-parameter:
269 installer: '{installer}'
270 gs-pathname: '{gs-pathname}'
273 default: ssh://gerrit.opnfv.org:29418/$PROJECT
274 description: "Used for overriding the GIT URL coming from parameters macro."
278 credentials-id: '{ssh-credentials}'
284 use-build-blocker: true
286 - "genesis-foreman-daily.*"
287 - "genesis-foreman-deploy-runner-{stream}"
288 - "genesis-fuel-daily.*"
291 - 'fuel-lab-reconfig'
293 - project: 'genesis-fuel-deploy-{stream}'
298 name: 'genesis-fuel-build-{stream}'
305 artifactDaysToKeep: -1
306 artifactNumToKeep: -1
311 - genesis-fuel-parameter:
312 installer: '{installer}'
313 gs-pathname: '{gs-pathname}'
317 credentials-id: '{ssh-credentials}'
323 - 'fuel-upload-artifact'
324 - 'fuel-workspace-cleanup'
328 recipients: jonas.bjurel@ericsson.com stefan.k.berg@ericsson.com
331 name: 'genesis-fuel-deploy-{stream}'
340 - genesis-fuel-parameter:
341 installer: '{installer}'
342 gs-pathname: '{gs-pathname}'
345 default: ssh://gerrit.opnfv.org:29418/$PROJECT
346 description: "POD2 has some issues with cloning using https so that's why GIT_BASE is overriden here again."
350 credentials-id: '{ssh-credentials}'
357 artifactDaysToKeep: -1
358 artifactNumToKeep: -1
361 - 'fuel-download-artifact'
366 recipients: jonas.bjurel@ericsson.com stefan.k.berg@ericsson.com
369 name: 'genesis-fuel-lab-reconfig-{stream}'
376 artifactDaysToKeep: -1
377 artifactNumToKeep: -1
382 - genesis-fuel-parameter:
383 installer: '{installer}'
384 gs-pathname: '{gs-pathname}'
387 default: ssh://gerrit.opnfv.org:29418/$PROJECT
388 description: "Used for overriding the GIT URL coming from parameters macro."
392 credentials-id: '{ssh-credentials}'
398 use-build-blocker: true
400 - "genesis-foreman-daily.*"
403 - 'fuel-lab-reconfig'
406 name: 'genesis-fuel-verify-deploy-virtual-{stream}'
415 - genesis-fuel-parameter:
416 installer: '{installer}'
421 credentials-id: '{ssh-credentials}'
428 artifactDaysToKeep: -1
429 artifactNumToKeep: -1
432 - 'fuel-deploy-virtual'
434 ########################
436 ########################
438 name: genesis-fuel-parameter
442 default: '{installer}'
443 description: "Installer to use."
445 name: BUILD_DIRECTORY
446 default: $WORKSPACE/build_output
447 description: "Directory where the build artifact will be located upon the completion of the build."
449 name: CACHE_DIRECTORY
450 default: $HOME/opnfv/cache/genesis-$INSTALLER
451 description: "Directory where the cache to be used during the build is located."
454 default: https://gerrit.opnfv.org/gerrit/$PROJECT
455 description: "Used for overriding the GIT URL coming from Global Jenkins configuration in case if the stuff is done on none-LF HW."
458 default: artifacts.opnfv.org/$PROJECT/$INSTALLER{gs-pathname}
459 description: "URL to Google Storage."
461 ########################
463 ########################
473 # log info to console
474 echo "Starting the build of $INSTALLER. This could take some time..."
475 echo "--------------------------------------------------------"
478 # create the cache directory if it doesn't exist
479 [[ -d $CACHE_DIRECTORY ]] || mkdir -p $CACHE_DIRECTORY
481 # set OPNFV_ARTIFACT_VERSION
482 export OPNFV_ARTIFACT_VERSION=$(date -u +"%Y-%m-%d_%H-%M-%S")
485 cd $WORKSPACE/$INSTALLER/ci
486 ./build.sh -v $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY $BUILD_DIRECTORY
488 # list the build artifacts
489 ls -al $BUILD_DIRECTORY
491 # save information regarding artifact into file
493 echo "OPNFV_ARTIFACT_VERSION=$OPNFV_ARTIFACT_VERSION"
494 echo "OPNFV_GIT_URL=$(git config --get remote.origin.url)"
495 echo "OPNFV_GIT_SHA1=$(git rev-parse HEAD)"
496 echo "OPNFV_ARTIFACT_URL=$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
497 echo "OPNFV_ARTIFACT_MD5SUM=$(md5sum $BUILD_DIRECTORY/opnfv-$OPNFV_ARTIFACT_VERSION.iso | cut -d' ' -f1)"
498 echo "OPNFV_BUILD_URL=$BUILD_URL"
499 ) > $WORKSPACE/opnfv.properties
502 echo "--------------------------------------------------------"
514 # source the file so we get OPNFV vars
515 source latest.properties
517 # echo the info about artifact that is used during the deployment
518 echo "Using $(echo $OPNFV_ARTIFACT_URL | cut -d'/' -f4) for deployment"
520 # create TMPDIR if it doesn't exist
521 export TMPDIR=$HOME/tmpdir
522 [[ -d $TMPDIR ]] || mkdir -p $TMPDIR
524 # change permissions down to TMPDIR
528 # set CONFDIR, BRIDGE
529 export CONFDIR=$WORKSPACE/fuel/deploy/templates/hardware_environment/conf/linux_foundation_lab/pod2
533 sudo $WORKSPACE/common/ci/clean.sh -base_config $WORKSPACE/foreman/ci/inventory/lf_pod2_ksgen_settings.yml
535 # prepare for Fuel Deployment
536 sudo $WORKSPACE/common/ci/setup.sh
538 # log info to console
539 echo "Starting the deployment using $INSTALLER. This could take some time..."
540 echo "--------------------------------------------------------"
543 # start the deployment
544 echo "Issuing command"
545 echo "sudo $WORKSPACE/fuel/ci/deploy.sh -iso $WORKSPACE/opnfv.iso -dea $CONFDIR/dea.yaml -dha $CONFDIR/dha.yaml -s $TMPDIR -b $BRIDGE -nh"
546 sudo $WORKSPACE/fuel/ci/deploy.sh -iso $WORKSPACE/opnfv.iso -dea $CONFDIR/dea.yaml -dha $CONFDIR/dha.yaml -s $TMPDIR -b $BRIDGE -nh
549 echo "--------------------------------------------------------"
553 name: 'fuel-deploy-virtual'
561 # log info to console
562 echo "Starting the deployment on virtual environment using $INSTALLER. This could take some time..."
563 echo "--------------------------------------------------------"
566 ssh -o BatchMode=yes -o TCPKeepAlive=yes cideploy@10.118.34.205 ./cideploy.sh
569 echo "--------------------------------------------------------"
573 name: 'fuel-upload-artifact'
581 # log info to console
582 echo "Uploading the $INSTALLER artifact. This could take some time..."
583 echo "--------------------------------------------------------"
586 # source the opnfv.properties to get ARTIFACT_VERSION
587 source $WORKSPACE/opnfv.properties
589 # upload artifact and additional files to google storage
590 gsutil cp $BUILD_DIRECTORY/opnfv-$OPNFV_ARTIFACT_VERSION.iso gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso > gsutil.iso.log 2>&1
591 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.properties > gsutil.properties.log 2>&1
592 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/latest.properties > gsutil.latest.log 2>&1
595 echo "--------------------------------------------------------"
597 echo "Artifact is available as http://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
600 name: 'fuel-download-artifact'
608 # get the latest.properties file in order to get info regarding latest artifact
609 curl -s -o $WORKSPACE/latest.properties http://$GS_URL/latest.properties
611 # check if we got the file
612 [[ -f latest.properties ]] || exit 1
614 # source the file so we get OPNFV vars
615 source latest.properties
617 # log info to console
618 echo "Downloading the $INSTALLER artifact using URL http://$OPNFV_ARTIFACT_URL"
619 echo "This could take some time..."
620 echo "--------------------------------------------------------"
624 curl -s -o $WORKSPACE/opnfv.iso http://$OPNFV_ARTIFACT_URL > gsutil.iso.log 2>&1
627 ls -al $WORKSPACE/opnfv.iso
630 echo "--------------------------------------------------------"
634 name: 'fuel-workspace-cleanup'
642 # delete everything that is in $WORKSPACE
643 /bin/rm -rf $WORKSPACE
646 name: 'fuel-lab-reconfig'
654 # check to see if ucs login info file exists
655 if [ -e ~/.ssh/ucs_creds ];then
656 source ~/.ssh/ucs_creds
658 echo "Unable to find UCS credentials for LF lab reconfiguration...Exiting"
663 echo "Cloning releng repo..."
664 if ! GIT_SSL_NO_VERIFY=true git clone https://gerrit.opnfv.org/gerrit/releng; then
665 echo "Unable to clone releng repo...Exiting"
669 # log info to console
670 echo "Starting the lab reconfiguration for $INSTALLER..."
671 echo "--------------------------------------------------------"
675 $WORKSPACE/releng/utils/lab-reconfiguration/create_venv.sh
677 # disable nounset because 'activate' script contains unbound variable(s)
680 source $WORKSPACE/releng/utils/lab-reconfiguration/venv/bin/activate
681 # set nounset back again
684 # verify we are in venv
685 if [[ ! $(which python | grep venv) ]]; then
686 echo "Unable to activate venv...Exiting"
690 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
692 # while undergoing reboot
695 # check to see if slave is back up
698 while [ "$ping_counter" -lt 20 ]; do
699 if [[ $(ping -c 5 172.30.10.72) ]]; then
707 if [ "$ping_flag" -eq 1 ]; then
708 echo "Slave is pingable, now wait 180 seconds for services to start"
711 echo "Slave did not come back up after reboot: please check opnfv-jump-2"
719 echo "--------------------------------------------------------"
722 ########################
724 ########################
726 name: 'genesis-fuel-master-trigger'
731 name: 'genesis-fuel-stable-arno-trigger'