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 - trigger-parameterized-builds:
265 - project: 'genesis-foreman-daily-{stream}'
268 name: 'genesis-fuel-deploy-runner-{stream}'
270 project-type: freestyle
279 artifactDaysToKeep: -1
280 artifactNumToKeep: -1
286 installer: '{installer}'
287 gs-pathname: '{gs-pathname}'
290 default: ssh://gerrit.opnfv.org:29418/$PROJECT
291 description: "Used for overriding the GIT URL coming from parameters macro."
295 credentials-id: '{ssh-credentials}'
301 use-build-blocker: true
303 - "genesis-foreman-daily.*"
304 - "genesis-foreman-deploy-runner-{stream}"
305 - "genesis-fuel-daily.*"
308 - 'fuel-lab-reconfig'
310 - project: 'genesis-fuel-deploy-{stream}'
315 name: 'genesis-fuel-build-{stream}'
317 project-type: freestyle
324 artifactDaysToKeep: -1
325 artifactNumToKeep: -1
331 installer: '{installer}'
332 gs-pathname: '{gs-pathname}'
336 credentials-id: '{ssh-credentials}'
342 - 'fuel-upload-artifact'
343 - 'fuel-workspace-cleanup'
347 recipients: jonas.bjurel@ericsson.com stefan.k.berg@ericsson.com
350 name: 'genesis-fuel-deploy-{stream}'
352 project-type: freestyle
362 installer: '{installer}'
363 gs-pathname: '{gs-pathname}'
366 default: ssh://gerrit.opnfv.org:29418/$PROJECT
367 description: "POD2 has some issues with cloning using https so that's why GIT_BASE is overriden here again."
371 credentials-id: '{ssh-credentials}'
378 artifactDaysToKeep: -1
379 artifactNumToKeep: -1
382 - 'fuel-download-artifact'
383 - 'fuel-odl-plugin-build'
388 recipients: jonas.bjurel@ericsson.com stefan.k.berg@ericsson.com
391 name: 'genesis-fuel-lab-reconfig-{stream}'
393 project-type: freestyle
402 artifactDaysToKeep: -1
403 artifactNumToKeep: -1
409 installer: '{installer}'
410 gs-pathname: '{gs-pathname}'
413 default: ssh://gerrit.opnfv.org:29418/$PROJECT
414 description: "Used for overriding the GIT URL coming from parameters macro."
418 credentials-id: '{ssh-credentials}'
424 use-build-blocker: true
426 - "genesis-foreman-daily.*"
429 - 'fuel-lab-reconfig'
432 name: 'genesis-fuel-verify-deploy-virtual-{stream}'
434 project-type: freestyle
444 installer: '{installer}'
449 credentials-id: '{ssh-credentials}'
456 artifactDaysToKeep: -1
457 artifactNumToKeep: -1
460 - 'fuel-deploy-virtual'
462 ########################
464 ########################
470 default: '{installer}'
471 description: "Installer to use."
473 name: BUILD_DIRECTORY
474 default: $WORKSPACE/build_output
475 description: "Directory where the build artifact will be located upon the completion of the build."
477 name: CACHE_DIRECTORY
478 default: $HOME/opnfv/cache/genesis-$INSTALLER
479 description: "Directory where the cache to be used during the build is located."
482 default: https://gerrit.opnfv.org/gerrit/$PROJECT
483 description: "Used for overriding the GIT URL coming from Global Jenkins configuration in case if the stuff is done on none-LF HW."
486 default: artifacts.opnfv.org/$PROJECT/$INSTALLER{gs-pathname}
487 description: "URL to Google Storage."
489 ########################
491 ########################
501 # log info to console
502 echo "Starting the build of $INSTALLER. This could take some time..."
503 echo "--------------------------------------------------------"
506 # create the cache directory if it doesn't exist
507 [[ -d $CACHE_DIRECTORY ]] || mkdir -p $CACHE_DIRECTORY
509 # set OPNFV_ARTIFACT_VERSION
510 export OPNFV_ARTIFACT_VERSION=$(date -u +"%Y-%m-%d_%H-%M-%S")
513 cd $WORKSPACE/$INSTALLER/ci
514 ./build.sh -v $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY $BUILD_DIRECTORY
516 # list the build artifacts
517 ls -al $BUILD_DIRECTORY
519 # save information regarding artifact into file
521 echo "OPNFV_ARTIFACT_VERSION=$OPNFV_ARTIFACT_VERSION"
522 echo "OPNFV_GIT_URL=$(git config --get remote.origin.url)"
523 echo "OPNFV_GIT_SHA1=$(git rev-parse HEAD)"
524 echo "OPNFV_ARTIFACT_URL=$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
525 echo "OPNFV_ARTIFACT_MD5SUM=$(md5sum $BUILD_DIRECTORY/opnfv-$OPNFV_ARTIFACT_VERSION.iso | cut -d' ' -f1)"
526 echo "OPNFV_BUILD_URL=$BUILD_URL"
527 ) > $WORKSPACE/opnfv.properties
530 echo "--------------------------------------------------------"
534 name: 'fuel-odl-plugin-build'
542 # install dependencies if they are not available already
543 if [[ ! $(rpm -qa | grep rubygems) ]]; then
544 echo "Rubygems not found, but required for Fuel Plugin build ... attempting to install"
545 sudo yum install -y rubygems ruby-devel
548 if [[ ! $(gem list | grep fpm) ]]; then
549 echo "fpm gem not found, but required for Fuel Plugin build ... attempting to install"
553 if [[ ! $(pip list | grep fuel-plugin-builder) ]]; then
554 echo "fuel-plugin-builder not found, but required for Fuel Plugin build ... attempting to install"
555 sudo pip install fuel-plugin-builder
558 # log info to console
559 echo "Starting the build of Fuel Opendaylight Plugin. This could take some time..."
560 echo "--------------------------------------------------------"
563 export ODL_PLUGIN_BRANCH="juno/lithium-sr1"
566 git clone https://github.com/stackforge/fuel-plugin-opendaylight
568 pushd $WORKSPACE/fuel-plugin-opendaylight
569 git checkout $ODL_PLUGIN_BRANCH
572 fpb --build fuel-plugin-opendaylight/
575 echo "--------------------------------------------------------"
587 # source the file so we get OPNFV vars
588 source latest.properties
590 # echo the info about artifact that is used during the deployment
591 echo "Using $(echo $OPNFV_ARTIFACT_URL | cut -d'/' -f4) for deployment"
593 # create TMPDIR if it doesn't exist
594 export TMPDIR=$HOME/tmpdir
595 [[ -d $TMPDIR ]] || mkdir -p $TMPDIR
597 # change permissions down to TMPDIR
601 # set CONFDIR, BRIDGE
602 export CONFDIR=$WORKSPACE/fuel/deploy/templates/hardware_environment/conf/linux_foundation_lab/pod2
604 export PLUGIN=$WORKSPACE/fuel-plugin-opendaylight
607 sudo $WORKSPACE/common/ci/clean.sh -base_config $WORKSPACE/foreman/ci/inventory/lf_pod2_ksgen_settings.yml
609 # prepare for Fuel Deployment
610 sudo $WORKSPACE/common/ci/setup.sh
612 # log info to console
613 echo "Starting the deployment using $INSTALLER. This could take some time..."
614 echo "--------------------------------------------------------"
617 # start the deployment
618 echo "Issuing command"
619 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"
620 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
623 echo "--------------------------------------------------------"
627 name: 'fuel-deploy-virtual'
635 # log info to console
636 echo "Starting the deployment on virtual environment using $INSTALLER. This could take some time..."
637 echo "--------------------------------------------------------"
640 ssh -o BatchMode=yes -o TCPKeepAlive=yes cideploy@10.118.34.205 ./cideploy.sh
643 echo "--------------------------------------------------------"
647 name: 'fuel-upload-artifact'
655 # log info to console
656 echo "Uploading the $INSTALLER artifact. This could take some time..."
657 echo "--------------------------------------------------------"
660 # source the opnfv.properties to get ARTIFACT_VERSION
661 source $WORKSPACE/opnfv.properties
663 # upload artifact and additional files to google storage
664 gsutil cp $BUILD_DIRECTORY/opnfv-$OPNFV_ARTIFACT_VERSION.iso gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso > gsutil.iso.log 2>&1
665 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.properties > gsutil.properties.log 2>&1
666 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/latest.properties > gsutil.latest.log 2>&1
669 echo "--------------------------------------------------------"
671 echo "Artifact is available as http://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
674 name: 'fuel-download-artifact'
682 # get the latest.properties file in order to get info regarding latest artifact
683 curl -s -o $WORKSPACE/latest.properties http://$GS_URL/latest.properties
685 # check if we got the file
686 [[ -f latest.properties ]] || exit 1
688 # source the file so we get OPNFV vars
689 source latest.properties
691 # log info to console
692 echo "Downloading the $INSTALLER artifact using URL http://$OPNFV_ARTIFACT_URL"
693 echo "This could take some time..."
694 echo "--------------------------------------------------------"
698 curl -s -o $WORKSPACE/opnfv.iso http://$OPNFV_ARTIFACT_URL > gsutil.iso.log 2>&1
701 ls -al $WORKSPACE/opnfv.iso
704 echo "--------------------------------------------------------"
708 name: 'fuel-workspace-cleanup'
716 # delete everything that is in $WORKSPACE
717 /bin/rm -rf $WORKSPACE
720 name: 'fuel-lab-reconfig'
728 # check to see if ucs login info file exists
729 if [ -e ~/.ssh/ucs_creds ];then
730 source ~/.ssh/ucs_creds
732 echo "Unable to find UCS credentials for LF lab reconfiguration...Exiting"
737 echo "Cloning releng repo..."
738 if ! GIT_SSL_NO_VERIFY=true git clone https://gerrit.opnfv.org/gerrit/releng; then
739 echo "Unable to clone releng repo...Exiting"
743 # log info to console
744 echo "Starting the lab reconfiguration for $INSTALLER..."
745 echo "--------------------------------------------------------"
749 $WORKSPACE/releng/utils/lab-reconfiguration/create_venv.sh
751 # disable nounset because 'activate' script contains unbound variable(s)
754 source $WORKSPACE/releng/utils/lab-reconfiguration/venv/bin/activate
755 # set nounset back again
758 # verify we are in venv
759 if [[ ! $(which python | grep venv) ]]; then
760 echo "Unable to activate venv...Exiting"
764 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
766 # while undergoing reboot
769 # check to see if slave is back up
772 while [ "$ping_counter" -lt 20 ]; do
773 if [[ $(ping -c 5 172.30.10.72) ]]; then
781 if [ "$ping_flag" -eq 1 ]; then
782 echo "Slave is pingable, now wait 180 seconds for services to start"
785 echo "Slave did not come back up after reboot: please check opnfv-jump-2"
793 echo "--------------------------------------------------------"
796 ########################
798 ########################
805 name: 'fuel-stable-arno'