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}'
269 ########################
271 ########################
273 name: foreman-parameter
277 default: '{installer}'
278 description: "Installer to use."
280 name: BUILD_DIRECTORY
281 default: $WORKSPACE/build_output
282 description: "Directory where the build artifact will be located upon the completion of the build."
284 name: CACHE_DIRECTORY
285 default: $HOME/opnfv/cache/genesis-$INSTALLER{gs-pathname}
286 description: "Directory where the cache to be used during the build is located."
289 default: https://gerrit.opnfv.org/gerrit/$PROJECT
290 description: "Used for overriding the GIT URL coming from Global Jenkins configuration in case if the stuff is done on none-LF HW."
293 default: artifacts.opnfv.org/$PROJECT/$INSTALLER{gs-pathname}
294 description: "URL to Google Storage."
296 ########################
298 ########################
300 name: 'foreman-build'
308 # log info to console
309 echo "Starting the build of $INSTALLER. This could take some time..."
310 echo "--------------------------------------------------------"
313 # create the cache directory if it doesn't exist
314 [[ -d $CACHE_DIRECTORY ]] || mkdir -p $CACHE_DIRECTORY
316 # set OPNFV_ARTIFACT_VERSION
317 export OPNFV_ARTIFACT_VERSION=$(date -u +"%Y-%m-%d_%H-%M-%S")
320 cd $WORKSPACE/$INSTALLER/ci
321 ./build.sh -v $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY $BUILD_DIRECTORY
323 # list the contents of BUILD_OUTPUT directory
324 ls -al $BUILD_DIRECTORY
326 # save information regarding artifact into file
328 echo "OPNFV_ARTIFACT_VERSION=$OPNFV_ARTIFACT_VERSION"
329 echo "OPNFV_GIT_URL=$(git config --get remote.origin.url)"
330 echo "OPNFV_GIT_SHA1=$(git rev-parse HEAD)"
331 echo "OPNFV_ARTIFACT_URL=$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
332 echo "OPNFV_ARTIFACT_MD5SUM=$(md5sum $BUILD_DIRECTORY/OPNFV-CentOS-7-x86_64-$OPNFV_ARTIFACT_VERSION.iso | cut -d' ' -f1)"
333 echo "OPNFV_BUILD_URL=$BUILD_URL"
334 ) > $WORKSPACE/opnfv.properties
337 echo "--------------------------------------------------------"
341 name: 'foreman-deploy'
349 # log info to console
350 echo "Starting the deployment using $INSTALLER. This could take some time..."
351 echo "--------------------------------------------------------"
355 sudo $WORKSPACE/$INSTALLER/ci/clean.sh -base_config $WORKSPACE/$INSTALLER/ci/inventory/lf_pod2_ksgen_settings.yml
357 # and then initiate deployment
358 sudo $WORKSPACE/$INSTALLER/ci/deploy.sh -base_config $WORKSPACE/$INSTALLER/ci/inventory/lf_pod2_ksgen_settings.yml
361 echo "--------------------------------------------------------"
365 name: 'foreman-upload-artifact'
373 # log info to console
374 echo "Uploading the $INSTALLER artifact. This could take some time..."
375 echo "--------------------------------------------------------"
378 # source the opnfv.properties to get ARTIFACT_VERSION
379 source $WORKSPACE/opnfv.properties
381 # upload artifact and additional files to google storage
382 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
383 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.properties > gsutil.properties.log 2>&1
384 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/latest.properties > gsutil.latest.log 2>&1
387 echo "--------------------------------------------------------"
389 echo "Artifact is available as http://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
392 name: 'foreman-workspace-cleanup'
400 # delete everything that is in $WORKSPACE
401 /bin/rm -rf $WORKSPACE
403 ########################
405 ########################
407 name: 'foreman-master'
409 - pollscm: '0 21 * * *'
412 name: 'foreman-stable-arno'
414 - pollscm: '0 3 * * *'