1 ########################
2 # Job configuration for genesis/fuel
3 ########################
13 - 'genesis-fuel-verify-{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-virtual-master'
19 - 'genesis-fuel-deploy-runner-{stream}'
21 # stream: branch with - in place of / (eg. stable-arno)
22 # branch: branch (eg. stable/arno)
31 ########################
33 ########################
36 name: 'genesis-fuel-verify-{stream}'
38 project-type: freestyle
52 artifactDaysToKeep: -1
61 installer: '{installer}'
62 gs-pathname: '{gs-pathname}'
66 credentials-id: '{ssh-credentials}'
67 refspec: '$GERRIT_REFSPEC'
68 choosing-strategy: 'gerrit'
71 - ssh-agent-credentials:
72 user: '{ssh-credentials}'
77 - patchset-created-event:
78 exclude-drafts: 'false'
79 exclude-trivial-rebase: 'false'
80 exclude-no-code-change: 'false'
81 - draft-published-event
82 - comment-added-contains-event:
83 comment-contains-value: 'recheck'
84 - comment-added-contains-event:
85 comment-contains-value: 'reverify'
87 - project-compare-type: 'ANT'
88 project-pattern: 'genesis'
90 - branch-compare-type: 'ANT'
91 branch-pattern: '**/{branch}'
96 pattern: '{installer}/**'
100 echo "Verify disabled"
103 #- 'fuel-workspace-cleanup'
106 name: 'genesis-fuel-merge-{stream}'
108 project-type: freestyle
122 artifactDaysToKeep: -1
131 installer: '{installer}'
135 - gerrit-trigger-scm:
136 credentials-id: '{ssh-credentials}'
138 choosing-strategy: 'default'
141 - ssh-agent-credentials:
142 user: '{ssh-credentials}'
147 - change-merged-event
148 - comment-added-contains-event:
149 comment-contains-value: 'remerge'
151 - project-compare-type: 'ANT'
152 project-pattern: 'genesis'
154 - branch-compare-type: 'ANT'
155 branch-pattern: '**/{branch}'
160 pattern: '{installer}/**'
164 echo "Merge Job Disabled"
167 #- 'fuel-workspace-cleanup'
170 name: 'genesis-fuel-daily-{stream}'
172 project-type: freestyle
185 installer: '{installer}'
186 gs-pathname: '{gs-pathname}'
190 credentials-id: '{ssh-credentials}'
197 artifactDaysToKeep: -1
198 artifactNumToKeep: -1
202 - project: 'genesis-fuel-build-{stream}'
206 - project: 'genesis-fuel-deploy-runner-{stream}'
210 - project: 'functest-opnfv-jump-1'
213 - project: 'yardstick-opnfv-jump-1'
217 name: 'genesis-fuel-build-{stream}'
219 project-type: freestyle
226 artifactDaysToKeep: -1
227 artifactNumToKeep: -1
233 installer: '{installer}'
234 gs-pathname: '{gs-pathname}'
238 credentials-id: '{ssh-credentials}'
244 - 'fuel-upload-artifact'
245 - 'fuel-workspace-cleanup'
248 name: 'genesis-fuel-deploy-{stream}'
250 project-type: freestyle
260 installer: '{installer}'
261 gs-pathname: '{gs-pathname}'
264 default: ssh://gerrit.opnfv.org:29418/$PROJECT
265 description: "POD1 has some issues with cloning using https so that's why GIT_BASE is overriden here again."
269 credentials-id: '{ssh-credentials}'
276 artifactDaysToKeep: -1
277 artifactNumToKeep: -1
280 - 'fuel-download-artifact'
281 - 'fuel-deploy-{stream}'
284 name: 'genesis-fuel-deploy-runner-{stream}'
286 project-type: freestyle
295 artifactDaysToKeep: -1
296 artifactNumToKeep: -1
302 installer: '{installer}'
303 gs-pathname: '{gs-pathname}'
306 default: ssh://gerrit.opnfv.org:29418/$PROJECT
307 description: "Used for overriding the GIT URL coming from parameters macro."
311 credentials-id: '{ssh-credentials}'
316 - 'fuel-lab-reconfig'
318 - project: 'genesis-fuel-deploy-{stream}'
323 name: 'genesis-fuel-deploy-virtual-master'
325 project-type: freestyle
335 installer: '{installer}'
340 credentials-id: '{ssh-credentials}'
347 artifactDaysToKeep: -1
348 artifactNumToKeep: -1
351 - 'fuel-deploy-virtual'
353 ########################
355 ########################
361 default: '{installer}'
362 description: "Installer to use."
364 name: BUILD_DIRECTORY
365 default: $WORKSPACE/build_output
366 description: "Directory where the build artifact will be located upon the completion of the build."
368 name: CACHE_DIRECTORY
369 default: $HOME/opnfv/cache/genesis-$INSTALLER
370 description: "Directory where the cache to be used during the build is located."
373 default: https://gerrit.opnfv.org/gerrit/$PROJECT
374 description: "Used for overriding the GIT URL coming from Global Jenkins configuration in case if the stuff is done on none-LF HW."
377 default: artifacts.opnfv.org/$PROJECT/$INSTALLER{gs-pathname}
378 description: "URL to Google Storage."
380 ########################
382 ########################
392 # log info to console
393 echo "Starting the build of $INSTALLER. This could take some time..."
394 echo "--------------------------------------------------------"
397 # create the cache directory if it doesn't exist
398 [[ -d $CACHE_DIRECTORY ]] || mkdir -p $CACHE_DIRECTORY
400 # set OPNFV_ARTIFACT_VERSION
401 export OPNFV_ARTIFACT_VERSION=$(date -u +"%Y-%m-%d_%H-%M-%S")
404 cd $WORKSPACE/$INSTALLER/ci
405 ./build.sh -v $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY $BUILD_DIRECTORY
407 # list the build artifacts
408 ls -al $BUILD_DIRECTORY
410 # save information regarding artifact into file
412 echo "OPNFV_ARTIFACT_VERSION=$OPNFV_ARTIFACT_VERSION"
413 echo "OPNFV_GIT_URL=$(git config --get remote.origin.url)"
414 echo "OPNFV_GIT_SHA1=$(git rev-parse HEAD)"
415 echo "OPNFV_ARTIFACT_URL=$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
416 echo "OPNFV_ARTIFACT_MD5SUM=$(md5sum $BUILD_DIRECTORY/opnfv-$OPNFV_ARTIFACT_VERSION.iso | cut -d' ' -f1)"
417 echo "OPNFV_BUILD_URL=$BUILD_URL"
418 ) > $WORKSPACE/opnfv.properties
421 echo "--------------------------------------------------------"
425 name: 'fuel-deploy-master'
433 # source the file so we get OPNFV vars
434 source latest.properties
436 # echo the info about artifact that is used during the deployment
437 echo "Using $(echo $OPNFV_ARTIFACT_URL | cut -d'/' -f4) for deployment"
439 # create TMPDIR if it doesn't exist
440 export TMPDIR=$HOME/tmpdir
441 [[ -d $TMPDIR ]] || mkdir -p $TMPDIR
443 # change permissions down to TMPDIR
447 # set TOPDIR, CONFDIR
448 export TOPDIR=$WORKSPACE/fuel/prototypes/auto-deploy
449 export CONFDIR=$WORKSPACE/fuel/deploy/baremetal/conf/linux_foundation_lab/pod2/multinode
452 sudo $WORKSPACE/common/ci/clean.sh -base_config $WORKSPACE/foreman/ci/inventory/lf_pod2_ksgen_settings.yml
454 # log info to console
455 echo "Starting the deployment using $INSTALLER. This could take some time..."
456 echo "--------------------------------------------------------"
459 # start the deployment
460 echo "Issuing command"
461 echo "sudo TMPDIR=${TMPDIR} ${TOPDIR}/deploy/deploy.sh ${WORKSPACE}/opnfv.iso ${CONFDIR}/dea.yaml ${CONFDIR}/dha.yaml"
462 sudo TMPDIR=${TMPDIR} ${TOPDIR}/deploy/deploy.sh ${WORKSPACE}/opnfv.iso ${CONFDIR}/dea.yaml ${CONFDIR}/dha.yaml
465 echo "--------------------------------------------------------"
469 name: 'fuel-deploy-stable-arno'
477 # source the file so we get OPNFV vars
478 source latest.properties
480 # echo the info about artifact that is used during the deployment
481 echo "Using $(echo $OPNFV_ARTIFACT_URL | cut -d'/' -f4) for deployment"
483 # create TMPDIR if it doesn't exist
484 export TMPDIR=$HOME/tmp/$JOB_NAME
485 [[ -d $TMPDIR ]] || mkdir -p $TMPDIR
487 # change permissions down to TMPDIR
492 export CONFDIR=$WORKSPACE/fuel/deploy/baremetal/conf/linux_foundation_lab/pod2/ha
495 sudo $WORKSPACE/common/ci/clean.sh -base_config $WORKSPACE/foreman/ci/inventory/lf_pod2_ksgen_settings.yml
497 # log info to console
498 echo "Starting the deployment using $INSTALLER. This could take some time..."
499 echo "--------------------------------------------------------"
502 # start the deployment
503 echo "Issuing command"
504 echo "sudo $WORKSPACE/fuel/ci/deploy.sh $WORKSPACE/opnfv.iso ${CONFDIR}/dea.yaml ${CONFDIR}/dha.yaml -s $TMPDIR"
506 sudo $WORKSPACE/fuel/ci/deploy.sh $WORKSPACE/opnfv.iso ${CONFDIR}/dea.yaml ${CONFDIR}/dha.yaml -s $TMPDIR
508 echo "--------------------------------------------------------"
512 name: 'fuel-deploy-virtual'
520 # log info to console
521 echo "Starting the deployment on virtual environment using $INSTALLER. This could take some time..."
522 echo "--------------------------------------------------------"
525 ssh -o BatchMode=yes -o TCPKeepAlive=yes cideploy@10.118.34.205 ./cideploy.sh
528 echo "--------------------------------------------------------"
532 name: 'fuel-upload-artifact'
540 # log info to console
541 echo "Uploading the $INSTALLER artifact. This could take some time..."
542 echo "--------------------------------------------------------"
545 # source the opnfv.properties to get ARTIFACT_VERSION
546 source $WORKSPACE/opnfv.properties
548 # upload artifact and additional files to google storage
549 gsutil cp $BUILD_DIRECTORY/opnfv-$OPNFV_ARTIFACT_VERSION.iso gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso > gsutil.iso.log 2>&1
550 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.properties > gsutil.properties.log 2>&1
551 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/latest.properties > gsutil.latest.log 2>&1
554 echo "--------------------------------------------------------"
556 echo "Artifact is available as http://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
559 name: 'fuel-download-artifact'
567 # get the latest.properties file in order to get info regarding latest artifact
568 curl -s -o $WORKSPACE/latest.properties http://$GS_URL/latest.properties
570 # check if we got the file
571 [[ -f latest.properties ]] || exit 1
573 # source the file so we get OPNFV vars
574 source latest.properties
576 # log info to console
577 echo "Downloading the $INSTALLER artifact using URL http://$OPNFV_ARTIFACT_URL"
578 echo "This could take some time..."
579 echo "--------------------------------------------------------"
583 curl -s -o $WORKSPACE/opnfv.iso http://$OPNFV_ARTIFACT_URL > gsutil.iso.log 2>&1
586 ls -al $WORKSPACE/opnfv.iso
589 echo "--------------------------------------------------------"
593 name: 'fuel-workspace-cleanup'
601 # delete everything that is in $WORKSPACE
602 /bin/rm -rf $WORKSPACE
605 name: 'fuel-lab-reconfig'
613 # check to see if ucs login info file exists
614 if [ -e ~/.ssh/ucs_creds ];then
615 source ~/.ssh/ucs_creds
617 echo "Unable to find UCS credentials for LF lab reconfiguration...Exiting"
622 echo "Cloning releng repo..."
623 if ! GIT_SSL_NO_VERIFY=true git clone https://gerrit.opnfv.org/gerrit/releng; then
624 echo "Unable to clone releng repo...Exiting"
628 # log info to console
629 echo "Starting the lab reconfiguration for $INSTALLER..."
630 echo "--------------------------------------------------------"
634 $WORKSPACE/releng/utils/lab-reconfiguration/create_venv.sh
636 # disable nounset because 'activate' script contains unbound variable(s)
639 source $WORKSPACE/releng/utils/lab-reconfiguration/venv/bin/activate
640 # set nounset back again
643 # verify we are in venv
644 if [[ ! $(which python | grep venv) ]]; then
645 echo "Unable to activate venv...Exiting"
649 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
651 # while undergoing reboot
654 # check to see if slave is back up
657 while [ "$ping_counter" -lt 20 ]; do
658 if [[ $(ping -c 5 172.30.10.72) ]]; then
666 if [ "$ping_flag" -eq 1 ]; then
667 echo "Slave is pingable, now wait 60 seconds for services to start"
670 echo "Slave did not come back up after reboot: please check opnfv-jump-2"
678 echo "--------------------------------------------------------"
681 ########################
683 ########################
687 - timed: '0 21 * * *'
690 name: 'fuel-stable-arno'