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
51 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
108 - foreman-parameters:
109 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
156 - foreman-parameters:
157 installer: '{installer}'
165 refspec: $GERRIT_REFSPEC
168 - pollscm: '@midnight'
173 artifactDaysToKeep: -1
174 artifactNumToKeep: -1
178 - project: 'genesis-foreman-build'
182 - project: 'genesis-foreman-deploy'
186 - project: 'functest-opnfv-jump-2'
190 name: 'genesis-foreman-build'
192 project-type: freestyle
199 artifactDaysToKeep: -1
200 artifactNumToKeep: -1
205 - foreman-parameters:
206 installer: '{installer}'
214 refspec: $GERRIT_REFSPEC
218 - 'foreman-upload-artifact'
221 name: 'genesis-foreman-deploy'
223 project-type: freestyle
232 artifactDaysToKeep: -1
233 artifactNumToKeep: -1
238 - foreman-parameters:
239 installer: '{installer}'
247 refspec: $GERRIT_REFSPEC
252 ########################
254 ########################
256 name: foreman-parameters
260 default: '{installer}'
261 description: "Installer to use."
263 name: BUILD_DIRECTORY
264 default: $WORKSPACE/build_output
265 description: "Directory where the build artifact will be located upon the completion of the build."
267 name: CACHE_DIRECTORY
268 default: $HOME/opnfv/cache/genesis-$INSTALLER
269 description: "Directory where the cache to be used during the build is located."
272 default: https://gerrit.opnfv.org/gerrit/$PROJECT
273 description: "Used for overriding the GIT URL coming from Global Jenkins configuration in case if the stuff is done on none-LF HW."
276 default: origin/master
277 description: "Branch to build, deploy and test."
280 default: refs/heads/master
281 description: "Refspec to retrieve."
284 default: artifacts.opnfv.org/$PROJECT/$INSTALLER
285 description: "URL to Google Storage."
287 ########################
289 ########################
291 name: 'foreman-build'
299 # log info to console
300 echo "Starting the build of $INSTALLER. This could take some time..."
301 echo "--------------------------------------------------------"
304 # create the cache directory if it doesn't exist
305 [[ -d $CACHE_DIRECTORY ]] || mkdir -p $CACHE_DIRECTORY
307 # set OPNFV_ARTIFACT_VERSION
308 export OPNFV_ARTIFACT_VERSION=$(date -u +"%Y-%m-%d_%H-%M-%S")
311 cd $WORKSPACE/$INSTALLER/ci
312 ./build.sh -v $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY $BUILD_DIRECTORY
314 # list the contents of BUILD_OUTPUT directory
315 ls -al $BUILD_DIRECTORY
317 # save information regarding artifact into file
319 echo "OPNFV_ARTIFACT_VERSION=$OPNFV_ARTIFACT_VERSION"
320 echo "OPNFV_GIT_URL=$(git config --get remote.origin.url)"
321 echo "OPNFV_GIT_SHA1=$(git rev-parse HEAD)"
322 echo "OPNFV_ARTIFACT_URL=$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
323 echo "OPNFV_ARTIFACT_MD5SUM=$(md5sum $BUILD_DIRECTORY/OPNFV-CentOS-7-x86_64-$OPNFV_ARTIFACT_VERSION.iso | cut -d' ' -f1)"
324 echo "OPNFV_BUILD_URL=$BUILD_URL"
325 ) > $WORKSPACE/opnfv.properties
328 echo "--------------------------------------------------------"
332 name: 'foreman-deploy'
340 # log info to console
341 echo "Starting the deployment using $INSTALLER. This could take some time..."
342 echo "--------------------------------------------------------"
346 sudo $WORKSPACE/$INSTALLER/ci/clean.sh -base_config $WORKSPACE/$INSTALLER/ci/inventory/lf_pod2_ksgen_settings.yml
348 # and then initiate deployment
349 sudo $WORKSPACE/$INSTALLER/ci/deploy.sh -base_config $WORKSPACE/$INSTALLER/ci/inventory/lf_pod2_ksgen_settings.yml
352 echo "--------------------------------------------------------"
356 name: 'foreman-upload-artifact'
364 # log info to console
365 echo "Uploading the $INSTALLER artifact. This could take some time..."
366 echo "--------------------------------------------------------"
369 # source the opnfv.properties to get ARTIFACT_VERSION
370 source $WORKSPACE/opnfv.properties
372 # upload artifact and additional files to google storage
373 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
374 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.properties > gsutil.properties.log 2>&1
375 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/latest.properties > gsutil.latest.log 2>&1
378 echo "--------------------------------------------------------"