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'
377 - 'fuel-odl-plugin-build'
382 recipients: jonas.bjurel@ericsson.com stefan.k.berg@ericsson.com
385 name: 'genesis-fuel-lab-reconfig-{stream}'
387 project-type: freestyle
396 artifactDaysToKeep: -1
397 artifactNumToKeep: -1
403 installer: '{installer}'
404 gs-pathname: '{gs-pathname}'
407 default: ssh://gerrit.opnfv.org:29418/$PROJECT
408 description: "Used for overriding the GIT URL coming from parameters macro."
412 credentials-id: '{ssh-credentials}'
418 use-build-blocker: true
420 - "genesis-foreman-daily.*"
423 - 'fuel-lab-reconfig'
426 name: 'genesis-fuel-verify-deploy-virtual-{stream}'
428 project-type: freestyle
438 installer: '{installer}'
443 credentials-id: '{ssh-credentials}'
450 artifactDaysToKeep: -1
451 artifactNumToKeep: -1
454 - 'fuel-deploy-virtual'
456 ########################
458 ########################
464 default: '{installer}'
465 description: "Installer to use."
467 name: BUILD_DIRECTORY
468 default: $WORKSPACE/build_output
469 description: "Directory where the build artifact will be located upon the completion of the build."
471 name: CACHE_DIRECTORY
472 default: $HOME/opnfv/cache/genesis-$INSTALLER
473 description: "Directory where the cache to be used during the build is located."
476 default: https://gerrit.opnfv.org/gerrit/$PROJECT
477 description: "Used for overriding the GIT URL coming from Global Jenkins configuration in case if the stuff is done on none-LF HW."
480 default: artifacts.opnfv.org/$PROJECT/$INSTALLER{gs-pathname}
481 description: "URL to Google Storage."
483 ########################
485 ########################
495 # log info to console
496 echo "Starting the build of $INSTALLER. This could take some time..."
497 echo "--------------------------------------------------------"
500 # create the cache directory if it doesn't exist
501 [[ -d $CACHE_DIRECTORY ]] || mkdir -p $CACHE_DIRECTORY
503 # set OPNFV_ARTIFACT_VERSION
504 export OPNFV_ARTIFACT_VERSION=$(date -u +"%Y-%m-%d_%H-%M-%S")
507 cd $WORKSPACE/$INSTALLER/ci
508 ./build.sh -v $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY $BUILD_DIRECTORY
510 # list the build artifacts
511 ls -al $BUILD_DIRECTORY
513 # save information regarding artifact into file
515 echo "OPNFV_ARTIFACT_VERSION=$OPNFV_ARTIFACT_VERSION"
516 echo "OPNFV_GIT_URL=$(git config --get remote.origin.url)"
517 echo "OPNFV_GIT_SHA1=$(git rev-parse HEAD)"
518 echo "OPNFV_ARTIFACT_URL=$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
519 echo "OPNFV_ARTIFACT_MD5SUM=$(md5sum $BUILD_DIRECTORY/opnfv-$OPNFV_ARTIFACT_VERSION.iso | cut -d' ' -f1)"
520 echo "OPNFV_BUILD_URL=$BUILD_URL"
521 ) > $WORKSPACE/opnfv.properties
524 echo "--------------------------------------------------------"
528 name: 'fuel-odl-plugin-build'
536 # install dependencies if they are not available already
537 if [[ ! $(rpm -qa | grep rubygems) ]]; then
538 echo "Rubygems not found, but required for Fuel Plugin build ... attempting to install"
539 sudo yum install -y rubygems ruby-devel
542 if [[ ! $(gem list | grep fpm) ]]; then
543 echo "fpm gem not found, but required for Fuel Plugin build ... attempting to install"
547 if [[ ! $(pip list | grep fuel-plugin-builder) ]]; then
548 echo "fuel-plugin-builder not found, but required for Fuel Plugin build ... attempting to install"
549 sudo pip install fuel-plugin-builder
552 # log info to console
553 echo "Starting the build of Fuel Opendaylight Plugin. This could take some time..."
554 echo "--------------------------------------------------------"
557 export ODL_PLUGIN_BRANCH="juno/lithium-sr1"
560 git clone https://github.com/stackforge/fuel-plugin-opendaylight
562 pushd $WORKSPACE/fuel-plugin-opendaylight
563 git checkout $ODL_PLUGIN_BRANCH
566 fpb --build fuel-plugin-opendaylight/
569 echo "--------------------------------------------------------"
581 # source the file so we get OPNFV vars
582 source latest.properties
584 # echo the info about artifact that is used during the deployment
585 echo "Using $(echo $OPNFV_ARTIFACT_URL | cut -d'/' -f4) for deployment"
587 # create TMPDIR if it doesn't exist
588 export TMPDIR=$HOME/tmpdir
589 [[ -d $TMPDIR ]] || mkdir -p $TMPDIR
591 # change permissions down to TMPDIR
595 # set CONFDIR, BRIDGE
596 export CONFDIR=$WORKSPACE/fuel/deploy/templates/hardware_environment/conf/linux_foundation_lab/pod2
598 export PLUGIN=$WORKSPACE/fuel-plugin-opendaylight
601 sudo $WORKSPACE/common/ci/clean.sh -base_config $WORKSPACE/foreman/ci/inventory/lf_pod2_ksgen_settings.yml
603 # prepare for Fuel Deployment
604 sudo $WORKSPACE/common/ci/setup.sh
606 # log info to console
607 echo "Starting the deployment using $INSTALLER. This could take some time..."
608 echo "--------------------------------------------------------"
611 # start the deployment
612 echo "Issuing command"
613 echo "sudo $WORKSPACE/fuel/ci/deploy.sh -iso $WORKSPACE/opnfv.iso -dea $CONFDIR/dea.yaml -dha $CONFDIR/dha.yaml -s $TMPDIR -b $BRIDGE -p $PLUGIN -nh"
614 sudo $WORKSPACE/fuel/ci/deploy.sh -iso $WORKSPACE/opnfv.iso -dea $CONFDIR/dea.yaml -dha $CONFDIR/dha.yaml -s $TMPDIR -b $BRIDGE -p $PLUGIN -nh
617 echo "--------------------------------------------------------"
621 name: 'fuel-deploy-virtual'
629 # log info to console
630 echo "Starting the deployment on virtual environment using $INSTALLER. This could take some time..."
631 echo "--------------------------------------------------------"
634 ssh -o BatchMode=yes -o TCPKeepAlive=yes cideploy@10.118.34.205 ./cideploy.sh
637 echo "--------------------------------------------------------"
641 name: 'fuel-upload-artifact'
649 # log info to console
650 echo "Uploading the $INSTALLER artifact. This could take some time..."
651 echo "--------------------------------------------------------"
654 # source the opnfv.properties to get ARTIFACT_VERSION
655 source $WORKSPACE/opnfv.properties
657 # upload artifact and additional files to google storage
658 gsutil cp $BUILD_DIRECTORY/opnfv-$OPNFV_ARTIFACT_VERSION.iso gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso > gsutil.iso.log 2>&1
659 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.properties > gsutil.properties.log 2>&1
660 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/latest.properties > gsutil.latest.log 2>&1
663 echo "--------------------------------------------------------"
665 echo "Artifact is available as http://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
668 name: 'fuel-download-artifact'
676 # get the latest.properties file in order to get info regarding latest artifact
677 curl -s -o $WORKSPACE/latest.properties http://$GS_URL/latest.properties
679 # check if we got the file
680 [[ -f latest.properties ]] || exit 1
682 # source the file so we get OPNFV vars
683 source latest.properties
685 # log info to console
686 echo "Downloading the $INSTALLER artifact using URL http://$OPNFV_ARTIFACT_URL"
687 echo "This could take some time..."
688 echo "--------------------------------------------------------"
692 curl -s -o $WORKSPACE/opnfv.iso http://$OPNFV_ARTIFACT_URL > gsutil.iso.log 2>&1
695 ls -al $WORKSPACE/opnfv.iso
698 echo "--------------------------------------------------------"
702 name: 'fuel-workspace-cleanup'
710 # delete everything that is in $WORKSPACE
711 /bin/rm -rf $WORKSPACE
714 name: 'fuel-lab-reconfig'
722 # check to see if ucs login info file exists
723 if [ -e ~/.ssh/ucs_creds ];then
724 source ~/.ssh/ucs_creds
726 echo "Unable to find UCS credentials for LF lab reconfiguration...Exiting"
731 echo "Cloning releng repo..."
732 if ! GIT_SSL_NO_VERIFY=true git clone https://gerrit.opnfv.org/gerrit/releng; then
733 echo "Unable to clone releng repo...Exiting"
737 # log info to console
738 echo "Starting the lab reconfiguration for $INSTALLER..."
739 echo "--------------------------------------------------------"
743 $WORKSPACE/releng/utils/lab-reconfiguration/create_venv.sh
745 # disable nounset because 'activate' script contains unbound variable(s)
748 source $WORKSPACE/releng/utils/lab-reconfiguration/venv/bin/activate
749 # set nounset back again
752 # verify we are in venv
753 if [[ ! $(which python | grep venv) ]]; then
754 echo "Unable to activate venv...Exiting"
758 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
760 # while undergoing reboot
763 # check to see if slave is back up
766 while [ "$ping_counter" -lt 20 ]; do
767 if [[ $(ping -c 5 172.30.10.72) ]]; then
775 if [ "$ping_flag" -eq 1 ]; then
776 echo "Slave is pingable, now wait 180 seconds for services to start"
779 echo "Slave did not come back up after reboot: please check opnfv-jump-2"
787 echo "--------------------------------------------------------"
790 ########################
792 ########################
799 name: 'fuel-stable-arno'