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}'
41 project-type: freestyle
55 artifactDaysToKeep: -1
64 installer: '{installer}'
65 gs-pathname: '{gs-pathname}'
69 credentials-id: '{ssh-credentials}'
70 refspec: '$GERRIT_REFSPEC'
71 choosing-strategy: 'gerrit'
74 - ssh-agent-credentials:
75 user: '{ssh-credentials}'
80 - patchset-created-event:
81 exclude-drafts: 'false'
82 exclude-trivial-rebase: 'false'
83 exclude-no-code-change: 'false'
84 - draft-published-event
85 - comment-added-contains-event:
86 comment-contains-value: 'recheck'
87 - comment-added-contains-event:
88 comment-contains-value: 'reverify'
90 - project-compare-type: 'ANT'
91 project-pattern: 'genesis'
93 - branch-compare-type: 'ANT'
94 branch-pattern: '**/{branch}'
97 pattern: 'common/ci/**'
99 pattern: 'common/manifests/**'
101 pattern: 'common/puppet-opnfv/**'
103 pattern: 'common/tools/**'
105 pattern: '{installer}/build/**'
107 pattern: '{installer}/ci/**'
109 pattern: '{installer}/deploy/**'
111 pattern: '{installer}/include/**'
113 pattern: '{installer}/prototypes/**'
114 forbidden-file-paths:
116 pattern: 'common/docs/**'
118 pattern: '{installer}/docs/**'
122 - 'fuel-workspace-cleanup'
125 name: 'genesis-fuel-merge-{stream}'
127 project-type: freestyle
141 artifactDaysToKeep: -1
150 installer: '{installer}'
154 - gerrit-trigger-scm:
155 credentials-id: '{ssh-credentials}'
157 choosing-strategy: 'default'
160 - ssh-agent-credentials:
161 user: '{ssh-credentials}'
166 - change-merged-event
167 - comment-added-contains-event:
168 comment-contains-value: 'remerge'
170 - project-compare-type: 'ANT'
171 project-pattern: 'genesis'
173 - branch-compare-type: 'ANT'
174 branch-pattern: '**/{branch}'
177 pattern: 'common/ci/**'
179 pattern: 'common/manifests/**'
181 pattern: 'common/puppet-opnfv/**'
183 pattern: 'common/tools/**'
185 pattern: '{installer}/build/**'
187 pattern: '{installer}/ci/**'
189 pattern: '{installer}/deploy/**'
191 pattern: '{installer}/include/**'
193 pattern: '{installer}/prototypes/**'
194 forbidden-file-paths:
196 pattern: 'common/docs/**'
198 pattern: '{installer}/docs/**'
202 - 'fuel-workspace-cleanup'
205 name: 'genesis-fuel-daily-{stream}'
207 project-type: freestyle
211 disabled: '{obj:disabled}'
220 installer: '{installer}'
221 gs-pathname: '{gs-pathname}'
225 credentials-id: '{ssh-credentials}'
232 artifactDaysToKeep: -1
233 artifactNumToKeep: -1
237 - project: 'genesis-fuel-build-{stream}'
241 - project: 'genesis-fuel-lab-reconfig-{stream}'
245 - project: 'genesis-fuel-deploy-{stream}'
249 - project: 'functest-fuel-{stream}'
252 build-step-failure-threshold: 'never'
253 failure-threshold: 'never'
254 unstable-threshold: 'FAILURE'
256 # - project: 'yardstick-fuel-{stream}'
259 # build-step-failure-threshold: 'never'
260 # failure-threshold: 'never'
261 # unstable-threshold: 'FAILURE'
264 name: 'genesis-fuel-deploy-runner-{stream}'
266 project-type: freestyle
275 artifactDaysToKeep: -1
276 artifactNumToKeep: -1
282 installer: '{installer}'
283 gs-pathname: '{gs-pathname}'
286 default: ssh://gerrit.opnfv.org:29418/$PROJECT
287 description: "Used for overriding the GIT URL coming from parameters macro."
291 credentials-id: '{ssh-credentials}'
297 use-build-blocker: true
299 - "genesis-foreman-daily.*"
300 - "genesis-foreman-deploy-runner-{stream}"
301 - "genesis-fuel-daily.*"
304 - 'fuel-lab-reconfig'
306 - project: 'genesis-fuel-deploy-{stream}'
311 name: 'genesis-fuel-build-{stream}'
313 project-type: freestyle
320 artifactDaysToKeep: -1
321 artifactNumToKeep: -1
327 installer: '{installer}'
328 gs-pathname: '{gs-pathname}'
332 credentials-id: '{ssh-credentials}'
338 - 'fuel-upload-artifact'
339 - 'fuel-workspace-cleanup'
343 recipients: jonas.bjurel@ericsson.com stefan.k.berg@ericsson.com
346 name: 'genesis-fuel-deploy-{stream}'
348 project-type: freestyle
358 installer: '{installer}'
359 gs-pathname: '{gs-pathname}'
362 default: ssh://gerrit.opnfv.org:29418/$PROJECT
363 description: "POD2 has some issues with cloning using https so that's why GIT_BASE is overriden here again."
367 credentials-id: '{ssh-credentials}'
374 artifactDaysToKeep: -1
375 artifactNumToKeep: -1
378 - 'fuel-download-artifact'
379 - 'fuel-odl-plugin-build'
384 recipients: jonas.bjurel@ericsson.com stefan.k.berg@ericsson.com
387 name: 'genesis-fuel-lab-reconfig-{stream}'
389 project-type: freestyle
398 artifactDaysToKeep: -1
399 artifactNumToKeep: -1
405 installer: '{installer}'
406 gs-pathname: '{gs-pathname}'
409 default: ssh://gerrit.opnfv.org:29418/$PROJECT
410 description: "Used for overriding the GIT URL coming from parameters macro."
414 credentials-id: '{ssh-credentials}'
420 use-build-blocker: true
422 - "genesis-foreman-daily.*"
425 - 'fuel-lab-reconfig'
428 name: 'genesis-fuel-verify-deploy-virtual-{stream}'
430 project-type: freestyle
440 installer: '{installer}'
445 credentials-id: '{ssh-credentials}'
452 artifactDaysToKeep: -1
453 artifactNumToKeep: -1
456 - 'fuel-deploy-virtual'
458 ########################
460 ########################
466 default: '{installer}'
467 description: "Installer to use."
469 name: BUILD_DIRECTORY
470 default: $WORKSPACE/build_output
471 description: "Directory where the build artifact will be located upon the completion of the build."
473 name: CACHE_DIRECTORY
474 default: $HOME/opnfv/cache/genesis-$INSTALLER
475 description: "Directory where the cache to be used during the build is located."
478 default: https://gerrit.opnfv.org/gerrit/$PROJECT
479 description: "Used for overriding the GIT URL coming from Global Jenkins configuration in case if the stuff is done on none-LF HW."
482 default: artifacts.opnfv.org/$PROJECT/$INSTALLER{gs-pathname}
483 description: "URL to Google Storage."
485 ########################
487 ########################
497 # log info to console
498 echo "Starting the build of $INSTALLER. This could take some time..."
499 echo "--------------------------------------------------------"
502 # create the cache directory if it doesn't exist
503 [[ -d $CACHE_DIRECTORY ]] || mkdir -p $CACHE_DIRECTORY
505 # set OPNFV_ARTIFACT_VERSION
506 export OPNFV_ARTIFACT_VERSION=$(date -u +"%Y-%m-%d_%H-%M-%S")
509 cd $WORKSPACE/$INSTALLER/ci
510 ./build.sh -v $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY $BUILD_DIRECTORY
512 # list the build artifacts
513 ls -al $BUILD_DIRECTORY
515 # save information regarding artifact into file
517 echo "OPNFV_ARTIFACT_VERSION=$OPNFV_ARTIFACT_VERSION"
518 echo "OPNFV_GIT_URL=$(git config --get remote.origin.url)"
519 echo "OPNFV_GIT_SHA1=$(git rev-parse HEAD)"
520 echo "OPNFV_ARTIFACT_URL=$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
521 echo "OPNFV_ARTIFACT_MD5SUM=$(md5sum $BUILD_DIRECTORY/opnfv-$OPNFV_ARTIFACT_VERSION.iso | cut -d' ' -f1)"
522 echo "OPNFV_BUILD_URL=$BUILD_URL"
523 ) > $WORKSPACE/opnfv.properties
526 echo "--------------------------------------------------------"
530 name: 'fuel-odl-plugin-build'
538 # install dependencies if they are not available already
539 if [[ ! $(rpm -qa | grep rubygems) ]]; then
540 echo "Rubygems not found, but required for Fuel Plugin build ... attempting to install"
541 sudo yum install -y rubygems ruby-devel
544 if [[ ! $(gem list | grep fpm) ]]; then
545 echo "fpm gem not found, but required for Fuel Plugin build ... attempting to install"
549 if [[ ! $(pip list | grep fuel-plugin-builder) ]]; then
550 echo "fuel-plugin-builder not found, but required for Fuel Plugin build ... attempting to install"
551 sudo pip install fuel-plugin-builder
554 # log info to console
555 echo "Starting the build of Fuel Opendaylight Plugin. This could take some time..."
556 echo "--------------------------------------------------------"
559 export ODL_PLUGIN_BRANCH="juno/lithium-sr1"
562 git clone https://github.com/stackforge/fuel-plugin-opendaylight
564 pushd $WORKSPACE/fuel-plugin-opendaylight
565 git checkout $ODL_PLUGIN_BRANCH
568 fpb --build fuel-plugin-opendaylight/
571 echo "--------------------------------------------------------"
583 # source the file so we get OPNFV vars
584 source latest.properties
586 # echo the info about artifact that is used during the deployment
587 echo "Using $(echo $OPNFV_ARTIFACT_URL | cut -d'/' -f4) for deployment"
589 # create TMPDIR if it doesn't exist
590 export TMPDIR=$HOME/tmpdir
591 [[ -d $TMPDIR ]] || mkdir -p $TMPDIR
593 # change permissions down to TMPDIR
597 # set CONFDIR, BRIDGE
598 export CONFDIR=$WORKSPACE/fuel/deploy/templates/hardware_environment/conf/linux_foundation_lab/pod2
600 export PLUGIN=$WORKSPACE/fuel-plugin-opendaylight
603 sudo $WORKSPACE/common/ci/clean.sh -base_config $WORKSPACE/foreman/ci/inventory/lf_pod2_ksgen_settings.yml
605 # prepare for Fuel Deployment
606 sudo $WORKSPACE/common/ci/setup.sh
608 # log info to console
609 echo "Starting the deployment using $INSTALLER. This could take some time..."
610 echo "--------------------------------------------------------"
613 # start the deployment
614 echo "Issuing command"
615 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"
616 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
619 echo "--------------------------------------------------------"
623 name: 'fuel-deploy-virtual'
631 # log info to console
632 echo "Starting the deployment on virtual environment using $INSTALLER. This could take some time..."
633 echo "--------------------------------------------------------"
636 ssh -o BatchMode=yes -o TCPKeepAlive=yes cideploy@10.118.34.205 ./cideploy.sh
639 echo "--------------------------------------------------------"
643 name: 'fuel-upload-artifact'
651 # log info to console
652 echo "Uploading the $INSTALLER artifact. This could take some time..."
653 echo "--------------------------------------------------------"
656 # source the opnfv.properties to get ARTIFACT_VERSION
657 source $WORKSPACE/opnfv.properties
659 # upload artifact and additional files to google storage
660 gsutil cp $BUILD_DIRECTORY/opnfv-$OPNFV_ARTIFACT_VERSION.iso gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso > gsutil.iso.log 2>&1
661 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.properties > gsutil.properties.log 2>&1
662 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/latest.properties > gsutil.latest.log 2>&1
665 echo "--------------------------------------------------------"
667 echo "Artifact is available as http://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
670 name: 'fuel-download-artifact'
678 # get the latest.properties file in order to get info regarding latest artifact
679 curl -s -o $WORKSPACE/latest.properties http://$GS_URL/latest.properties
681 # check if we got the file
682 [[ -f latest.properties ]] || exit 1
684 # source the file so we get OPNFV vars
685 source latest.properties
687 # log info to console
688 echo "Downloading the $INSTALLER artifact using URL http://$OPNFV_ARTIFACT_URL"
689 echo "This could take some time..."
690 echo "--------------------------------------------------------"
694 curl -s -o $WORKSPACE/opnfv.iso http://$OPNFV_ARTIFACT_URL > gsutil.iso.log 2>&1
697 ls -al $WORKSPACE/opnfv.iso
700 echo "--------------------------------------------------------"
704 name: 'fuel-workspace-cleanup'
712 # delete everything that is in $WORKSPACE
713 /bin/rm -rf $WORKSPACE
716 name: 'fuel-lab-reconfig'
724 # check to see if ucs login info file exists
725 if [ -e ~/.ssh/ucs_creds ];then
726 source ~/.ssh/ucs_creds
728 echo "Unable to find UCS credentials for LF lab reconfiguration...Exiting"
733 echo "Cloning releng repo..."
734 if ! GIT_SSL_NO_VERIFY=true git clone https://gerrit.opnfv.org/gerrit/releng; then
735 echo "Unable to clone releng repo...Exiting"
739 # log info to console
740 echo "Starting the lab reconfiguration for $INSTALLER..."
741 echo "--------------------------------------------------------"
745 $WORKSPACE/releng/utils/lab-reconfiguration/create_venv.sh
747 # disable nounset because 'activate' script contains unbound variable(s)
750 source $WORKSPACE/releng/utils/lab-reconfiguration/venv/bin/activate
751 # set nounset back again
754 # verify we are in venv
755 if [[ ! $(which python | grep venv) ]]; then
756 echo "Unable to activate venv...Exiting"
760 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
762 # while undergoing reboot
765 # check to see if slave is back up
768 while [ "$ping_counter" -lt 20 ]; do
769 if [[ $(ping -c 5 172.30.10.72) ]]; then
777 if [ "$ping_flag" -eq 1 ]; then
778 echo "Slave is pingable, now wait 180 seconds for services to start"
781 echo "Slave did not come back up after reboot: please check opnfv-jump-2"
789 echo "--------------------------------------------------------"
792 ########################
794 ########################
801 name: 'fuel-stable-arno'