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'
341 recipients: jonas.bjurel@ericsson.com stefan.k.berg@ericsson.com
344 name: 'genesis-fuel-deploy-{stream}'
346 project-type: freestyle
356 installer: '{installer}'
357 gs-pathname: '{gs-pathname}'
360 default: ssh://gerrit.opnfv.org:29418/$PROJECT
361 description: "POD2 has some issues with cloning using https so that's why GIT_BASE is overriden here again."
365 credentials-id: '{ssh-credentials}'
372 artifactDaysToKeep: -1
373 artifactNumToKeep: -1
376 - 'fuel-download-artifact'
381 recipients: jonas.bjurel@ericsson.com stefan.k.berg@ericsson.com
384 name: 'genesis-fuel-lab-reconfig-{stream}'
386 project-type: freestyle
395 artifactDaysToKeep: -1
396 artifactNumToKeep: -1
402 installer: '{installer}'
403 gs-pathname: '{gs-pathname}'
406 default: ssh://gerrit.opnfv.org:29418/$PROJECT
407 description: "Used for overriding the GIT URL coming from parameters macro."
411 credentials-id: '{ssh-credentials}'
417 use-build-blocker: true
419 - "genesis-foreman-daily.*"
422 - 'fuel-lab-reconfig'
425 name: 'genesis-fuel-verify-deploy-virtual-{stream}'
427 project-type: freestyle
437 installer: '{installer}'
442 credentials-id: '{ssh-credentials}'
449 artifactDaysToKeep: -1
450 artifactNumToKeep: -1
453 - 'fuel-deploy-virtual'
455 ########################
457 ########################
463 default: '{installer}'
464 description: "Installer to use."
466 name: BUILD_DIRECTORY
467 default: $WORKSPACE/build_output
468 description: "Directory where the build artifact will be located upon the completion of the build."
470 name: CACHE_DIRECTORY
471 default: $HOME/opnfv/cache/genesis-$INSTALLER
472 description: "Directory where the cache to be used during the build is located."
475 default: https://gerrit.opnfv.org/gerrit/$PROJECT
476 description: "Used for overriding the GIT URL coming from Global Jenkins configuration in case if the stuff is done on none-LF HW."
479 default: artifacts.opnfv.org/$PROJECT/$INSTALLER{gs-pathname}
480 description: "URL to Google Storage."
482 ########################
484 ########################
494 # log info to console
495 echo "Starting the build of $INSTALLER. This could take some time..."
496 echo "--------------------------------------------------------"
499 # create the cache directory if it doesn't exist
500 [[ -d $CACHE_DIRECTORY ]] || mkdir -p $CACHE_DIRECTORY
502 # set OPNFV_ARTIFACT_VERSION
503 export OPNFV_ARTIFACT_VERSION=$(date -u +"%Y-%m-%d_%H-%M-%S")
506 cd $WORKSPACE/$INSTALLER/ci
507 ./build.sh -v $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY $BUILD_DIRECTORY
509 # list the build artifacts
510 ls -al $BUILD_DIRECTORY
512 # save information regarding artifact into file
514 echo "OPNFV_ARTIFACT_VERSION=$OPNFV_ARTIFACT_VERSION"
515 echo "OPNFV_GIT_URL=$(git config --get remote.origin.url)"
516 echo "OPNFV_GIT_SHA1=$(git rev-parse HEAD)"
517 echo "OPNFV_ARTIFACT_URL=$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
518 echo "OPNFV_ARTIFACT_MD5SUM=$(md5sum $BUILD_DIRECTORY/opnfv-$OPNFV_ARTIFACT_VERSION.iso | cut -d' ' -f1)"
519 echo "OPNFV_BUILD_URL=$BUILD_URL"
520 ) > $WORKSPACE/opnfv.properties
523 echo "--------------------------------------------------------"
535 # source the file so we get OPNFV vars
536 source latest.properties
538 # echo the info about artifact that is used during the deployment
539 echo "Using $(echo $OPNFV_ARTIFACT_URL | cut -d'/' -f4) for deployment"
541 # create TMPDIR if it doesn't exist
542 export TMPDIR=$HOME/tmpdir
543 [[ -d $TMPDIR ]] || mkdir -p $TMPDIR
545 # change permissions down to TMPDIR
549 # set CONFDIR, BRIDGE
550 export CONFDIR=$WORKSPACE/fuel/deploy/templates/hardware_environment/old_conf/linux_foundation_lab/pod2/ha
554 sudo $WORKSPACE/common/ci/clean.sh -base_config $WORKSPACE/foreman/ci/inventory/lf_pod2_ksgen_settings.yml
556 # prepare for Fuel Deployment
557 sudo $WORKSPACE/common/ci/setup.sh
559 # log info to console
560 echo "Starting the deployment using $INSTALLER. This could take some time..."
561 echo "--------------------------------------------------------"
564 # start the deployment
565 echo "Issuing command"
566 echo "sudo $WORKSPACE/fuel/ci/deploy.sh -iso $WORKSPACE/opnfv.iso -dea $CONFDIR/dea.yaml -dha $CONFDIR/dha.yaml -s $TMPDIR -b $BRIDGE"
567 sudo $WORKSPACE/fuel/ci/deploy.sh -iso $WORKSPACE/opnfv.iso -dea $CONFDIR/dea.yaml -dha $CONFDIR/dha.yaml -s $TMPDIR -b $BRIDGE
570 echo "--------------------------------------------------------"
574 name: 'fuel-deploy-virtual'
582 # log info to console
583 echo "Starting the deployment on virtual environment using $INSTALLER. This could take some time..."
584 echo "--------------------------------------------------------"
587 ssh -o BatchMode=yes -o TCPKeepAlive=yes cideploy@10.118.34.205 ./cideploy.sh
590 echo "--------------------------------------------------------"
594 name: 'fuel-upload-artifact'
602 # log info to console
603 echo "Uploading the $INSTALLER artifact. This could take some time..."
604 echo "--------------------------------------------------------"
607 # source the opnfv.properties to get ARTIFACT_VERSION
608 source $WORKSPACE/opnfv.properties
610 # upload artifact and additional files to google storage
611 gsutil cp $BUILD_DIRECTORY/opnfv-$OPNFV_ARTIFACT_VERSION.iso gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso > gsutil.iso.log 2>&1
612 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.properties > gsutil.properties.log 2>&1
613 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/latest.properties > gsutil.latest.log 2>&1
616 echo "--------------------------------------------------------"
618 echo "Artifact is available as http://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
621 name: 'fuel-download-artifact'
629 # get the latest.properties file in order to get info regarding latest artifact
630 curl -s -o $WORKSPACE/latest.properties http://$GS_URL/latest.properties
632 # check if we got the file
633 [[ -f latest.properties ]] || exit 1
635 # source the file so we get OPNFV vars
636 source latest.properties
638 # log info to console
639 echo "Downloading the $INSTALLER artifact using URL http://$OPNFV_ARTIFACT_URL"
640 echo "This could take some time..."
641 echo "--------------------------------------------------------"
645 curl -s -o $WORKSPACE/opnfv.iso http://$OPNFV_ARTIFACT_URL > gsutil.iso.log 2>&1
648 ls -al $WORKSPACE/opnfv.iso
651 echo "--------------------------------------------------------"
655 name: 'fuel-workspace-cleanup'
663 # delete everything that is in $WORKSPACE
664 /bin/rm -rf $WORKSPACE
667 name: 'fuel-lab-reconfig'
675 # check to see if ucs login info file exists
676 if [ -e ~/.ssh/ucs_creds ];then
677 source ~/.ssh/ucs_creds
679 echo "Unable to find UCS credentials for LF lab reconfiguration...Exiting"
684 echo "Cloning releng repo..."
685 if ! GIT_SSL_NO_VERIFY=true git clone https://gerrit.opnfv.org/gerrit/releng; then
686 echo "Unable to clone releng repo...Exiting"
690 # log info to console
691 echo "Starting the lab reconfiguration for $INSTALLER..."
692 echo "--------------------------------------------------------"
696 $WORKSPACE/releng/utils/lab-reconfiguration/create_venv.sh
698 # disable nounset because 'activate' script contains unbound variable(s)
701 source $WORKSPACE/releng/utils/lab-reconfiguration/venv/bin/activate
702 # set nounset back again
705 # verify we are in venv
706 if [[ ! $(which python | grep venv) ]]; then
707 echo "Unable to activate venv...Exiting"
711 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
713 # while undergoing reboot
716 # check to see if slave is back up
719 while [ "$ping_counter" -lt 20 ]; do
720 if [[ $(ping -c 5 172.30.10.72) ]]; then
728 if [ "$ping_flag" -eq 1 ]; then
729 echo "Slave is pingable, now wait 180 seconds for services to start"
732 echo "Slave did not come back up after reboot: please check opnfv-jump-2"
740 echo "--------------------------------------------------------"
743 ########################
745 ########################
752 name: 'fuel-stable-arno'