1 ########################
2 # Job configuration for genesis/foreman
3 ########################
13 - 'genesis-foreman-verify-{stream}'
14 - 'genesis-foreman-merge-{stream}'
15 - 'genesis-foreman-daily-{stream}'
16 - 'genesis-foreman-build-{stream}'
17 - 'genesis-foreman-deploy-{stream}'
18 - 'genesis-foreman-deploy-runner-{stream}'
20 # stream: branch with - in place of / (eg. stable-arno)
21 # branch: branch (eg. stable/arno)
29 ########################
31 ########################
34 name: 'genesis-foreman-verify-{stream}'
36 project-type: freestyle
50 artifactDaysToKeep: -1
59 installer: '{installer}'
60 gs-pathname: '{gs-pathname}'
63 credentials-id: '{ssh-credentials}'
64 refspec: '$GERRIT_REFSPEC'
65 choosing-strategy: 'gerrit'
68 - ssh-agent-credentials:
69 user: '{ssh-credentials}'
74 - patchset-created-event:
75 exclude-drafts: 'false'
76 exclude-trivial-rebase: 'false'
77 exclude-no-code-change: 'false'
78 - draft-published-event
79 - comment-added-contains-event:
80 comment-contains-value: 'recheck'
81 - comment-added-contains-event:
82 comment-contains-value: 'reverify'
84 - project-compare-type: 'ANT'
85 project-pattern: 'genesis'
87 - branch-compare-type: 'ANT'
88 branch-pattern: '**/{branch}'
93 pattern: '{installer}/**'
97 - 'foreman-workspace-cleanup'
100 name: 'genesis-foreman-merge-{stream}'
102 project-type: freestyle
116 artifactDaysToKeep: -1
125 installer: '{installer}'
128 - gerrit-trigger-scm:
129 credentials-id: '{ssh-credentials}'
131 choosing-strategy: 'default'
134 - ssh-agent-credentials:
135 user: '{ssh-credentials}'
140 - change-merged-event
141 - comment-added-contains-event:
142 comment-contains-value: 'remerge'
144 - project-compare-type: 'ANT'
145 project-pattern: 'genesis'
147 - branch-compare-type: 'ANT'
148 branch-pattern: '**/{branch}'
153 pattern: '{installer}/**'
157 - 'fuel-workspace-cleanup'
160 name: 'genesis-foreman-daily-{stream}'
162 project-type: freestyle
175 installer: '{installer}'
176 gs-pathname: '{gs-pathname}'
179 credentials-id: '{ssh-credentials}'
186 artifactDaysToKeep: -1
187 artifactNumToKeep: -1
191 - project: 'genesis-foreman-build-{stream}'
195 # - project: 'genesis-foreman-deploy-runner-{stream}'
199 # - project: 'functest-opnfv-jump-2'
202 # - project: 'yardstick-opnfv-jump-2'
206 name: 'genesis-foreman-build-{stream}'
208 project-type: freestyle
215 artifactDaysToKeep: -1
216 artifactNumToKeep: -1
222 installer: '{installer}'
223 gs-pathname: '{gs-pathname}'
226 credentials-id: '{ssh-credentials}'
232 - 'foreman-upload-artifact'
233 - 'fuel-workspace-cleanup'
236 name: 'genesis-foreman-deploy-{stream}'
238 project-type: freestyle
247 artifactDaysToKeep: -1
248 artifactNumToKeep: -1
254 installer: '{installer}'
255 gs-pathname: '{gs-pathname}'
258 default: ssh://gerrit.opnfv.org:29418/$PROJECT
259 description: "Used for overriding the GIT URL coming from parameters macro."
263 credentials-id: '{ssh-credentials}'
271 name: 'genesis-foreman-deploy-runner-{stream}'
273 project-type: freestyle
282 artifactDaysToKeep: -1
283 artifactNumToKeep: -1
289 installer: '{installer}'
290 gs-pathname: '{gs-pathname}'
293 default: ssh://gerrit.opnfv.org:29418/$PROJECT
294 description: "Used for overriding the GIT URL coming from parameters macro."
298 credentials-id: '{ssh-credentials}'
303 - 'foreman-lab-reconfig'
305 - project: 'genesis-foreman-deploy-{stream}'
309 ########################
311 ########################
313 name: foreman-parameter
317 default: '{installer}'
318 description: "Installer to use."
320 name: BUILD_DIRECTORY
321 default: $WORKSPACE/build_output
322 description: "Directory where the build artifact will be located upon the completion of the build."
324 name: CACHE_DIRECTORY
325 default: $HOME/opnfv/cache/genesis-$INSTALLER{gs-pathname}
326 description: "Directory where the cache to be used during the build is located."
329 default: https://gerrit.opnfv.org/gerrit/$PROJECT
330 description: "Used for overriding the GIT URL coming from Global Jenkins configuration in case if the stuff is done on none-LF HW."
333 default: artifacts.opnfv.org/$PROJECT/$INSTALLER{gs-pathname}
334 description: "URL to Google Storage."
336 ########################
338 ########################
340 name: 'foreman-lab-reconfig'
348 # check to see if ucs login info file exists
349 if [ -e ~/.ssh/ucs_creds ];then
350 source ~/.ssh/ucs_creds
352 echo "Unable to find UCS credentials for LF lab reconfiguration...Exiting"
357 echo "Cloning releng repo..."
358 if ! GIT_SSL_NO_VERIFY=true git clone https://gerrit.opnfv.org/gerrit/releng; then
359 echo "Unable to clone releng repo...Exiting"
363 # log info to console
364 echo "Starting the lab reconfiguration for $INSTALLER..."
365 echo "--------------------------------------------------------"
369 $WORKSPACE/releng/utils/lab-reconfiguration/create_venv.sh
371 # disable nounset because 'activate' script contains unbound variable(s)
374 source $WORKSPACE/releng/utils/lab-reconfiguration/venv/bin/activate
375 # set nounset back again
378 # verify we are in venv
379 if [[ ! $(which python | grep venv) ]]; then
380 echo "Unable to activate venv...Exiting"
384 python $WORKSPACE/releng/utils/lab-reconfiguration/reconfigUcsNet.py -i $ucs_host -u $ucs_user -p $ucs_password -f $WORKSPACE/releng/utils/lab-reconfiguration/foreman.yaml
386 # while undergoing reboot
389 # check to see if slave is back up
392 while [ "$ping_counter" -lt 20 ]; do
393 if [[ $(ping -c 5 172.30.10.72) ]]; then
401 if [ "$ping_flag" -eq 1 ]; then
402 echo "Slave is pingable, now wait 60 seconds for services to start"
405 echo "Slave did not come back up after reboot: please check opnfv-jump-2"
413 echo "--------------------------------------------------------"
417 name: 'foreman-build'
425 # log info to console
426 echo "Starting the build of $INSTALLER. This could take some time..."
427 echo "--------------------------------------------------------"
430 # create the cache directory if it doesn't exist
431 [[ -d $CACHE_DIRECTORY ]] || mkdir -p $CACHE_DIRECTORY
433 # set OPNFV_ARTIFACT_VERSION
434 export OPNFV_ARTIFACT_VERSION=$(date -u +"%Y-%m-%d_%H-%M-%S")
437 cd $WORKSPACE/$INSTALLER/ci
438 ./build.sh -v $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY $BUILD_DIRECTORY
440 # list the contents of BUILD_OUTPUT directory
441 ls -al $BUILD_DIRECTORY
443 # save information regarding artifact into file
445 echo "OPNFV_ARTIFACT_VERSION=$OPNFV_ARTIFACT_VERSION"
446 echo "OPNFV_GIT_URL=$(git config --get remote.origin.url)"
447 echo "OPNFV_GIT_SHA1=$(git rev-parse HEAD)"
448 echo "OPNFV_ARTIFACT_URL=$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
449 echo "OPNFV_ARTIFACT_MD5SUM=$(md5sum $BUILD_DIRECTORY/OPNFV-CentOS-7-x86_64-$OPNFV_ARTIFACT_VERSION.iso | cut -d' ' -f1)"
450 echo "OPNFV_BUILD_URL=$BUILD_URL"
451 ) > $WORKSPACE/opnfv.properties
454 echo "--------------------------------------------------------"
458 name: 'foreman-deploy'
466 # log info to console
467 echo "Starting the deployment using $INSTALLER. This could take some time..."
468 echo "--------------------------------------------------------"
472 sudo $WORKSPACE/common/ci/clean.sh -base_config $WORKSPACE/$INSTALLER/ci/inventory/lf_pod2_ksgen_settings.yml
474 # and then initiate deployment
475 sudo $WORKSPACE/$INSTALLER/ci/deploy.sh -base_config $WORKSPACE/$INSTALLER/ci/inventory/lf_pod2_ksgen_settings.yml
478 echo "--------------------------------------------------------"
482 name: 'foreman-upload-artifact'
490 # log info to console
491 echo "Uploading the $INSTALLER artifact. This could take some time..."
492 echo "--------------------------------------------------------"
495 # source the opnfv.properties to get ARTIFACT_VERSION
496 source $WORKSPACE/opnfv.properties
498 # upload artifact and additional files to google storage
499 gsutil cp $BUILD_DIRECTORY/OPNFV-CentOS-7-x86_64-$OPNFV_ARTIFACT_VERSION.iso gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso > gsutil.iso.log 2>&1
500 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.properties > gsutil.properties.log 2>&1
501 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/latest.properties > gsutil.latest.log 2>&1
504 echo "--------------------------------------------------------"
506 echo "Artifact is available as http://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
509 name: 'foreman-workspace-cleanup'
517 # delete everything that is in $WORKSPACE
518 /bin/rm -rf $WORKSPACE
520 ########################
522 ########################
524 name: 'foreman-master'
526 - pollscm: '0 21 * * *'
529 name: 'foreman-stable-arno'
531 - pollscm: '0 3 * * *'