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'
387 recipients: jonas.bjurel@ericsson.com stefan.k.berg@ericsson.com
390 name: 'genesis-fuel-lab-reconfig-{stream}'
392 project-type: freestyle
401 artifactDaysToKeep: -1
402 artifactNumToKeep: -1
408 installer: '{installer}'
409 gs-pathname: '{gs-pathname}'
412 default: ssh://gerrit.opnfv.org:29418/$PROJECT
413 description: "Used for overriding the GIT URL coming from parameters macro."
417 credentials-id: '{ssh-credentials}'
423 use-build-blocker: true
425 - "genesis-foreman-daily.*"
428 - 'fuel-lab-reconfig'
431 name: 'genesis-fuel-verify-deploy-virtual-{stream}'
433 project-type: freestyle
443 installer: '{installer}'
448 credentials-id: '{ssh-credentials}'
455 artifactDaysToKeep: -1
456 artifactNumToKeep: -1
459 - 'fuel-deploy-virtual'
461 ########################
463 ########################
469 default: '{installer}'
470 description: "Installer to use."
472 name: BUILD_DIRECTORY
473 default: $WORKSPACE/build_output
474 description: "Directory where the build artifact will be located upon the completion of the build."
476 name: CACHE_DIRECTORY
477 default: $HOME/opnfv/cache/genesis-$INSTALLER
478 description: "Directory where the cache to be used during the build is located."
481 default: https://gerrit.opnfv.org/gerrit/$PROJECT
482 description: "Used for overriding the GIT URL coming from Global Jenkins configuration in case if the stuff is done on none-LF HW."
485 default: artifacts.opnfv.org/$PROJECT/$INSTALLER{gs-pathname}
486 description: "URL to Google Storage."
488 ########################
490 ########################
500 # log info to console
501 echo "Starting the build of $INSTALLER. This could take some time..."
502 echo "--------------------------------------------------------"
505 # create the cache directory if it doesn't exist
506 [[ -d $CACHE_DIRECTORY ]] || mkdir -p $CACHE_DIRECTORY
508 # set OPNFV_ARTIFACT_VERSION
509 export OPNFV_ARTIFACT_VERSION=$(date -u +"%Y-%m-%d_%H-%M-%S")
512 cd $WORKSPACE/$INSTALLER/ci
513 ./build.sh -v $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY $BUILD_DIRECTORY
515 # list the build artifacts
516 ls -al $BUILD_DIRECTORY
518 # save information regarding artifact into file
520 echo "OPNFV_ARTIFACT_VERSION=$OPNFV_ARTIFACT_VERSION"
521 echo "OPNFV_GIT_URL=$(git config --get remote.origin.url)"
522 echo "OPNFV_GIT_SHA1=$(git rev-parse HEAD)"
523 echo "OPNFV_ARTIFACT_URL=$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
524 echo "OPNFV_ARTIFACT_MD5SUM=$(md5sum $BUILD_DIRECTORY/opnfv-$OPNFV_ARTIFACT_VERSION.iso | cut -d' ' -f1)"
525 echo "OPNFV_BUILD_URL=$BUILD_URL"
526 ) > $WORKSPACE/opnfv.properties
529 echo "--------------------------------------------------------"
541 # source the file so we get OPNFV vars
542 source latest.properties
544 # echo the info about artifact that is used during the deployment
545 echo "Using $(echo $OPNFV_ARTIFACT_URL | cut -d'/' -f4) for deployment"
547 # create TMPDIR if it doesn't exist
548 export TMPDIR=$HOME/tmpdir
549 [[ -d $TMPDIR ]] || mkdir -p $TMPDIR
551 # change permissions down to TMPDIR
555 # set CONFDIR, BRIDGE
556 export CONFDIR=$WORKSPACE/fuel/deploy/templates/hardware_environment/conf/linux_foundation_lab/pod2
560 sudo $WORKSPACE/common/ci/clean.sh -base_config $WORKSPACE/foreman/ci/inventory/lf_pod2_ksgen_settings.yml
562 # prepare for Fuel Deployment
563 sudo $WORKSPACE/common/ci/setup.sh
565 # log info to console
566 echo "Starting the deployment using $INSTALLER. This could take some time..."
567 echo "--------------------------------------------------------"
570 # start the deployment
571 echo "Issuing command"
572 echo "sudo $WORKSPACE/fuel/ci/deploy.sh -iso $WORKSPACE/opnfv.iso -dea $CONFDIR/dea.yaml -dha $CONFDIR/dha.yaml -s $TMPDIR -b $BRIDGE -nh"
573 sudo $WORKSPACE/fuel/ci/deploy.sh -iso $WORKSPACE/opnfv.iso -dea $CONFDIR/dea.yaml -dha $CONFDIR/dha.yaml -s $TMPDIR -b $BRIDGE -nh
576 echo "--------------------------------------------------------"
580 name: 'fuel-deploy-virtual'
588 # log info to console
589 echo "Starting the deployment on virtual environment using $INSTALLER. This could take some time..."
590 echo "--------------------------------------------------------"
593 ssh -o BatchMode=yes -o TCPKeepAlive=yes cideploy@10.118.34.205 ./cideploy.sh
596 echo "--------------------------------------------------------"
600 name: 'fuel-upload-artifact'
608 # log info to console
609 echo "Uploading the $INSTALLER artifact. This could take some time..."
610 echo "--------------------------------------------------------"
613 # source the opnfv.properties to get ARTIFACT_VERSION
614 source $WORKSPACE/opnfv.properties
616 # upload artifact and additional files to google storage
617 gsutil cp $BUILD_DIRECTORY/opnfv-$OPNFV_ARTIFACT_VERSION.iso gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso > gsutil.iso.log 2>&1
618 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.properties > gsutil.properties.log 2>&1
619 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/latest.properties > gsutil.latest.log 2>&1
622 echo "--------------------------------------------------------"
624 echo "Artifact is available as http://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
627 name: 'fuel-download-artifact'
635 # get the latest.properties file in order to get info regarding latest artifact
636 curl -s -o $WORKSPACE/latest.properties http://$GS_URL/latest.properties
638 # check if we got the file
639 [[ -f latest.properties ]] || exit 1
641 # source the file so we get OPNFV vars
642 source latest.properties
644 # log info to console
645 echo "Downloading the $INSTALLER artifact using URL http://$OPNFV_ARTIFACT_URL"
646 echo "This could take some time..."
647 echo "--------------------------------------------------------"
651 curl -s -o $WORKSPACE/opnfv.iso http://$OPNFV_ARTIFACT_URL > gsutil.iso.log 2>&1
654 ls -al $WORKSPACE/opnfv.iso
657 echo "--------------------------------------------------------"
661 name: 'fuel-workspace-cleanup'
669 # delete everything that is in $WORKSPACE
670 /bin/rm -rf $WORKSPACE
673 name: 'fuel-lab-reconfig'
681 # check to see if ucs login info file exists
682 if [ -e ~/.ssh/ucs_creds ];then
683 source ~/.ssh/ucs_creds
685 echo "Unable to find UCS credentials for LF lab reconfiguration...Exiting"
690 echo "Cloning releng repo..."
691 if ! GIT_SSL_NO_VERIFY=true git clone https://gerrit.opnfv.org/gerrit/releng; then
692 echo "Unable to clone releng repo...Exiting"
696 # log info to console
697 echo "Starting the lab reconfiguration for $INSTALLER..."
698 echo "--------------------------------------------------------"
702 $WORKSPACE/releng/utils/lab-reconfiguration/create_venv.sh
704 # disable nounset because 'activate' script contains unbound variable(s)
707 source $WORKSPACE/releng/utils/lab-reconfiguration/venv/bin/activate
708 # set nounset back again
711 # verify we are in venv
712 if [[ ! $(which python | grep venv) ]]; then
713 echo "Unable to activate venv...Exiting"
717 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
719 # while undergoing reboot
722 # check to see if slave is back up
725 while [ "$ping_counter" -lt 20 ]; do
726 if [[ $(ping -c 5 172.30.10.72) ]]; then
734 if [ "$ping_flag" -eq 1 ]; then
735 echo "Slave is pingable, now wait 180 seconds for services to start"
738 echo "Slave did not come back up after reboot: please check opnfv-jump-2"
746 echo "--------------------------------------------------------"
749 ########################
751 ########################
758 name: 'fuel-stable-arno'