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'
76 - patchset-created-event:
77 exclude-drafts: 'false'
78 exclude-trivial-rebase: 'false'
79 exclude-no-code-change: 'false'
80 - draft-published-event
81 - comment-added-contains-event:
82 comment-contains-value: 'recheck'
83 - comment-added-contains-event:
84 comment-contains-value: 'reverify'
86 - project-compare-type: 'ANT'
87 project-pattern: 'genesis'
89 - branch-compare-type: 'ANT'
90 branch-pattern: '**/{branch}'
93 pattern: 'common/ci/**'
95 pattern: 'common/manifests/**'
97 pattern: 'common/puppet-opnfv/**'
99 pattern: 'common/tools/**'
101 pattern: '{installer}/build/**'
103 pattern: '{installer}/ci/**'
105 pattern: '{installer}/deploy/**'
107 pattern: '{installer}/include/**'
109 pattern: '{installer}/prototypes/**'
110 forbidden-file-paths:
112 pattern: 'common/docs/**'
114 pattern: '{installer}/docs/**'
118 - 'fuel-workspace-cleanup'
121 name: 'genesis-fuel-merge-{stream}'
123 project-type: freestyle
137 artifactDaysToKeep: -1
145 - genesis-fuel-parameter:
146 installer: '{installer}'
150 - gerrit-trigger-scm:
151 credentials-id: '{ssh-credentials}'
153 choosing-strategy: 'default'
158 - change-merged-event
159 - comment-added-contains-event:
160 comment-contains-value: 'remerge'
162 - project-compare-type: 'ANT'
163 project-pattern: 'genesis'
165 - branch-compare-type: 'ANT'
166 branch-pattern: '**/{branch}'
169 pattern: 'common/ci/**'
171 pattern: 'common/manifests/**'
173 pattern: 'common/puppet-opnfv/**'
175 pattern: 'common/tools/**'
177 pattern: '{installer}/build/**'
179 pattern: '{installer}/ci/**'
181 pattern: '{installer}/deploy/**'
183 pattern: '{installer}/include/**'
185 pattern: '{installer}/prototypes/**'
186 forbidden-file-paths:
188 pattern: 'common/docs/**'
190 pattern: '{installer}/docs/**'
194 - 'fuel-workspace-cleanup'
197 name: 'genesis-fuel-daily-{stream}'
199 project-type: freestyle
203 disabled: '{obj:disabled}'
206 - 'genesis-fuel-{stream}-trigger'
211 - genesis-fuel-parameter:
212 installer: '{installer}'
213 gs-pathname: '{gs-pathname}'
217 credentials-id: '{ssh-credentials}'
224 artifactDaysToKeep: -1
225 artifactNumToKeep: -1
229 - project: 'genesis-fuel-build-{stream}'
233 - project: 'genesis-fuel-lab-reconfig-{stream}'
237 - project: 'genesis-fuel-deploy-{stream}'
241 - project: 'functest-fuel-{stream}'
244 build-step-failure-threshold: 'never'
245 failure-threshold: 'never'
246 unstable-threshold: 'FAILURE'
248 # - project: 'yardstick-fuel-{stream}'
251 # build-step-failure-threshold: 'never'
252 # failure-threshold: 'never'
253 # unstable-threshold: 'FAILURE'
256 - trigger-parameterized-builds:
257 - project: 'genesis-foreman-daily-{stream}'
258 trigger-with-no-params: true
261 name: 'genesis-fuel-deploy-runner-{stream}'
263 project-type: freestyle
272 artifactDaysToKeep: -1
273 artifactNumToKeep: -1
278 - genesis-fuel-parameter:
279 installer: '{installer}'
280 gs-pathname: '{gs-pathname}'
283 default: ssh://gerrit.opnfv.org:29418/$PROJECT
284 description: "Used for overriding the GIT URL coming from parameters macro."
288 credentials-id: '{ssh-credentials}'
294 use-build-blocker: true
296 - "genesis-foreman-daily.*"
297 - "genesis-foreman-deploy-runner-{stream}"
298 - "genesis-fuel-daily.*"
301 - 'fuel-lab-reconfig'
303 - project: 'genesis-fuel-deploy-{stream}'
308 name: 'genesis-fuel-build-{stream}'
310 project-type: freestyle
317 artifactDaysToKeep: -1
318 artifactNumToKeep: -1
323 - genesis-fuel-parameter:
324 installer: '{installer}'
325 gs-pathname: '{gs-pathname}'
329 credentials-id: '{ssh-credentials}'
335 - 'fuel-upload-artifact'
336 - 'fuel-workspace-cleanup'
340 recipients: jonas.bjurel@ericsson.com stefan.k.berg@ericsson.com
343 name: 'genesis-fuel-deploy-{stream}'
345 project-type: freestyle
354 - genesis-fuel-parameter:
355 installer: '{installer}'
356 gs-pathname: '{gs-pathname}'
359 default: ssh://gerrit.opnfv.org:29418/$PROJECT
360 description: "POD2 has some issues with cloning using https so that's why GIT_BASE is overriden here again."
364 credentials-id: '{ssh-credentials}'
371 artifactDaysToKeep: -1
372 artifactNumToKeep: -1
375 - 'fuel-download-artifact'
380 recipients: jonas.bjurel@ericsson.com stefan.k.berg@ericsson.com
383 name: 'genesis-fuel-lab-reconfig-{stream}'
385 project-type: freestyle
394 artifactDaysToKeep: -1
395 artifactNumToKeep: -1
400 - genesis-fuel-parameter:
401 installer: '{installer}'
402 gs-pathname: '{gs-pathname}'
405 default: ssh://gerrit.opnfv.org:29418/$PROJECT
406 description: "Used for overriding the GIT URL coming from parameters macro."
410 credentials-id: '{ssh-credentials}'
416 use-build-blocker: true
418 - "genesis-foreman-daily.*"
421 - 'fuel-lab-reconfig'
424 name: 'genesis-fuel-verify-deploy-virtual-{stream}'
426 project-type: freestyle
435 - genesis-fuel-parameter:
436 installer: '{installer}'
441 credentials-id: '{ssh-credentials}'
448 artifactDaysToKeep: -1
449 artifactNumToKeep: -1
452 - 'fuel-deploy-virtual'
454 ########################
456 ########################
458 name: genesis-fuel-parameter
462 default: '{installer}'
463 description: "Installer to use."
465 name: BUILD_DIRECTORY
466 default: $WORKSPACE/build_output
467 description: "Directory where the build artifact will be located upon the completion of the build."
469 name: CACHE_DIRECTORY
470 default: $HOME/opnfv/cache/genesis-$INSTALLER
471 description: "Directory where the cache to be used during the build is located."
474 default: https://gerrit.opnfv.org/gerrit/$PROJECT
475 description: "Used for overriding the GIT URL coming from Global Jenkins configuration in case if the stuff is done on none-LF HW."
478 default: artifacts.opnfv.org/$PROJECT/$INSTALLER{gs-pathname}
479 description: "URL to Google Storage."
481 ########################
483 ########################
493 # log info to console
494 echo "Starting the build of $INSTALLER. This could take some time..."
495 echo "--------------------------------------------------------"
498 # create the cache directory if it doesn't exist
499 [[ -d $CACHE_DIRECTORY ]] || mkdir -p $CACHE_DIRECTORY
501 # set OPNFV_ARTIFACT_VERSION
502 export OPNFV_ARTIFACT_VERSION=$(date -u +"%Y-%m-%d_%H-%M-%S")
505 cd $WORKSPACE/$INSTALLER/ci
506 ./build.sh -v $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY $BUILD_DIRECTORY
508 # list the build artifacts
509 ls -al $BUILD_DIRECTORY
511 # save information regarding artifact into file
513 echo "OPNFV_ARTIFACT_VERSION=$OPNFV_ARTIFACT_VERSION"
514 echo "OPNFV_GIT_URL=$(git config --get remote.origin.url)"
515 echo "OPNFV_GIT_SHA1=$(git rev-parse HEAD)"
516 echo "OPNFV_ARTIFACT_URL=$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
517 echo "OPNFV_ARTIFACT_MD5SUM=$(md5sum $BUILD_DIRECTORY/opnfv-$OPNFV_ARTIFACT_VERSION.iso | cut -d' ' -f1)"
518 echo "OPNFV_BUILD_URL=$BUILD_URL"
519 ) > $WORKSPACE/opnfv.properties
522 echo "--------------------------------------------------------"
534 # source the file so we get OPNFV vars
535 source latest.properties
537 # echo the info about artifact that is used during the deployment
538 echo "Using $(echo $OPNFV_ARTIFACT_URL | cut -d'/' -f4) for deployment"
540 # create TMPDIR if it doesn't exist
541 export TMPDIR=$HOME/tmpdir
542 [[ -d $TMPDIR ]] || mkdir -p $TMPDIR
544 # change permissions down to TMPDIR
548 # set CONFDIR, BRIDGE
549 export CONFDIR=$WORKSPACE/fuel/deploy/templates/hardware_environment/conf/linux_foundation_lab/pod2
553 sudo $WORKSPACE/common/ci/clean.sh -base_config $WORKSPACE/foreman/ci/inventory/lf_pod2_ksgen_settings.yml
555 # prepare for Fuel Deployment
556 sudo $WORKSPACE/common/ci/setup.sh
558 # log info to console
559 echo "Starting the deployment using $INSTALLER. This could take some time..."
560 echo "--------------------------------------------------------"
563 # start the deployment
564 echo "Issuing command"
565 echo "sudo $WORKSPACE/fuel/ci/deploy.sh -iso $WORKSPACE/opnfv.iso -dea $CONFDIR/dea.yaml -dha $CONFDIR/dha.yaml -s $TMPDIR -b $BRIDGE -nh"
566 sudo $WORKSPACE/fuel/ci/deploy.sh -iso $WORKSPACE/opnfv.iso -dea $CONFDIR/dea.yaml -dha $CONFDIR/dha.yaml -s $TMPDIR -b $BRIDGE -nh
569 echo "--------------------------------------------------------"
573 name: 'fuel-deploy-virtual'
581 # log info to console
582 echo "Starting the deployment on virtual environment using $INSTALLER. This could take some time..."
583 echo "--------------------------------------------------------"
586 ssh -o BatchMode=yes -o TCPKeepAlive=yes cideploy@10.118.34.205 ./cideploy.sh
589 echo "--------------------------------------------------------"
593 name: 'fuel-upload-artifact'
601 # log info to console
602 echo "Uploading the $INSTALLER artifact. This could take some time..."
603 echo "--------------------------------------------------------"
606 # source the opnfv.properties to get ARTIFACT_VERSION
607 source $WORKSPACE/opnfv.properties
609 # upload artifact and additional files to google storage
610 gsutil cp $BUILD_DIRECTORY/opnfv-$OPNFV_ARTIFACT_VERSION.iso gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso > gsutil.iso.log 2>&1
611 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.properties > gsutil.properties.log 2>&1
612 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/latest.properties > gsutil.latest.log 2>&1
615 echo "--------------------------------------------------------"
617 echo "Artifact is available as http://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
620 name: 'fuel-download-artifact'
628 # get the latest.properties file in order to get info regarding latest artifact
629 curl -s -o $WORKSPACE/latest.properties http://$GS_URL/latest.properties
631 # check if we got the file
632 [[ -f latest.properties ]] || exit 1
634 # source the file so we get OPNFV vars
635 source latest.properties
637 # log info to console
638 echo "Downloading the $INSTALLER artifact using URL http://$OPNFV_ARTIFACT_URL"
639 echo "This could take some time..."
640 echo "--------------------------------------------------------"
644 curl -s -o $WORKSPACE/opnfv.iso http://$OPNFV_ARTIFACT_URL > gsutil.iso.log 2>&1
647 ls -al $WORKSPACE/opnfv.iso
650 echo "--------------------------------------------------------"
654 name: 'fuel-workspace-cleanup'
662 # delete everything that is in $WORKSPACE
663 /bin/rm -rf $WORKSPACE
666 name: 'fuel-lab-reconfig'
674 # check to see if ucs login info file exists
675 if [ -e ~/.ssh/ucs_creds ];then
676 source ~/.ssh/ucs_creds
678 echo "Unable to find UCS credentials for LF lab reconfiguration...Exiting"
683 echo "Cloning releng repo..."
684 if ! GIT_SSL_NO_VERIFY=true git clone https://gerrit.opnfv.org/gerrit/releng; then
685 echo "Unable to clone releng repo...Exiting"
689 # log info to console
690 echo "Starting the lab reconfiguration for $INSTALLER..."
691 echo "--------------------------------------------------------"
695 $WORKSPACE/releng/utils/lab-reconfiguration/create_venv.sh
697 # disable nounset because 'activate' script contains unbound variable(s)
700 source $WORKSPACE/releng/utils/lab-reconfiguration/venv/bin/activate
701 # set nounset back again
704 # verify we are in venv
705 if [[ ! $(which python | grep venv) ]]; then
706 echo "Unable to activate venv...Exiting"
710 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
712 # while undergoing reboot
715 # check to see if slave is back up
718 while [ "$ping_counter" -lt 20 ]; do
719 if [[ $(ping -c 5 172.30.10.72) ]]; then
727 if [ "$ping_flag" -eq 1 ]; then
728 echo "Slave is pingable, now wait 180 seconds for services to start"
731 echo "Slave did not come back up after reboot: please check opnfv-jump-2"
739 echo "--------------------------------------------------------"
742 ########################
744 ########################
746 name: 'genesis-fuel-master-trigger'
751 name: 'genesis-fuel-stable-arno-trigger'