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}'
55 - genesis-fuel-parameter:
56 installer: '{installer}'
57 gs-pathname: '{gs-pathname}'
61 credentials-id: '{ssh-credentials}'
62 refspec: '$GERRIT_REFSPEC'
63 choosing-strategy: 'gerrit'
68 - patchset-created-event:
69 exclude-drafts: 'false'
70 exclude-trivial-rebase: 'false'
71 exclude-no-code-change: 'false'
72 - draft-published-event
73 - comment-added-contains-event:
74 comment-contains-value: 'recheck'
75 - comment-added-contains-event:
76 comment-contains-value: 'reverify'
78 - project-compare-type: 'ANT'
79 project-pattern: 'genesis'
81 - branch-compare-type: 'ANT'
82 branch-pattern: '**/{branch}'
85 pattern: 'common/ci/**'
87 pattern: 'common/manifests/**'
89 pattern: 'common/puppet-opnfv/**'
91 pattern: 'common/tools/**'
93 pattern: '{installer}/build/**'
95 pattern: '{installer}/ci/**'
97 pattern: '{installer}/deploy/**'
99 pattern: '{installer}/include/**'
101 pattern: '{installer}/prototypes/**'
102 forbidden-file-paths:
104 pattern: 'common/docs/**'
106 pattern: '{installer}/docs/**'
110 - 'fuel-workspace-cleanup'
113 name: 'genesis-fuel-merge-{stream}'
129 - genesis-fuel-parameter:
130 installer: '{installer}'
134 - gerrit-trigger-scm:
135 credentials-id: '{ssh-credentials}'
137 choosing-strategy: 'default'
142 - change-merged-event
143 - comment-added-contains-event:
144 comment-contains-value: 'remerge'
146 - project-compare-type: 'ANT'
147 project-pattern: 'genesis'
149 - branch-compare-type: 'ANT'
150 branch-pattern: '**/{branch}'
153 pattern: 'common/ci/**'
155 pattern: 'common/manifests/**'
157 pattern: 'common/puppet-opnfv/**'
159 pattern: 'common/tools/**'
161 pattern: '{installer}/build/**'
163 pattern: '{installer}/ci/**'
165 pattern: '{installer}/deploy/**'
167 pattern: '{installer}/include/**'
169 pattern: '{installer}/prototypes/**'
170 forbidden-file-paths:
172 pattern: 'common/docs/**'
174 pattern: '{installer}/docs/**'
178 - 'fuel-workspace-cleanup'
181 name: 'genesis-fuel-daily-{stream}'
185 disabled: '{obj:disabled}'
188 - 'genesis-fuel-{stream}-trigger'
193 - genesis-fuel-parameter:
194 installer: '{installer}'
195 gs-pathname: '{gs-pathname}'
199 credentials-id: '{ssh-credentials}'
205 - project: 'genesis-fuel-build-{stream}'
209 - project: 'genesis-fuel-lab-reconfig-{stream}'
213 - project: 'genesis-fuel-deploy-{stream}'
217 - project: 'functest-fuel-{stream}'
220 build-step-failure-threshold: 'never'
221 failure-threshold: 'never'
222 unstable-threshold: 'FAILURE'
224 # - project: 'yardstick-fuel-{stream}'
227 # build-step-failure-threshold: 'never'
228 # failure-threshold: 'never'
229 # unstable-threshold: 'FAILURE'
232 - trigger-parameterized-builds:
233 - project: 'genesis-foreman-daily-{stream}'
234 trigger-with-no-params: true
237 name: 'genesis-fuel-deploy-runner-{stream}'
244 - genesis-fuel-parameter:
245 installer: '{installer}'
246 gs-pathname: '{gs-pathname}'
249 default: ssh://gerrit.opnfv.org:29418/$PROJECT
250 description: "Used for overriding the GIT URL coming from parameters macro."
254 credentials-id: '{ssh-credentials}'
260 use-build-blocker: true
262 - "genesis-foreman-daily.*"
263 - "genesis-foreman-deploy-runner-{stream}"
264 - "genesis-fuel-daily.*"
267 - 'fuel-lab-reconfig'
269 - project: 'genesis-fuel-deploy-{stream}'
274 name: 'genesis-fuel-build-{stream}'
281 - genesis-fuel-parameter:
282 installer: '{installer}'
283 gs-pathname: '{gs-pathname}'
287 credentials-id: '{ssh-credentials}'
293 - 'fuel-upload-artifact'
294 - 'fuel-workspace-cleanup'
298 recipients: jonas.bjurel@ericsson.com stefan.k.berg@ericsson.com
301 name: 'genesis-fuel-deploy-{stream}'
310 - genesis-fuel-parameter:
311 installer: '{installer}'
312 gs-pathname: '{gs-pathname}'
315 default: ssh://gerrit.opnfv.org:29418/$PROJECT
316 description: "POD2 has some issues with cloning using https so that's why GIT_BASE is overriden here again."
320 credentials-id: '{ssh-credentials}'
325 - 'fuel-download-artifact'
330 recipients: jonas.bjurel@ericsson.com stefan.k.berg@ericsson.com
333 name: 'genesis-fuel-lab-reconfig-{stream}'
340 - genesis-fuel-parameter:
341 installer: '{installer}'
342 gs-pathname: '{gs-pathname}'
345 default: ssh://gerrit.opnfv.org:29418/$PROJECT
346 description: "Used for overriding the GIT URL coming from parameters macro."
350 credentials-id: '{ssh-credentials}'
356 use-build-blocker: true
358 - "genesis-foreman-daily.*"
361 - 'fuel-lab-reconfig'
364 name: 'genesis-fuel-verify-deploy-virtual-{stream}'
373 - genesis-fuel-parameter:
374 installer: '{installer}'
379 credentials-id: '{ssh-credentials}'
384 - 'fuel-deploy-virtual'
386 ########################
388 ########################
390 name: genesis-fuel-parameter
394 default: '{installer}'
395 description: "Installer to use."
397 name: BUILD_DIRECTORY
398 default: $WORKSPACE/build_output
399 description: "Directory where the build artifact will be located upon the completion of the build."
401 name: CACHE_DIRECTORY
402 default: $HOME/opnfv/cache/genesis-$INSTALLER
403 description: "Directory where the cache to be used during the build is located."
406 default: https://gerrit.opnfv.org/gerrit/$PROJECT
407 description: "Used for overriding the GIT URL coming from Global Jenkins configuration in case if the stuff is done on none-LF HW."
410 default: artifacts.opnfv.org/$PROJECT/$INSTALLER{gs-pathname}
411 description: "URL to Google Storage."
413 ########################
415 ########################
425 # log info to console
426 echo "Starting the build of $INSTALLER. This could take some time..."
427 echo "--------------------------------------------------------"
430 # create the cache directory if it doesn't exist
431 [[ -d $CACHE_DIRECTORY ]] || mkdir -p $CACHE_DIRECTORY
433 # set OPNFV_ARTIFACT_VERSION
434 export OPNFV_ARTIFACT_VERSION=$(date -u +"%Y-%m-%d_%H-%M-%S")
437 cd $WORKSPACE/$INSTALLER/ci
438 ./build.sh -v $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY $BUILD_DIRECTORY
440 # list the build artifacts
441 ls -al $BUILD_DIRECTORY
443 # save information regarding artifact into file
445 echo "OPNFV_ARTIFACT_VERSION=$OPNFV_ARTIFACT_VERSION"
446 echo "OPNFV_GIT_URL=$(git config --get remote.origin.url)"
447 echo "OPNFV_GIT_SHA1=$(git rev-parse HEAD)"
448 echo "OPNFV_ARTIFACT_URL=$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
449 echo "OPNFV_ARTIFACT_MD5SUM=$(md5sum $BUILD_DIRECTORY/opnfv-$OPNFV_ARTIFACT_VERSION.iso | cut -d' ' -f1)"
450 echo "OPNFV_BUILD_URL=$BUILD_URL"
451 ) > $WORKSPACE/opnfv.properties
454 echo "--------------------------------------------------------"
466 # source the file so we get OPNFV vars
467 source latest.properties
469 # echo the info about artifact that is used during the deployment
470 echo "Using $(echo $OPNFV_ARTIFACT_URL | cut -d'/' -f4) for deployment"
472 # create TMPDIR if it doesn't exist
473 export TMPDIR=$HOME/tmpdir
474 [[ -d $TMPDIR ]] || mkdir -p $TMPDIR
476 # change permissions down to TMPDIR
480 # set CONFDIR, BRIDGE
481 export CONFDIR=$WORKSPACE/fuel/deploy/templates/hardware_environment/conf/linux_foundation_lab/pod2
485 sudo $WORKSPACE/common/ci/clean.sh -base_config $WORKSPACE/foreman/ci/inventory/lf_pod2_ksgen_settings.yml
487 # prepare for Fuel Deployment
488 sudo $WORKSPACE/common/ci/setup.sh
490 # log info to console
491 echo "Starting the deployment using $INSTALLER. This could take some time..."
492 echo "--------------------------------------------------------"
495 # start the deployment
496 echo "Issuing command"
497 echo "sudo $WORKSPACE/fuel/ci/deploy.sh -iso $WORKSPACE/opnfv.iso -dea $CONFDIR/dea.yaml -dha $CONFDIR/dha.yaml -s $TMPDIR -b $BRIDGE -nh"
498 sudo $WORKSPACE/fuel/ci/deploy.sh -iso $WORKSPACE/opnfv.iso -dea $CONFDIR/dea.yaml -dha $CONFDIR/dha.yaml -s $TMPDIR -b $BRIDGE -nh
501 echo "--------------------------------------------------------"
505 name: 'fuel-deploy-virtual'
513 # log info to console
514 echo "Starting the deployment on virtual environment using $INSTALLER. This could take some time..."
515 echo "--------------------------------------------------------"
518 ssh -o BatchMode=yes -o TCPKeepAlive=yes cideploy@10.118.34.205 ./cideploy.sh
521 echo "--------------------------------------------------------"
525 name: 'fuel-upload-artifact'
533 # log info to console
534 echo "Uploading the $INSTALLER artifact. This could take some time..."
535 echo "--------------------------------------------------------"
538 # source the opnfv.properties to get ARTIFACT_VERSION
539 source $WORKSPACE/opnfv.properties
541 # upload artifact and additional files to google storage
542 gsutil cp $BUILD_DIRECTORY/opnfv-$OPNFV_ARTIFACT_VERSION.iso gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso > gsutil.iso.log 2>&1
543 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.properties > gsutil.properties.log 2>&1
544 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/latest.properties > gsutil.latest.log 2>&1
547 echo "--------------------------------------------------------"
549 echo "Artifact is available as http://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
552 name: 'fuel-download-artifact'
560 # get the latest.properties file in order to get info regarding latest artifact
561 curl -s -o $WORKSPACE/latest.properties http://$GS_URL/latest.properties
563 # check if we got the file
564 [[ -f latest.properties ]] || exit 1
566 # source the file so we get OPNFV vars
567 source latest.properties
569 # log info to console
570 echo "Downloading the $INSTALLER artifact using URL http://$OPNFV_ARTIFACT_URL"
571 echo "This could take some time..."
572 echo "--------------------------------------------------------"
576 curl -s -o $WORKSPACE/opnfv.iso http://$OPNFV_ARTIFACT_URL > gsutil.iso.log 2>&1
579 ls -al $WORKSPACE/opnfv.iso
582 echo "--------------------------------------------------------"
586 name: 'fuel-workspace-cleanup'
594 # delete everything that is in $WORKSPACE
595 /bin/rm -rf $WORKSPACE
598 name: 'fuel-lab-reconfig'
606 # check to see if ucs login info file exists
607 if [ -e ~/.ssh/ucs_creds ];then
608 source ~/.ssh/ucs_creds
610 echo "Unable to find UCS credentials for LF lab reconfiguration...Exiting"
615 echo "Cloning releng repo..."
616 if ! GIT_SSL_NO_VERIFY=true git clone https://gerrit.opnfv.org/gerrit/releng; then
617 echo "Unable to clone releng repo...Exiting"
621 # log info to console
622 echo "Starting the lab reconfiguration for $INSTALLER..."
623 echo "--------------------------------------------------------"
627 $WORKSPACE/releng/utils/lab-reconfiguration/create_venv.sh
629 # disable nounset because 'activate' script contains unbound variable(s)
632 source $WORKSPACE/releng/utils/lab-reconfiguration/venv/bin/activate
633 # set nounset back again
636 # verify we are in venv
637 if [[ ! $(which python | grep venv) ]]; then
638 echo "Unable to activate venv...Exiting"
642 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
644 # while undergoing reboot
647 # check to see if slave is back up
650 while [ "$ping_counter" -lt 20 ]; do
651 if [[ $(ping -c 5 172.30.10.72) ]]; then
659 if [ "$ping_flag" -eq 1 ]; then
660 echo "Slave is pingable, now wait 180 seconds for services to start"
663 echo "Slave did not come back up after reboot: please check opnfv-jump-2"
671 echo "--------------------------------------------------------"
674 ########################
676 ########################
678 name: 'genesis-fuel-master-trigger'
683 name: 'genesis-fuel-stable-arno-trigger'