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}'
135 - genesis-fuel-parameter:
136 installer: '{installer}'
140 - gerrit-trigger-scm:
141 credentials-id: '{ssh-credentials}'
143 choosing-strategy: 'default'
148 - change-merged-event
149 - comment-added-contains-event:
150 comment-contains-value: 'remerge'
152 - project-compare-type: 'ANT'
153 project-pattern: 'genesis'
155 - branch-compare-type: 'ANT'
156 branch-pattern: '**/{branch}'
159 pattern: 'common/ci/**'
161 pattern: 'common/manifests/**'
163 pattern: 'common/puppet-opnfv/**'
165 pattern: 'common/tools/**'
167 pattern: '{installer}/build/**'
169 pattern: '{installer}/ci/**'
171 pattern: '{installer}/deploy/**'
173 pattern: '{installer}/include/**'
175 pattern: '{installer}/prototypes/**'
176 forbidden-file-paths:
178 pattern: 'common/docs/**'
180 pattern: '{installer}/docs/**'
184 - 'fuel-workspace-cleanup'
187 name: 'genesis-fuel-daily-{stream}'
191 disabled: '{obj:disabled}'
194 - 'genesis-fuel-{stream}-trigger'
199 - genesis-fuel-parameter:
200 installer: '{installer}'
201 gs-pathname: '{gs-pathname}'
205 credentials-id: '{ssh-credentials}'
212 artifactDaysToKeep: -1
213 artifactNumToKeep: -1
217 - project: 'genesis-fuel-build-{stream}'
221 - project: 'genesis-fuel-lab-reconfig-{stream}'
225 - project: 'genesis-fuel-deploy-{stream}'
229 - project: 'functest-fuel-{stream}'
232 build-step-failure-threshold: 'never'
233 failure-threshold: 'never'
234 unstable-threshold: 'FAILURE'
236 # - project: 'yardstick-fuel-{stream}'
239 # build-step-failure-threshold: 'never'
240 # failure-threshold: 'never'
241 # unstable-threshold: 'FAILURE'
244 - trigger-parameterized-builds:
245 - project: 'genesis-foreman-daily-{stream}'
246 trigger-with-no-params: true
249 name: 'genesis-fuel-deploy-runner-{stream}'
256 artifactDaysToKeep: -1
257 artifactNumToKeep: -1
262 - genesis-fuel-parameter:
263 installer: '{installer}'
264 gs-pathname: '{gs-pathname}'
267 default: ssh://gerrit.opnfv.org:29418/$PROJECT
268 description: "Used for overriding the GIT URL coming from parameters macro."
272 credentials-id: '{ssh-credentials}'
278 use-build-blocker: true
280 - "genesis-foreman-daily.*"
281 - "genesis-foreman-deploy-runner-{stream}"
282 - "genesis-fuel-daily.*"
285 - 'fuel-lab-reconfig'
287 - project: 'genesis-fuel-deploy-{stream}'
292 name: 'genesis-fuel-build-{stream}'
299 artifactDaysToKeep: -1
300 artifactNumToKeep: -1
305 - genesis-fuel-parameter:
306 installer: '{installer}'
307 gs-pathname: '{gs-pathname}'
311 credentials-id: '{ssh-credentials}'
317 - 'fuel-upload-artifact'
318 - 'fuel-workspace-cleanup'
322 recipients: jonas.bjurel@ericsson.com stefan.k.berg@ericsson.com
325 name: 'genesis-fuel-deploy-{stream}'
334 - genesis-fuel-parameter:
335 installer: '{installer}'
336 gs-pathname: '{gs-pathname}'
339 default: ssh://gerrit.opnfv.org:29418/$PROJECT
340 description: "POD2 has some issues with cloning using https so that's why GIT_BASE is overriden here again."
344 credentials-id: '{ssh-credentials}'
351 artifactDaysToKeep: -1
352 artifactNumToKeep: -1
355 - 'fuel-download-artifact'
360 recipients: jonas.bjurel@ericsson.com stefan.k.berg@ericsson.com
363 name: 'genesis-fuel-lab-reconfig-{stream}'
370 artifactDaysToKeep: -1
371 artifactNumToKeep: -1
376 - genesis-fuel-parameter:
377 installer: '{installer}'
378 gs-pathname: '{gs-pathname}'
381 default: ssh://gerrit.opnfv.org:29418/$PROJECT
382 description: "Used for overriding the GIT URL coming from parameters macro."
386 credentials-id: '{ssh-credentials}'
392 use-build-blocker: true
394 - "genesis-foreman-daily.*"
397 - 'fuel-lab-reconfig'
400 name: 'genesis-fuel-verify-deploy-virtual-{stream}'
409 - genesis-fuel-parameter:
410 installer: '{installer}'
415 credentials-id: '{ssh-credentials}'
422 artifactDaysToKeep: -1
423 artifactNumToKeep: -1
426 - 'fuel-deploy-virtual'
428 ########################
430 ########################
432 name: genesis-fuel-parameter
436 default: '{installer}'
437 description: "Installer to use."
439 name: BUILD_DIRECTORY
440 default: $WORKSPACE/build_output
441 description: "Directory where the build artifact will be located upon the completion of the build."
443 name: CACHE_DIRECTORY
444 default: $HOME/opnfv/cache/genesis-$INSTALLER
445 description: "Directory where the cache to be used during the build is located."
448 default: https://gerrit.opnfv.org/gerrit/$PROJECT
449 description: "Used for overriding the GIT URL coming from Global Jenkins configuration in case if the stuff is done on none-LF HW."
452 default: artifacts.opnfv.org/$PROJECT/$INSTALLER{gs-pathname}
453 description: "URL to Google Storage."
455 ########################
457 ########################
467 # log info to console
468 echo "Starting the build of $INSTALLER. This could take some time..."
469 echo "--------------------------------------------------------"
472 # create the cache directory if it doesn't exist
473 [[ -d $CACHE_DIRECTORY ]] || mkdir -p $CACHE_DIRECTORY
475 # set OPNFV_ARTIFACT_VERSION
476 export OPNFV_ARTIFACT_VERSION=$(date -u +"%Y-%m-%d_%H-%M-%S")
479 cd $WORKSPACE/$INSTALLER/ci
480 ./build.sh -v $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY $BUILD_DIRECTORY
482 # list the build artifacts
483 ls -al $BUILD_DIRECTORY
485 # save information regarding artifact into file
487 echo "OPNFV_ARTIFACT_VERSION=$OPNFV_ARTIFACT_VERSION"
488 echo "OPNFV_GIT_URL=$(git config --get remote.origin.url)"
489 echo "OPNFV_GIT_SHA1=$(git rev-parse HEAD)"
490 echo "OPNFV_ARTIFACT_URL=$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
491 echo "OPNFV_ARTIFACT_MD5SUM=$(md5sum $BUILD_DIRECTORY/opnfv-$OPNFV_ARTIFACT_VERSION.iso | cut -d' ' -f1)"
492 echo "OPNFV_BUILD_URL=$BUILD_URL"
493 ) > $WORKSPACE/opnfv.properties
496 echo "--------------------------------------------------------"
508 # source the file so we get OPNFV vars
509 source latest.properties
511 # echo the info about artifact that is used during the deployment
512 echo "Using $(echo $OPNFV_ARTIFACT_URL | cut -d'/' -f4) for deployment"
514 # create TMPDIR if it doesn't exist
515 export TMPDIR=$HOME/tmpdir
516 [[ -d $TMPDIR ]] || mkdir -p $TMPDIR
518 # change permissions down to TMPDIR
522 # set CONFDIR, BRIDGE
523 export CONFDIR=$WORKSPACE/fuel/deploy/templates/hardware_environment/conf/linux_foundation_lab/pod2
527 sudo $WORKSPACE/common/ci/clean.sh -base_config $WORKSPACE/foreman/ci/inventory/lf_pod2_ksgen_settings.yml
529 # prepare for Fuel Deployment
530 sudo $WORKSPACE/common/ci/setup.sh
532 # log info to console
533 echo "Starting the deployment using $INSTALLER. This could take some time..."
534 echo "--------------------------------------------------------"
537 # start the deployment
538 echo "Issuing command"
539 echo "sudo $WORKSPACE/fuel/ci/deploy.sh -iso $WORKSPACE/opnfv.iso -dea $CONFDIR/dea.yaml -dha $CONFDIR/dha.yaml -s $TMPDIR -b $BRIDGE -nh"
540 sudo $WORKSPACE/fuel/ci/deploy.sh -iso $WORKSPACE/opnfv.iso -dea $CONFDIR/dea.yaml -dha $CONFDIR/dha.yaml -s $TMPDIR -b $BRIDGE -nh
543 echo "--------------------------------------------------------"
547 name: 'fuel-deploy-virtual'
555 # log info to console
556 echo "Starting the deployment on virtual environment using $INSTALLER. This could take some time..."
557 echo "--------------------------------------------------------"
560 ssh -o BatchMode=yes -o TCPKeepAlive=yes cideploy@10.118.34.205 ./cideploy.sh
563 echo "--------------------------------------------------------"
567 name: 'fuel-upload-artifact'
575 # log info to console
576 echo "Uploading the $INSTALLER artifact. This could take some time..."
577 echo "--------------------------------------------------------"
580 # source the opnfv.properties to get ARTIFACT_VERSION
581 source $WORKSPACE/opnfv.properties
583 # upload artifact and additional files to google storage
584 gsutil cp $BUILD_DIRECTORY/opnfv-$OPNFV_ARTIFACT_VERSION.iso gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso > gsutil.iso.log 2>&1
585 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.properties > gsutil.properties.log 2>&1
586 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/latest.properties > gsutil.latest.log 2>&1
589 echo "--------------------------------------------------------"
591 echo "Artifact is available as http://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
594 name: 'fuel-download-artifact'
602 # get the latest.properties file in order to get info regarding latest artifact
603 curl -s -o $WORKSPACE/latest.properties http://$GS_URL/latest.properties
605 # check if we got the file
606 [[ -f latest.properties ]] || exit 1
608 # source the file so we get OPNFV vars
609 source latest.properties
611 # log info to console
612 echo "Downloading the $INSTALLER artifact using URL http://$OPNFV_ARTIFACT_URL"
613 echo "This could take some time..."
614 echo "--------------------------------------------------------"
618 curl -s -o $WORKSPACE/opnfv.iso http://$OPNFV_ARTIFACT_URL > gsutil.iso.log 2>&1
621 ls -al $WORKSPACE/opnfv.iso
624 echo "--------------------------------------------------------"
628 name: 'fuel-workspace-cleanup'
636 # delete everything that is in $WORKSPACE
637 /bin/rm -rf $WORKSPACE
640 name: 'fuel-lab-reconfig'
648 # check to see if ucs login info file exists
649 if [ -e ~/.ssh/ucs_creds ];then
650 source ~/.ssh/ucs_creds
652 echo "Unable to find UCS credentials for LF lab reconfiguration...Exiting"
657 echo "Cloning releng repo..."
658 if ! GIT_SSL_NO_VERIFY=true git clone https://gerrit.opnfv.org/gerrit/releng; then
659 echo "Unable to clone releng repo...Exiting"
663 # log info to console
664 echo "Starting the lab reconfiguration for $INSTALLER..."
665 echo "--------------------------------------------------------"
669 $WORKSPACE/releng/utils/lab-reconfiguration/create_venv.sh
671 # disable nounset because 'activate' script contains unbound variable(s)
674 source $WORKSPACE/releng/utils/lab-reconfiguration/venv/bin/activate
675 # set nounset back again
678 # verify we are in venv
679 if [[ ! $(which python | grep venv) ]]; then
680 echo "Unable to activate venv...Exiting"
684 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
686 # while undergoing reboot
689 # check to see if slave is back up
692 while [ "$ping_counter" -lt 20 ]; do
693 if [[ $(ping -c 5 172.30.10.72) ]]; then
701 if [ "$ping_flag" -eq 1 ]; then
702 echo "Slave is pingable, now wait 180 seconds for services to start"
705 echo "Slave did not come back up after reboot: please check opnfv-jump-2"
713 echo "--------------------------------------------------------"
716 ########################
718 ########################
720 name: 'genesis-fuel-master-trigger'
725 name: 'genesis-fuel-stable-arno-trigger'