1 ########################
2 # Job configuration for genesis/foreman
3 ########################
13 - 'genesis-foreman-verify'
14 - 'genesis-foreman-merge'
15 - 'genesis-foreman-daily-{stream}'
16 - 'genesis-foreman-build'
17 - 'genesis-foreman-deploy'
23 ########################
25 ########################
28 name: 'genesis-foreman-verify'
30 project-type: freestyle
44 artifactDaysToKeep: -1
53 installer: '{installer}'
57 credentials-id: '{ssh-credentials}'
58 refspec: '$GERRIT_REFSPEC'
59 choosing-strategy: 'gerrit'
62 - ssh-agent-credentials:
63 user: '{ssh-credentials}'
68 - patchset-created-event:
69 exclude-drafts: 'false'
70 exclude-trivial-rebase: 'false'
71 exclude-no-code-change: 'false'
72 - draft-published-event
73 - comment-added-contains-event:
74 comment-contains-value: 'recheck'
75 - comment-added-contains-event:
76 comment-contains-value: 'reverify'
78 - project-compare-type: 'ANT'
79 project-pattern: 'genesis'
81 - branch-compare-type: 'ANT'
82 branch-pattern: '**/master'
87 pattern: '{installer}/**'
93 name: 'genesis-foreman-merge'
95 project-type: freestyle
102 artifactDaysToKeep: -1
111 installer: '{installer}'
114 - gerrit-trigger-scm:
115 credentials-id: '{ssh-credentials}'
117 choosing-strategy: 'default'
120 - ssh-agent-credentials:
121 user: '{ssh-credentials}'
126 - change-merged-event
127 - comment-added-contains-event:
128 comment-contains-value: 'remerge'
130 - project-compare-type: 'ANT'
131 project-pattern: 'genesis'
133 - branch-compare-type: 'ANT'
134 branch-pattern: '**/master'
139 pattern: '{installer}/**'
145 name: 'genesis-foreman-daily-{stream}'
147 project-type: freestyle
157 installer: '{installer}'
161 credentials-id: '{ssh-credentials}'
171 artifactDaysToKeep: -1
172 artifactNumToKeep: -1
176 - project: 'genesis-foreman-build'
180 - project: 'genesis-foreman-deploy'
184 - project: 'functest-opnfv-jump-2'
188 name: 'genesis-foreman-build'
190 project-type: freestyle
197 artifactDaysToKeep: -1
198 artifactNumToKeep: -1
204 installer: '{installer}'
208 credentials-id: '{ssh-credentials}'
214 - 'foreman-upload-artifact'
217 name: 'genesis-foreman-deploy'
219 project-type: freestyle
228 artifactDaysToKeep: -1
229 artifactNumToKeep: -1
235 installer: '{installer}'
239 credentials-id: '{ssh-credentials}'
246 ########################
248 ########################
250 name: foreman-parameter
254 default: '{installer}'
255 description: "Installer to use."
257 name: BUILD_DIRECTORY
258 default: $WORKSPACE/build_output
259 description: "Directory where the build artifact will be located upon the completion of the build."
261 name: CACHE_DIRECTORY
262 default: $HOME/opnfv/cache/genesis-$INSTALLER
263 description: "Directory where the cache to be used during the build is located."
266 default: https://gerrit.opnfv.org/gerrit/$PROJECT
267 description: "Used for overriding the GIT URL coming from Global Jenkins configuration in case if the stuff is done on none-LF HW."
270 default: artifacts.opnfv.org/$PROJECT/$INSTALLER
271 description: "URL to Google Storage."
273 ########################
275 ########################
277 name: 'foreman-build'
285 # log info to console
286 echo "Starting the build of $INSTALLER. This could take some time..."
287 echo "--------------------------------------------------------"
290 # create the cache directory if it doesn't exist
291 [[ -d $CACHE_DIRECTORY ]] || mkdir -p $CACHE_DIRECTORY
293 # set OPNFV_ARTIFACT_VERSION
294 export OPNFV_ARTIFACT_VERSION=$(date -u +"%Y-%m-%d_%H-%M-%S")
297 cd $WORKSPACE/$INSTALLER/ci
298 ./build.sh -v $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY $BUILD_DIRECTORY
300 # list the contents of BUILD_OUTPUT directory
301 ls -al $BUILD_DIRECTORY
303 # save information regarding artifact into file
305 echo "OPNFV_ARTIFACT_VERSION=$OPNFV_ARTIFACT_VERSION"
306 echo "OPNFV_GIT_URL=$(git config --get remote.origin.url)"
307 echo "OPNFV_GIT_SHA1=$(git rev-parse HEAD)"
308 echo "OPNFV_ARTIFACT_URL=$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
309 echo "OPNFV_ARTIFACT_MD5SUM=$(md5sum $BUILD_DIRECTORY/OPNFV-CentOS-7-x86_64-$OPNFV_ARTIFACT_VERSION.iso | cut -d' ' -f1)"
310 echo "OPNFV_BUILD_URL=$BUILD_URL"
311 ) > $WORKSPACE/opnfv.properties
314 echo "--------------------------------------------------------"
318 name: 'foreman-deploy'
326 # log info to console
327 echo "Starting the deployment using $INSTALLER. This could take some time..."
328 echo "--------------------------------------------------------"
332 sudo $WORKSPACE/$INSTALLER/ci/clean.sh -base_config $WORKSPACE/$INSTALLER/ci/inventory/lf_pod2_ksgen_settings.yml
334 # and then initiate deployment
335 sudo $WORKSPACE/$INSTALLER/ci/deploy.sh -base_config $WORKSPACE/$INSTALLER/ci/inventory/lf_pod2_ksgen_settings.yml
338 echo "--------------------------------------------------------"
342 name: 'foreman-upload-artifact'
350 # log info to console
351 echo "Uploading the $INSTALLER artifact. This could take some time..."
352 echo "--------------------------------------------------------"
355 # source the opnfv.properties to get ARTIFACT_VERSION
356 source $WORKSPACE/opnfv.properties
358 # upload artifact and additional files to google storage
359 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
360 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.properties > gsutil.properties.log 2>&1
361 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/latest.properties > gsutil.latest.log 2>&1
364 echo "--------------------------------------------------------"