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}'
95 pattern: 'common/ci/**'
97 pattern: 'common/manifests/**'
99 pattern: 'common/puppet-opnfv/**'
101 pattern: 'common/tools/**'
103 pattern: '{installer}/build/**'
105 pattern: '{installer}/ci/**'
107 pattern: '{installer}/deploy/**'
109 pattern: '{installer}/include/**'
111 pattern: '{installer}/prototypes/**'
112 forbidden-file-paths:
114 pattern: 'common/docs/**'
116 pattern: '{installer}/docs/**'
120 - 'fuel-workspace-cleanup'
123 name: 'genesis-fuel-merge-{stream}'
125 project-type: freestyle
139 artifactDaysToKeep: -1
148 installer: '{installer}'
152 - gerrit-trigger-scm:
153 credentials-id: '{ssh-credentials}'
155 choosing-strategy: 'default'
158 - ssh-agent-credentials:
159 user: '{ssh-credentials}'
164 - change-merged-event
165 - comment-added-contains-event:
166 comment-contains-value: 'remerge'
168 - project-compare-type: 'ANT'
169 project-pattern: 'genesis'
171 - branch-compare-type: 'ANT'
172 branch-pattern: '**/{branch}'
175 pattern: 'common/ci/**'
177 pattern: 'common/manifests/**'
179 pattern: 'common/puppet-opnfv/**'
181 pattern: 'common/tools/**'
183 pattern: '{installer}/build/**'
185 pattern: '{installer}/ci/**'
187 pattern: '{installer}/deploy/**'
189 pattern: '{installer}/include/**'
191 pattern: '{installer}/prototypes/**'
192 forbidden-file-paths:
194 pattern: 'common/docs/**'
196 pattern: '{installer}/docs/**'
200 - 'fuel-workspace-cleanup'
203 name: 'genesis-fuel-daily-{stream}'
205 project-type: freestyle
218 installer: '{installer}'
219 gs-pathname: '{gs-pathname}'
223 credentials-id: '{ssh-credentials}'
230 artifactDaysToKeep: -1
231 artifactNumToKeep: -1
235 - project: 'genesis-fuel-build-{stream}'
239 - project: 'genesis-fuel-lab-reconfig-{stream}'
243 - project: 'genesis-fuel-deploy-{stream}'
247 - project: 'functest-fuel-{stream}'
250 build-step-failure-threshold: 'never'
251 failure-threshold: 'never'
252 unstable-threshold: 'FAILURE'
254 - project: 'yardstick-fuel-{stream}'
257 build-step-failure-threshold: 'never'
258 failure-threshold: 'never'
259 unstable-threshold: 'FAILURE'
262 name: 'genesis-fuel-deploy-runner-{stream}'
264 project-type: freestyle
273 artifactDaysToKeep: -1
274 artifactNumToKeep: -1
280 installer: '{installer}'
281 gs-pathname: '{gs-pathname}'
284 default: ssh://gerrit.opnfv.org:29418/$PROJECT
285 description: "Used for overriding the GIT URL coming from parameters macro."
289 credentials-id: '{ssh-credentials}'
295 use-build-blocker: true
297 - "genesis-foreman-daily.*"
298 - "genesis-foreman-deploy-runner-{stream}"
299 - "genesis-fuel-daily.*"
302 - 'fuel-lab-reconfig'
304 - project: 'genesis-fuel-deploy-{stream}'
309 name: 'genesis-fuel-build-{stream}'
311 project-type: freestyle
318 artifactDaysToKeep: -1
319 artifactNumToKeep: -1
325 installer: '{installer}'
326 gs-pathname: '{gs-pathname}'
330 credentials-id: '{ssh-credentials}'
336 - 'fuel-upload-artifact'
337 - 'fuel-workspace-cleanup'
340 name: 'genesis-fuel-deploy-{stream}'
342 project-type: freestyle
352 installer: '{installer}'
353 gs-pathname: '{gs-pathname}'
356 default: ssh://gerrit.opnfv.org:29418/$PROJECT
357 description: "POD2 has some issues with cloning using https so that's why GIT_BASE is overriden here again."
361 credentials-id: '{ssh-credentials}'
368 artifactDaysToKeep: -1
369 artifactNumToKeep: -1
372 - 'fuel-download-artifact'
376 name: 'genesis-fuel-lab-reconfig-{stream}'
378 project-type: freestyle
387 artifactDaysToKeep: -1
388 artifactNumToKeep: -1
394 installer: '{installer}'
395 gs-pathname: '{gs-pathname}'
398 default: ssh://gerrit.opnfv.org:29418/$PROJECT
399 description: "Used for overriding the GIT URL coming from parameters macro."
403 credentials-id: '{ssh-credentials}'
409 use-build-blocker: true
411 - "genesis-foreman-daily.*"
414 - 'fuel-lab-reconfig'
417 name: 'genesis-fuel-verify-deploy-virtual-{stream}'
419 project-type: freestyle
429 installer: '{installer}'
434 credentials-id: '{ssh-credentials}'
441 artifactDaysToKeep: -1
442 artifactNumToKeep: -1
445 - 'fuel-deploy-virtual'
447 ########################
449 ########################
455 default: '{installer}'
456 description: "Installer to use."
458 name: BUILD_DIRECTORY
459 default: $WORKSPACE/build_output
460 description: "Directory where the build artifact will be located upon the completion of the build."
462 name: CACHE_DIRECTORY
463 default: $HOME/opnfv/cache/genesis-$INSTALLER
464 description: "Directory where the cache to be used during the build is located."
467 default: https://gerrit.opnfv.org/gerrit/$PROJECT
468 description: "Used for overriding the GIT URL coming from Global Jenkins configuration in case if the stuff is done on none-LF HW."
471 default: artifacts.opnfv.org/$PROJECT/$INSTALLER{gs-pathname}
472 description: "URL to Google Storage."
474 ########################
476 ########################
486 # log info to console
487 echo "Starting the build of $INSTALLER. This could take some time..."
488 echo "--------------------------------------------------------"
491 # create the cache directory if it doesn't exist
492 [[ -d $CACHE_DIRECTORY ]] || mkdir -p $CACHE_DIRECTORY
494 # set OPNFV_ARTIFACT_VERSION
495 export OPNFV_ARTIFACT_VERSION=$(date -u +"%Y-%m-%d_%H-%M-%S")
498 cd $WORKSPACE/$INSTALLER/ci
499 ./build.sh -v $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY $BUILD_DIRECTORY
501 # list the build artifacts
502 ls -al $BUILD_DIRECTORY
504 # save information regarding artifact into file
506 echo "OPNFV_ARTIFACT_VERSION=$OPNFV_ARTIFACT_VERSION"
507 echo "OPNFV_GIT_URL=$(git config --get remote.origin.url)"
508 echo "OPNFV_GIT_SHA1=$(git rev-parse HEAD)"
509 echo "OPNFV_ARTIFACT_URL=$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
510 echo "OPNFV_ARTIFACT_MD5SUM=$(md5sum $BUILD_DIRECTORY/opnfv-$OPNFV_ARTIFACT_VERSION.iso | cut -d' ' -f1)"
511 echo "OPNFV_BUILD_URL=$BUILD_URL"
512 ) > $WORKSPACE/opnfv.properties
515 echo "--------------------------------------------------------"
527 # source the file so we get OPNFV vars
528 source latest.properties
530 # echo the info about artifact that is used during the deployment
531 echo "Using $(echo $OPNFV_ARTIFACT_URL | cut -d'/' -f4) for deployment"
533 # create TMPDIR if it doesn't exist
534 export TMPDIR=$HOME/tmpdir
535 [[ -d $TMPDIR ]] || mkdir -p $TMPDIR
537 # change permissions down to TMPDIR
541 # set CONFDIR, BRIDGE
542 export CONFDIR=$WORKSPACE/fuel/deploy/baremetal/conf/linux_foundation_lab/pod2/ha
546 sudo $WORKSPACE/common/ci/clean.sh -base_config $WORKSPACE/foreman/ci/inventory/lf_pod2_ksgen_settings.yml
548 # prepare for Fuel Deployment
549 sudo $WORKSPACE/common/ci/setup.sh
551 # log info to console
552 echo "Starting the deployment using $INSTALLER. This could take some time..."
553 echo "--------------------------------------------------------"
556 # start the deployment
557 echo "Issuing command"
558 echo "sudo $WORKSPACE/fuel/ci/deploy.sh $WORKSPACE/opnfv.iso $CONFDIR/dea.yaml $CONFDIR/dha.yaml -s $TMPDIR -b $BRIDGE"
559 sudo $WORKSPACE/fuel/ci/deploy.sh $WORKSPACE/opnfv.iso $CONFDIR/dea.yaml $CONFDIR/dha.yaml -s $TMPDIR -b $BRIDGE
562 echo "--------------------------------------------------------"
566 name: 'fuel-deploy-virtual'
574 # log info to console
575 echo "Starting the deployment on virtual environment using $INSTALLER. This could take some time..."
576 echo "--------------------------------------------------------"
579 ssh -o BatchMode=yes -o TCPKeepAlive=yes cideploy@10.118.34.205 ./cideploy.sh
582 echo "--------------------------------------------------------"
586 name: 'fuel-upload-artifact'
594 # log info to console
595 echo "Uploading the $INSTALLER artifact. This could take some time..."
596 echo "--------------------------------------------------------"
599 # source the opnfv.properties to get ARTIFACT_VERSION
600 source $WORKSPACE/opnfv.properties
602 # upload artifact and additional files to google storage
603 gsutil cp $BUILD_DIRECTORY/opnfv-$OPNFV_ARTIFACT_VERSION.iso gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso > gsutil.iso.log 2>&1
604 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.properties > gsutil.properties.log 2>&1
605 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/latest.properties > gsutil.latest.log 2>&1
608 echo "--------------------------------------------------------"
610 echo "Artifact is available as http://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
613 name: 'fuel-download-artifact'
621 # get the latest.properties file in order to get info regarding latest artifact
622 curl -s -o $WORKSPACE/latest.properties http://$GS_URL/latest.properties
624 # check if we got the file
625 [[ -f latest.properties ]] || exit 1
627 # source the file so we get OPNFV vars
628 source latest.properties
630 # log info to console
631 echo "Downloading the $INSTALLER artifact using URL http://$OPNFV_ARTIFACT_URL"
632 echo "This could take some time..."
633 echo "--------------------------------------------------------"
637 curl -s -o $WORKSPACE/opnfv.iso http://$OPNFV_ARTIFACT_URL > gsutil.iso.log 2>&1
640 ls -al $WORKSPACE/opnfv.iso
643 echo "--------------------------------------------------------"
647 name: 'fuel-workspace-cleanup'
655 # delete everything that is in $WORKSPACE
656 /bin/rm -rf $WORKSPACE
659 name: 'fuel-lab-reconfig'
667 # check to see if ucs login info file exists
668 if [ -e ~/.ssh/ucs_creds ];then
669 source ~/.ssh/ucs_creds
671 echo "Unable to find UCS credentials for LF lab reconfiguration...Exiting"
676 echo "Cloning releng repo..."
677 if ! GIT_SSL_NO_VERIFY=true git clone https://gerrit.opnfv.org/gerrit/releng; then
678 echo "Unable to clone releng repo...Exiting"
682 # log info to console
683 echo "Starting the lab reconfiguration for $INSTALLER..."
684 echo "--------------------------------------------------------"
688 $WORKSPACE/releng/utils/lab-reconfiguration/create_venv.sh
690 # disable nounset because 'activate' script contains unbound variable(s)
693 source $WORKSPACE/releng/utils/lab-reconfiguration/venv/bin/activate
694 # set nounset back again
697 # verify we are in venv
698 if [[ ! $(which python | grep venv) ]]; then
699 echo "Unable to activate venv...Exiting"
703 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
705 # while undergoing reboot
708 # check to see if slave is back up
711 while [ "$ping_counter" -lt 20 ]; do
712 if [[ $(ping -c 5 172.30.10.72) ]]; then
720 if [ "$ping_flag" -eq 1 ]; then
721 echo "Slave is pingable, now wait 180 seconds for services to start"
724 echo "Slave did not come back up after reboot: please check opnfv-jump-2"
732 echo "--------------------------------------------------------"
735 ########################
737 ########################
744 name: 'fuel-stable-arno'