1 ########################
2 # Job configuration for genesis/foreman
3 ########################
13 - 'genesis-foreman-verify-{stream}'
14 - 'genesis-foreman-merge'
15 - 'genesis-foreman-daily-master'
16 - 'genesis-foreman-build'
17 - 'genesis-foreman-deploy'
19 # stream: branch with - in place of / (eg. stable-arno)
20 # branch: branch (eg. stable/arno)
27 ########################
29 ########################
32 name: 'genesis-foreman-verify-{stream}'
34 project-type: freestyle
48 artifactDaysToKeep: -1
57 installer: '{installer}'
61 credentials-id: '{ssh-credentials}'
62 refspec: '$GERRIT_REFSPEC'
63 choosing-strategy: 'gerrit'
66 - ssh-agent-credentials:
67 user: '{ssh-credentials}'
72 - patchset-created-event:
73 exclude-drafts: 'false'
74 exclude-trivial-rebase: 'false'
75 exclude-no-code-change: 'false'
76 - draft-published-event
77 - comment-added-contains-event:
78 comment-contains-value: 'recheck'
79 - comment-added-contains-event:
80 comment-contains-value: 'reverify'
82 - project-compare-type: 'ANT'
83 project-pattern: 'genesis'
85 - branch-compare-type: 'ANT'
86 branch-pattern: '**/{branch}'
91 pattern: '{installer}/**'
95 - 'foreman-workspace-cleanup'
98 name: 'genesis-foreman-merge'
100 project-type: freestyle
114 artifactDaysToKeep: -1
123 installer: '{installer}'
126 - gerrit-trigger-scm:
127 credentials-id: '{ssh-credentials}'
129 choosing-strategy: 'default'
132 - ssh-agent-credentials:
133 user: '{ssh-credentials}'
138 - change-merged-event
139 - comment-added-contains-event:
140 comment-contains-value: 'remerge'
142 - project-compare-type: 'ANT'
143 project-pattern: 'genesis'
145 - branch-compare-type: 'ANT'
146 branch-pattern: '**/master'
151 pattern: '{installer}/**'
155 - 'foreman-workspace-cleanup'
158 name: 'genesis-foreman-daily-master'
160 project-type: freestyle
170 installer: '{installer}'
174 credentials-id: '{ssh-credentials}'
181 artifactDaysToKeep: -1
182 artifactNumToKeep: -1
186 - project: 'genesis-foreman-build'
190 - project: 'genesis-foreman-deploy'
194 - project: 'functest-opnfv-jump-2'
198 name: 'genesis-foreman-build'
200 project-type: freestyle
207 artifactDaysToKeep: -1
208 artifactNumToKeep: -1
214 installer: '{installer}'
218 credentials-id: '{ssh-credentials}'
224 - 'foreman-upload-artifact'
227 name: 'genesis-foreman-deploy'
229 project-type: freestyle
238 artifactDaysToKeep: -1
239 artifactNumToKeep: -1
245 installer: '{installer}'
248 default: ssh://gerrit.opnfv.org:29418/$PROJECT
249 description: "Used for overriding the GIT URL coming from parameters macro."
253 credentials-id: '{ssh-credentials}'
260 ########################
262 ########################
264 name: foreman-parameter
268 default: '{installer}'
269 description: "Installer to use."
271 name: BUILD_DIRECTORY
272 default: $WORKSPACE/build_output
273 description: "Directory where the build artifact will be located upon the completion of the build."
275 name: CACHE_DIRECTORY
276 default: $HOME/opnfv/cache/genesis-$INSTALLER
277 description: "Directory where the cache to be used during the build is located."
280 default: https://gerrit.opnfv.org/gerrit/$PROJECT
281 description: "Used for overriding the GIT URL coming from Global Jenkins configuration in case if the stuff is done on none-LF HW."
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 "--------------------------------------------------------"
382 name: 'foreman-workspace-cleanup'
390 # delete everything that is in $WORKSPACE
391 /bin/rm -rf $WORKSPACE