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
63 - genesis-fuel-parameter:
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
149 - genesis-fuel-parameter:
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}'
219 - genesis-fuel-parameter:
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}'
266 trigger-with-no-params: true
269 name: 'genesis-fuel-deploy-runner-{stream}'
271 project-type: freestyle
280 artifactDaysToKeep: -1
281 artifactNumToKeep: -1
286 - genesis-fuel-parameter:
287 installer: '{installer}'
288 gs-pathname: '{gs-pathname}'
291 default: ssh://gerrit.opnfv.org:29418/$PROJECT
292 description: "Used for overriding the GIT URL coming from parameters macro."
296 credentials-id: '{ssh-credentials}'
302 use-build-blocker: true
304 - "genesis-foreman-daily.*"
305 - "genesis-foreman-deploy-runner-{stream}"
306 - "genesis-fuel-daily.*"
309 - 'fuel-lab-reconfig'
311 - project: 'genesis-fuel-deploy-{stream}'
316 name: 'genesis-fuel-build-{stream}'
318 project-type: freestyle
325 artifactDaysToKeep: -1
326 artifactNumToKeep: -1
331 - genesis-fuel-parameter:
332 installer: '{installer}'
333 gs-pathname: '{gs-pathname}'
337 credentials-id: '{ssh-credentials}'
343 - 'fuel-upload-artifact'
344 - 'fuel-workspace-cleanup'
348 recipients: jonas.bjurel@ericsson.com stefan.k.berg@ericsson.com
351 name: 'genesis-fuel-deploy-{stream}'
353 project-type: freestyle
362 - genesis-fuel-parameter:
363 installer: '{installer}'
364 gs-pathname: '{gs-pathname}'
367 default: ssh://gerrit.opnfv.org:29418/$PROJECT
368 description: "POD2 has some issues with cloning using https so that's why GIT_BASE is overriden here again."
372 credentials-id: '{ssh-credentials}'
379 artifactDaysToKeep: -1
380 artifactNumToKeep: -1
383 - 'fuel-download-artifact'
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
408 - genesis-fuel-parameter:
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
443 - genesis-fuel-parameter:
444 installer: '{installer}'
449 credentials-id: '{ssh-credentials}'
456 artifactDaysToKeep: -1
457 artifactNumToKeep: -1
460 - 'fuel-deploy-virtual'
462 ########################
464 ########################
466 name: genesis-fuel-parameter
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 "--------------------------------------------------------"
542 # source the file so we get OPNFV vars
543 source latest.properties
545 # echo the info about artifact that is used during the deployment
546 echo "Using $(echo $OPNFV_ARTIFACT_URL | cut -d'/' -f4) for deployment"
548 # create TMPDIR if it doesn't exist
549 export TMPDIR=$HOME/tmpdir
550 [[ -d $TMPDIR ]] || mkdir -p $TMPDIR
552 # change permissions down to TMPDIR
556 # set CONFDIR, BRIDGE
557 export CONFDIR=$WORKSPACE/fuel/deploy/templates/hardware_environment/conf/linux_foundation_lab/pod2
561 sudo $WORKSPACE/common/ci/clean.sh -base_config $WORKSPACE/foreman/ci/inventory/lf_pod2_ksgen_settings.yml
563 # prepare for Fuel Deployment
564 sudo $WORKSPACE/common/ci/setup.sh
566 # log info to console
567 echo "Starting the deployment using $INSTALLER. This could take some time..."
568 echo "--------------------------------------------------------"
571 # start the deployment
572 echo "Issuing command"
573 echo "sudo $WORKSPACE/fuel/ci/deploy.sh -iso $WORKSPACE/opnfv.iso -dea $CONFDIR/dea.yaml -dha $CONFDIR/dha.yaml -s $TMPDIR -b $BRIDGE -nh"
574 sudo $WORKSPACE/fuel/ci/deploy.sh -iso $WORKSPACE/opnfv.iso -dea $CONFDIR/dea.yaml -dha $CONFDIR/dha.yaml -s $TMPDIR -b $BRIDGE -nh
577 echo "--------------------------------------------------------"
581 name: 'fuel-deploy-virtual'
589 # log info to console
590 echo "Starting the deployment on virtual environment using $INSTALLER. This could take some time..."
591 echo "--------------------------------------------------------"
594 ssh -o BatchMode=yes -o TCPKeepAlive=yes cideploy@10.118.34.205 ./cideploy.sh
597 echo "--------------------------------------------------------"
601 name: 'fuel-upload-artifact'
609 # log info to console
610 echo "Uploading the $INSTALLER artifact. This could take some time..."
611 echo "--------------------------------------------------------"
614 # source the opnfv.properties to get ARTIFACT_VERSION
615 source $WORKSPACE/opnfv.properties
617 # upload artifact and additional files to google storage
618 gsutil cp $BUILD_DIRECTORY/opnfv-$OPNFV_ARTIFACT_VERSION.iso gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso > gsutil.iso.log 2>&1
619 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.properties > gsutil.properties.log 2>&1
620 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/latest.properties > gsutil.latest.log 2>&1
623 echo "--------------------------------------------------------"
625 echo "Artifact is available as http://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
628 name: 'fuel-download-artifact'
636 # get the latest.properties file in order to get info regarding latest artifact
637 curl -s -o $WORKSPACE/latest.properties http://$GS_URL/latest.properties
639 # check if we got the file
640 [[ -f latest.properties ]] || exit 1
642 # source the file so we get OPNFV vars
643 source latest.properties
645 # log info to console
646 echo "Downloading the $INSTALLER artifact using URL http://$OPNFV_ARTIFACT_URL"
647 echo "This could take some time..."
648 echo "--------------------------------------------------------"
652 curl -s -o $WORKSPACE/opnfv.iso http://$OPNFV_ARTIFACT_URL > gsutil.iso.log 2>&1
655 ls -al $WORKSPACE/opnfv.iso
658 echo "--------------------------------------------------------"
662 name: 'fuel-workspace-cleanup'
670 # delete everything that is in $WORKSPACE
671 /bin/rm -rf $WORKSPACE
674 name: 'fuel-lab-reconfig'
682 # check to see if ucs login info file exists
683 if [ -e ~/.ssh/ucs_creds ];then
684 source ~/.ssh/ucs_creds
686 echo "Unable to find UCS credentials for LF lab reconfiguration...Exiting"
691 echo "Cloning releng repo..."
692 if ! GIT_SSL_NO_VERIFY=true git clone https://gerrit.opnfv.org/gerrit/releng; then
693 echo "Unable to clone releng repo...Exiting"
697 # log info to console
698 echo "Starting the lab reconfiguration for $INSTALLER..."
699 echo "--------------------------------------------------------"
703 $WORKSPACE/releng/utils/lab-reconfiguration/create_venv.sh
705 # disable nounset because 'activate' script contains unbound variable(s)
708 source $WORKSPACE/releng/utils/lab-reconfiguration/venv/bin/activate
709 # set nounset back again
712 # verify we are in venv
713 if [[ ! $(which python | grep venv) ]]; then
714 echo "Unable to activate venv...Exiting"
718 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
720 # while undergoing reboot
723 # check to see if slave is back up
726 while [ "$ping_counter" -lt 20 ]; do
727 if [[ $(ping -c 5 172.30.10.72) ]]; then
735 if [ "$ping_flag" -eq 1 ]; then
736 echo "Slave is pingable, now wait 180 seconds for services to start"
739 echo "Slave did not come back up after reboot: please check opnfv-jump-2"
747 echo "--------------------------------------------------------"
750 ########################
752 ########################
759 name: 'fuel-stable-arno'