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}'
57 - genesis-fuel-parameter:
58 installer: '{installer}'
59 gs-pathname: '{gs-pathname}'
63 credentials-id: '{ssh-credentials}'
64 refspec: '$GERRIT_REFSPEC'
65 choosing-strategy: 'gerrit'
70 - patchset-created-event:
71 exclude-drafts: 'false'
72 exclude-trivial-rebase: 'false'
73 exclude-no-code-change: 'false'
74 - draft-published-event
75 - comment-added-contains-event:
76 comment-contains-value: 'recheck'
77 - comment-added-contains-event:
78 comment-contains-value: 'reverify'
80 - project-compare-type: 'ANT'
81 project-pattern: 'genesis'
83 - branch-compare-type: 'ANT'
84 branch-pattern: '**/{branch}'
87 pattern: 'common/ci/**'
89 pattern: 'common/manifests/**'
91 pattern: 'common/puppet-opnfv/**'
93 pattern: 'common/tools/**'
95 pattern: '{installer}/build/**'
97 pattern: '{installer}/ci/**'
99 pattern: '{installer}/deploy/**'
101 pattern: '{installer}/include/**'
103 pattern: '{installer}/prototypes/**'
104 forbidden-file-paths:
106 pattern: 'common/docs/**'
108 pattern: '{installer}/docs/**'
112 - 'fuel-workspace-cleanup'
115 name: 'genesis-fuel-merge-{stream}'
133 - genesis-fuel-parameter:
134 installer: '{installer}'
138 - gerrit-trigger-scm:
139 credentials-id: '{ssh-credentials}'
141 choosing-strategy: 'default'
146 - change-merged-event
147 - comment-added-contains-event:
148 comment-contains-value: 'remerge'
150 - project-compare-type: 'ANT'
151 project-pattern: 'genesis'
153 - branch-compare-type: 'ANT'
154 branch-pattern: '**/{branch}'
157 pattern: 'common/ci/**'
159 pattern: 'common/manifests/**'
161 pattern: 'common/puppet-opnfv/**'
163 pattern: 'common/tools/**'
165 pattern: '{installer}/build/**'
167 pattern: '{installer}/ci/**'
169 pattern: '{installer}/deploy/**'
171 pattern: '{installer}/include/**'
173 pattern: '{installer}/prototypes/**'
174 forbidden-file-paths:
176 pattern: 'common/docs/**'
178 pattern: '{installer}/docs/**'
182 - 'fuel-workspace-cleanup'
185 name: 'genesis-fuel-daily-{stream}'
192 - 'genesis-fuel-{stream}-trigger'
197 - genesis-fuel-parameter:
198 installer: '{installer}'
199 gs-pathname: '{gs-pathname}'
203 credentials-id: '{ssh-credentials}'
209 - project: 'genesis-fuel-build-{stream}'
213 - project: 'genesis-fuel-lab-reconfig-{stream}'
217 - project: 'genesis-fuel-deploy-{stream}'
221 - project: 'functest-fuel-{stream}'
224 build-step-failure-threshold: 'never'
225 failure-threshold: 'never'
226 unstable-threshold: 'FAILURE'
228 # - project: 'yardstick-fuel-{stream}'
231 # build-step-failure-threshold: 'never'
232 # failure-threshold: 'never'
233 # unstable-threshold: 'FAILURE'
236 - trigger-parameterized-builds:
237 - project: 'genesis-foreman-daily-{stream}'
238 trigger-with-no-params: true
241 name: 'genesis-fuel-deploy-runner-{stream}'
248 - genesis-fuel-parameter:
249 installer: '{installer}'
250 gs-pathname: '{gs-pathname}'
253 default: ssh://gerrit.opnfv.org:29418/$PROJECT
254 description: "Used for overriding the GIT URL coming from parameters macro."
258 credentials-id: '{ssh-credentials}'
264 use-build-blocker: true
266 - "genesis-foreman-daily.*"
267 - "genesis-foreman-deploy-runner-{stream}"
268 - "genesis-fuel-daily.*"
271 - 'fuel-lab-reconfig'
273 - project: 'genesis-fuel-deploy-{stream}'
278 name: 'genesis-fuel-build-{stream}'
287 - genesis-fuel-parameter:
288 installer: '{installer}'
289 gs-pathname: '{gs-pathname}'
293 credentials-id: '{ssh-credentials}'
299 - 'fuel-upload-artifact'
300 - 'fuel-workspace-cleanup'
304 recipients: jonas.bjurel@ericsson.com stefan.k.berg@ericsson.com
307 name: 'genesis-fuel-deploy-{stream}'
316 - genesis-fuel-parameter:
317 installer: '{installer}'
318 gs-pathname: '{gs-pathname}'
321 default: ssh://gerrit.opnfv.org:29418/$PROJECT
322 description: "POD2 has some issues with cloning using https so that's why GIT_BASE is overriden here again."
326 credentials-id: '{ssh-credentials}'
331 - 'fuel-download-artifact'
336 recipients: jonas.bjurel@ericsson.com stefan.k.berg@ericsson.com
339 name: 'genesis-fuel-lab-reconfig-{stream}'
346 - genesis-fuel-parameter:
347 installer: '{installer}'
348 gs-pathname: '{gs-pathname}'
351 default: ssh://gerrit.opnfv.org:29418/$PROJECT
352 description: "Used for overriding the GIT URL coming from parameters macro."
356 credentials-id: '{ssh-credentials}'
362 use-build-blocker: true
364 - "genesis-foreman-daily.*"
367 - 'fuel-lab-reconfig'
370 name: 'genesis-fuel-verify-deploy-virtual-{stream}'
379 - genesis-fuel-parameter:
380 installer: '{installer}'
385 credentials-id: '{ssh-credentials}'
390 - 'fuel-deploy-virtual'
392 ########################
394 ########################
396 name: genesis-fuel-parameter
400 default: '{installer}'
401 description: "Installer to use."
403 name: BUILD_DIRECTORY
404 default: $WORKSPACE/build_output
405 description: "Directory where the build artifact will be located upon the completion of the build."
407 name: CACHE_DIRECTORY
408 default: $HOME/opnfv/cache/genesis-$INSTALLER
409 description: "Directory where the cache to be used during the build is located."
412 default: https://gerrit.opnfv.org/gerrit/$PROJECT
413 description: "Used for overriding the GIT URL coming from Global Jenkins configuration in case if the stuff is done on none-LF HW."
416 default: artifacts.opnfv.org/$PROJECT/$INSTALLER{gs-pathname}
417 description: "URL to Google Storage."
419 ########################
421 ########################
431 # log info to console
432 echo "Starting the build of $INSTALLER. This could take some time..."
433 echo "--------------------------------------------------------"
436 # create the cache directory if it doesn't exist
437 [[ -d $CACHE_DIRECTORY ]] || mkdir -p $CACHE_DIRECTORY
439 # set OPNFV_ARTIFACT_VERSION
440 export OPNFV_ARTIFACT_VERSION=$(date -u +"%Y-%m-%d_%H-%M-%S")
443 cd $WORKSPACE/$INSTALLER/ci
444 ./build.sh -v $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY $BUILD_DIRECTORY
446 # list the build artifacts
447 ls -al $BUILD_DIRECTORY
449 # save information regarding artifact into file
451 echo "OPNFV_ARTIFACT_VERSION=$OPNFV_ARTIFACT_VERSION"
452 echo "OPNFV_GIT_URL=$(git config --get remote.origin.url)"
453 echo "OPNFV_GIT_SHA1=$(git rev-parse HEAD)"
454 echo "OPNFV_ARTIFACT_URL=$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
455 echo "OPNFV_ARTIFACT_MD5SUM=$(md5sum $BUILD_DIRECTORY/opnfv-$OPNFV_ARTIFACT_VERSION.iso | cut -d' ' -f1)"
456 echo "OPNFV_BUILD_URL=$BUILD_URL"
457 ) > $WORKSPACE/opnfv.properties
460 echo "--------------------------------------------------------"
472 # source the file so we get OPNFV vars
473 source latest.properties
475 # echo the info about artifact that is used during the deployment
476 echo "Using $(echo $OPNFV_ARTIFACT_URL | cut -d'/' -f4) for deployment"
478 # create TMPDIR if it doesn't exist
479 export TMPDIR=$HOME/tmpdir
480 [[ -d $TMPDIR ]] || mkdir -p $TMPDIR
482 # change permissions down to TMPDIR
486 # set CONFDIR, BRIDGE
487 export CONFDIR=$WORKSPACE/fuel/deploy/templates/hardware_environment/conf/linux_foundation_lab/pod2
491 sudo $WORKSPACE/common/ci/clean.sh -base_config $WORKSPACE/foreman/ci/inventory/lf_pod2_ksgen_settings.yml
493 # prepare for Fuel Deployment
494 sudo $WORKSPACE/common/ci/setup.sh
496 # log info to console
497 echo "Starting the deployment using $INSTALLER. This could take some time..."
498 echo "--------------------------------------------------------"
501 # start the deployment
502 echo "Issuing command"
503 echo "sudo $WORKSPACE/fuel/ci/deploy.sh -iso $WORKSPACE/opnfv.iso -dea $CONFDIR/dea.yaml -dha $CONFDIR/dha.yaml -s $TMPDIR -b $BRIDGE -nh"
504 sudo $WORKSPACE/fuel/ci/deploy.sh -iso $WORKSPACE/opnfv.iso -dea $CONFDIR/dea.yaml -dha $CONFDIR/dha.yaml -s $TMPDIR -b $BRIDGE -nh
507 echo "--------------------------------------------------------"
511 name: 'fuel-deploy-virtual'
519 # log info to console
520 echo "Starting the deployment on virtual environment using $INSTALLER. This could take some time..."
521 echo "--------------------------------------------------------"
524 ssh -o BatchMode=yes -o TCPKeepAlive=yes cideploy@10.118.34.205 ./cideploy.sh
527 echo "--------------------------------------------------------"
531 name: 'fuel-upload-artifact'
539 # log info to console
540 echo "Uploading the $INSTALLER artifact. This could take some time..."
541 echo "--------------------------------------------------------"
544 # source the opnfv.properties to get ARTIFACT_VERSION
545 source $WORKSPACE/opnfv.properties
547 # upload artifact and additional files to google storage
548 gsutil cp $BUILD_DIRECTORY/opnfv-$OPNFV_ARTIFACT_VERSION.iso gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso > gsutil.iso.log 2>&1
549 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.properties > gsutil.properties.log 2>&1
550 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/latest.properties > gsutil.latest.log 2>&1
553 echo "--------------------------------------------------------"
555 echo "Artifact is available as http://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
558 name: 'fuel-download-artifact'
566 # get the latest.properties file in order to get info regarding latest artifact
567 curl -s -o $WORKSPACE/latest.properties http://$GS_URL/latest.properties
569 # check if we got the file
570 [[ -f latest.properties ]] || exit 1
572 # source the file so we get OPNFV vars
573 source latest.properties
575 # log info to console
576 echo "Downloading the $INSTALLER artifact using URL http://$OPNFV_ARTIFACT_URL"
577 echo "This could take some time..."
578 echo "--------------------------------------------------------"
582 curl -s -o $WORKSPACE/opnfv.iso http://$OPNFV_ARTIFACT_URL > gsutil.iso.log 2>&1
585 ls -al $WORKSPACE/opnfv.iso
588 echo "--------------------------------------------------------"
592 name: 'fuel-workspace-cleanup'
600 # delete everything that is in $WORKSPACE
601 /bin/rm -rf $WORKSPACE
604 name: 'fuel-lab-reconfig'
612 # check to see if ucs login info file exists
613 if [ -e ~/.ssh/ucs_creds ];then
614 source ~/.ssh/ucs_creds
616 echo "Unable to find UCS credentials for LF lab reconfiguration...Exiting"
621 echo "Cloning releng repo..."
622 if ! GIT_SSL_NO_VERIFY=true git clone https://gerrit.opnfv.org/gerrit/releng; then
623 echo "Unable to clone releng repo...Exiting"
627 # log info to console
628 echo "Starting the lab reconfiguration for $INSTALLER..."
629 echo "--------------------------------------------------------"
633 $WORKSPACE/releng/utils/lab-reconfiguration/create_venv.sh
635 # disable nounset because 'activate' script contains unbound variable(s)
638 source $WORKSPACE/releng/utils/lab-reconfiguration/venv/bin/activate
639 # set nounset back again
642 # verify we are in venv
643 if [[ ! $(which python | grep venv) ]]; then
644 echo "Unable to activate venv...Exiting"
648 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
650 # while undergoing reboot
653 # check to see if slave is back up
656 while [ "$ping_counter" -lt 20 ]; do
657 if [[ $(ping -c 5 172.30.10.72) ]]; then
665 if [ "$ping_flag" -eq 1 ]; then
666 echo "Slave is pingable, now wait 180 seconds for services to start"
669 echo "Slave did not come back up after reboot: please check opnfv-jump-2"
677 echo "--------------------------------------------------------"
680 ########################
682 ########################
684 name: 'genesis-fuel-master-trigger'
689 name: 'genesis-fuel-stable-arno-trigger'