1 ########################
2 # Job configuration for genesis/foreman
3 ########################
13 - 'genesis-foreman-verify-{stream}'
14 - 'genesis-foreman-merge'
15 - 'genesis-foreman-daily-{stream}'
16 - 'genesis-foreman-build-{stream}'
17 - 'genesis-foreman-deploy-{stream}'
19 # stream: branch with - in place of / (eg. stable-arno)
20 # branch: branch (eg. stable/arno)
28 ########################
30 ########################
33 name: 'genesis-foreman-verify-{stream}'
35 project-type: freestyle
49 artifactDaysToKeep: -1
58 installer: '{installer}'
59 gs-pathname: '{gs-pathname}'
62 credentials-id: '{ssh-credentials}'
63 refspec: '$GERRIT_REFSPEC'
64 choosing-strategy: 'gerrit'
67 - ssh-agent-credentials:
68 user: '{ssh-credentials}'
73 - patchset-created-event:
74 exclude-drafts: 'false'
75 exclude-trivial-rebase: 'false'
76 exclude-no-code-change: 'false'
77 - draft-published-event
78 - comment-added-contains-event:
79 comment-contains-value: 'recheck'
80 - comment-added-contains-event:
81 comment-contains-value: 'reverify'
83 - project-compare-type: 'ANT'
84 project-pattern: 'genesis'
86 - branch-compare-type: 'ANT'
87 branch-pattern: '**/{branch}'
92 pattern: '{installer}/**'
96 - 'foreman-workspace-cleanup'
99 name: 'genesis-foreman-merge'
101 project-type: freestyle
115 artifactDaysToKeep: -1
124 installer: '{installer}'
127 - gerrit-trigger-scm:
128 credentials-id: '{ssh-credentials}'
130 choosing-strategy: 'default'
133 - ssh-agent-credentials:
134 user: '{ssh-credentials}'
139 - change-merged-event
140 - comment-added-contains-event:
141 comment-contains-value: 'remerge'
143 - project-compare-type: 'ANT'
144 project-pattern: 'genesis'
146 - branch-compare-type: 'ANT'
147 branch-pattern: '**/master'
152 pattern: '{installer}/**'
156 - 'fuel-workspace-cleanup'
159 name: 'genesis-foreman-daily-{stream}'
161 project-type: freestyle
174 installer: '{installer}'
175 gs-pathname: '{gs-pathname}'
178 credentials-id: '{ssh-credentials}'
185 artifactDaysToKeep: -1
186 artifactNumToKeep: -1
190 - project: 'genesis-foreman-build-{stream}'
194 - project: 'genesis-foreman-deploy-{stream}'
198 - project: 'functest-opnfv-jump-2'
201 - project: 'yardstick-opnfv-jump-2'
205 name: 'genesis-foreman-build-{stream}'
207 project-type: freestyle
214 artifactDaysToKeep: -1
215 artifactNumToKeep: -1
221 installer: '{installer}'
222 gs-pathname: '{gs-pathname}'
225 credentials-id: '{ssh-credentials}'
231 - 'foreman-upload-artifact'
232 - 'fuel-workspace-cleanup'
235 name: 'genesis-foreman-deploy-{stream}'
237 project-type: freestyle
246 artifactDaysToKeep: -1
247 artifactNumToKeep: -1
253 installer: '{installer}'
254 gs-pathname: '{gs-pathname}'
257 default: ssh://gerrit.opnfv.org:29418/$PROJECT
258 description: "Used for overriding the GIT URL coming from parameters macro."
262 credentials-id: '{ssh-credentials}'
267 - 'foreman-lab-reconfig'
270 ########################
272 ########################
274 name: foreman-parameter
278 default: '{installer}'
279 description: "Installer to use."
281 name: BUILD_DIRECTORY
282 default: $WORKSPACE/build_output
283 description: "Directory where the build artifact will be located upon the completion of the build."
285 name: CACHE_DIRECTORY
286 default: $HOME/opnfv/cache/genesis-$INSTALLER{gs-pathname}
287 description: "Directory where the cache to be used during the build is located."
290 default: https://gerrit.opnfv.org/gerrit/$PROJECT
291 description: "Used for overriding the GIT URL coming from Global Jenkins configuration in case if the stuff is done on none-LF HW."
294 default: artifacts.opnfv.org/$PROJECT/$INSTALLER{gs-pathname}
295 description: "URL to Google Storage."
297 ########################
299 ########################
301 name: 'foreman-lab-reconfig'
309 # check to see if ucs login info file exists
310 if [ -e /home/jenkins-ci/.ssh/ucs_creds ];then
311 source /home/jenkins-ci/.ssh/ucs_creds
313 echo "Unable to find UCS credentials for LF lab reconfiguration...Exiting"
318 echo "Cloning releng repo..."
319 if ! GIT_SSL_NO_VERIFY=true git clone https://gerrit.opnfv.org/gerrit/releng; then
320 echo "Unable to clone releng repo...Exiting"
324 # log info to console
325 echo "Starting the lab reconfiguration for $INSTALLER..."
326 echo "--------------------------------------------------------"
330 $WORKSPACE/releng/utils/lab-reconfiguration/create_venv.sh
332 # disable nounset because 'activate' script contains unbound variable(s)
335 source $WORKSPACE/releng/utils/lab-reconfiguration/venv/bin/activate
336 # set nounset back again
338 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
341 echo "--------------------------------------------------------"
345 name: 'foreman-build'
353 # log info to console
354 echo "Starting the build of $INSTALLER. This could take some time..."
355 echo "--------------------------------------------------------"
358 # create the cache directory if it doesn't exist
359 [[ -d $CACHE_DIRECTORY ]] || mkdir -p $CACHE_DIRECTORY
361 # set OPNFV_ARTIFACT_VERSION
362 export OPNFV_ARTIFACT_VERSION=$(date -u +"%Y-%m-%d_%H-%M-%S")
365 cd $WORKSPACE/$INSTALLER/ci
366 ./build.sh -v $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY $BUILD_DIRECTORY
368 # list the contents of BUILD_OUTPUT directory
369 ls -al $BUILD_DIRECTORY
371 # save information regarding artifact into file
373 echo "OPNFV_ARTIFACT_VERSION=$OPNFV_ARTIFACT_VERSION"
374 echo "OPNFV_GIT_URL=$(git config --get remote.origin.url)"
375 echo "OPNFV_GIT_SHA1=$(git rev-parse HEAD)"
376 echo "OPNFV_ARTIFACT_URL=$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
377 echo "OPNFV_ARTIFACT_MD5SUM=$(md5sum $BUILD_DIRECTORY/OPNFV-CentOS-7-x86_64-$OPNFV_ARTIFACT_VERSION.iso | cut -d' ' -f1)"
378 echo "OPNFV_BUILD_URL=$BUILD_URL"
379 ) > $WORKSPACE/opnfv.properties
382 echo "--------------------------------------------------------"
386 name: 'foreman-deploy'
394 # log info to console
395 echo "Starting the deployment using $INSTALLER. This could take some time..."
396 echo "--------------------------------------------------------"
400 sudo $WORKSPACE/$INSTALLER/ci/clean.sh -base_config $WORKSPACE/$INSTALLER/ci/inventory/lf_pod2_ksgen_settings.yml
402 # and then initiate deployment
403 sudo $WORKSPACE/$INSTALLER/ci/deploy.sh -base_config $WORKSPACE/$INSTALLER/ci/inventory/lf_pod2_ksgen_settings.yml
406 echo "--------------------------------------------------------"
410 name: 'foreman-upload-artifact'
418 # log info to console
419 echo "Uploading the $INSTALLER artifact. This could take some time..."
420 echo "--------------------------------------------------------"
423 # source the opnfv.properties to get ARTIFACT_VERSION
424 source $WORKSPACE/opnfv.properties
426 # upload artifact and additional files to google storage
427 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
428 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.properties > gsutil.properties.log 2>&1
429 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/latest.properties > gsutil.latest.log 2>&1
432 echo "--------------------------------------------------------"
434 echo "Artifact is available as http://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
437 name: 'foreman-workspace-cleanup'
445 # delete everything that is in $WORKSPACE
446 /bin/rm -rf $WORKSPACE
448 ########################
450 ########################
452 name: 'foreman-master'
454 - pollscm: '0 21 * * *'
457 name: 'foreman-stable-arno'
459 - pollscm: '0 3 * * *'