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 - 'foreman-workspace-cleanup'
159 name: 'genesis-foreman-daily-{stream}'
161 project-type: freestyle
171 installer: '{installer}'
172 gs-pathname: '{gs-pathname}'
175 credentials-id: '{ssh-credentials}'
182 artifactDaysToKeep: -1
183 artifactNumToKeep: -1
187 - project: 'genesis-foreman-build-{stream}'
191 - project: 'genesis-foreman-deploy-{stream}'
195 - project: 'functest-opnfv-jump-2'
199 name: 'genesis-foreman-build-{stream}'
201 project-type: freestyle
208 artifactDaysToKeep: -1
209 artifactNumToKeep: -1
215 installer: '{installer}'
216 gs-pathname: '{gs-pathname}'
219 credentials-id: '{ssh-credentials}'
225 - 'foreman-upload-artifact'
228 name: 'genesis-foreman-deploy-{stream}'
230 project-type: freestyle
239 artifactDaysToKeep: -1
240 artifactNumToKeep: -1
246 installer: '{installer}'
247 gs-pathname: '{gs-pathname}'
250 default: ssh://gerrit.opnfv.org:29418/$PROJECT
251 description: "Used for overriding the GIT URL coming from parameters macro."
255 credentials-id: '{ssh-credentials}'
262 ########################
264 ########################
266 name: foreman-parameter
270 default: '{installer}'
271 description: "Installer to use."
273 name: BUILD_DIRECTORY
274 default: $WORKSPACE/build_output
275 description: "Directory where the build artifact will be located upon the completion of the build."
277 name: CACHE_DIRECTORY
278 default: $HOME/opnfv/cache/genesis-$INSTALLER{gs-pathname}
279 description: "Directory where the cache to be used during the build is located."
282 default: https://gerrit.opnfv.org/gerrit/$PROJECT
283 description: "Used for overriding the GIT URL coming from Global Jenkins configuration in case if the stuff is done on none-LF HW."
286 default: artifacts.opnfv.org/$PROJECT/$INSTALLER{gs-pathname}
287 description: "URL to Google Storage."
289 ########################
291 ########################
293 name: 'foreman-build'
301 # log info to console
302 echo "Starting the build of $INSTALLER. This could take some time..."
303 echo "--------------------------------------------------------"
306 # create the cache directory if it doesn't exist
307 [[ -d $CACHE_DIRECTORY ]] || mkdir -p $CACHE_DIRECTORY
309 # set OPNFV_ARTIFACT_VERSION
310 export OPNFV_ARTIFACT_VERSION=$(date -u +"%Y-%m-%d_%H-%M-%S")
313 cd $WORKSPACE/$INSTALLER/ci
314 ./build.sh -v $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY $BUILD_DIRECTORY
316 # list the contents of BUILD_OUTPUT directory
317 ls -al $BUILD_DIRECTORY
319 # save information regarding artifact into file
321 echo "OPNFV_ARTIFACT_VERSION=$OPNFV_ARTIFACT_VERSION"
322 echo "OPNFV_GIT_URL=$(git config --get remote.origin.url)"
323 echo "OPNFV_GIT_SHA1=$(git rev-parse HEAD)"
324 echo "OPNFV_ARTIFACT_URL=$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
325 echo "OPNFV_ARTIFACT_MD5SUM=$(md5sum $BUILD_DIRECTORY/OPNFV-CentOS-7-x86_64-$OPNFV_ARTIFACT_VERSION.iso | cut -d' ' -f1)"
326 echo "OPNFV_BUILD_URL=$BUILD_URL"
327 ) > $WORKSPACE/opnfv.properties
330 echo "--------------------------------------------------------"
334 name: 'foreman-deploy'
342 # log info to console
343 echo "Starting the deployment using $INSTALLER. This could take some time..."
344 echo "--------------------------------------------------------"
348 sudo $WORKSPACE/$INSTALLER/ci/clean.sh -base_config $WORKSPACE/$INSTALLER/ci/inventory/lf_pod2_ksgen_settings.yml
350 # and then initiate deployment
351 sudo $WORKSPACE/$INSTALLER/ci/deploy.sh -base_config $WORKSPACE/$INSTALLER/ci/inventory/lf_pod2_ksgen_settings.yml
354 echo "--------------------------------------------------------"
358 name: 'foreman-upload-artifact'
366 # log info to console
367 echo "Uploading the $INSTALLER artifact. This could take some time..."
368 echo "--------------------------------------------------------"
371 # source the opnfv.properties to get ARTIFACT_VERSION
372 source $WORKSPACE/opnfv.properties
374 # upload artifact and additional files to google storage
375 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
376 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.properties > gsutil.properties.log 2>&1
377 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/latest.properties > gsutil.latest.log 2>&1
380 echo "--------------------------------------------------------"
384 name: 'foreman-workspace-cleanup'
392 # delete everything that is in $WORKSPACE
393 /bin/rm -rf $WORKSPACE
395 ########################
397 ########################
401 - pollscm: "0 9 * * *"
406 - pollscm: "0 21 * * *"