1 ########################
2 # Job configuration for genesis/fuel
3 ########################
13 - 'genesis-fuel-verify-{stream}'
14 - 'genesis-fuel-merge'
15 - 'genesis-fuel-daily-master'
16 - 'genesis-fuel-build'
17 - 'genesis-fuel-deploy'
18 - 'genesis-fuel-deploy-virtual'
20 # stream: branch with - in place of / (eg. stable-arno)
21 # branch: branch (eg. stable/arno)
28 ########################
30 ########################
33 name: 'genesis-fuel-verify-{stream}'
35 project-type: freestyle
49 artifactDaysToKeep: -1
58 installer: '{installer}'
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 - 'fuel-workspace-cleanup'
99 name: 'genesis-fuel-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-fuel-daily-master'
161 project-type: freestyle
171 installer: '{installer}'
175 credentials-id: '{ssh-credentials}'
182 artifactDaysToKeep: -1
183 artifactNumToKeep: -1
187 - project: 'genesis-fuel-build'
191 - project: 'genesis-fuel-deploy'
195 - project: 'functest-opnfv-jump-1'
199 name: 'genesis-fuel-build'
201 project-type: freestyle
208 artifactDaysToKeep: -1
209 artifactNumToKeep: -1
215 installer: '{installer}'
219 credentials-id: '{ssh-credentials}'
225 - 'fuel-upload-artifact'
226 - 'fuel-workspace-cleanup'
229 name: 'genesis-fuel-deploy'
231 project-type: freestyle
241 installer: '{installer}'
244 default: ssh://gerrit.opnfv.org:29418/$PROJECT
245 description: "POD1 has some issues with cloning using https so that's why GIT_BASE is overriden here again."
249 credentials-id: '{ssh-credentials}'
256 artifactDaysToKeep: -1
257 artifactNumToKeep: -1
260 - 'fuel-download-artifact'
264 name: 'genesis-fuel-deploy-virtual'
266 project-type: freestyle
276 installer: '{installer}'
280 credentials-id: '{ssh-credentials}'
287 artifactDaysToKeep: -1
288 artifactNumToKeep: -1
291 - 'fuel-deploy-virtual'
293 ########################
295 ########################
301 default: '{installer}'
302 description: "Installer to use."
304 name: BUILD_DIRECTORY
305 default: $WORKSPACE/build_output
306 description: "Directory where the build artifact will be located upon the completion of the build."
308 name: CACHE_DIRECTORY
309 default: $HOME/opnfv/cache/genesis-$INSTALLER
310 description: "Directory where the cache to be used during the build is located."
313 default: https://gerrit.opnfv.org/gerrit/$PROJECT
314 description: "Used for overriding the GIT URL coming from Global Jenkins configuration in case if the stuff is done on none-LF HW."
317 default: artifacts.opnfv.org/$PROJECT/$INSTALLER
318 description: "URL to Google Storage."
320 ########################
322 ########################
332 # log info to console
333 echo "Starting the build of $INSTALLER. This could take some time..."
334 echo "--------------------------------------------------------"
337 # create the cache directory if it doesn't exist
338 [[ -d $CACHE_DIRECTORY ]] || mkdir -p $CACHE_DIRECTORY
340 # set OPNFV_ARTIFACT_VERSION
341 export OPNFV_ARTIFACT_VERSION=$(date -u +"%Y-%m-%d_%H-%M-%S")
344 cd $WORKSPACE/$INSTALLER/ci
345 ./build.sh -v $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY $BUILD_DIRECTORY
347 # list the build artifacts
348 ls -al $BUILD_DIRECTORY
350 # save information regarding artifact into file
352 echo "OPNFV_ARTIFACT_VERSION=$OPNFV_ARTIFACT_VERSION"
353 echo "OPNFV_GIT_URL=$(git config --get remote.origin.url)"
354 echo "OPNFV_GIT_SHA1=$(git rev-parse HEAD)"
355 echo "OPNFV_ARTIFACT_URL=$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
356 echo "OPNFV_ARTIFACT_MD5SUM=$(md5sum $BUILD_DIRECTORY/opnfv-$OPNFV_ARTIFACT_VERSION.iso | cut -d' ' -f1)"
357 echo "OPNFV_BUILD_URL=$BUILD_URL"
358 ) > $WORKSPACE/opnfv.properties
361 echo "--------------------------------------------------------"
373 # source the file so we get OPNFV vars
374 source latest.properties
376 # echo the info about artifact that is used during the deployment
377 echo "Using $(echo $OPNFV_ARTIFACT_URL | cut -d'/' -f4) for deployment"
379 # create TMPDIR if it doesn't exist
380 export TMPDIR=$HOME/tmpdir
381 [[ -d $TMPDIR ]] || mkdir -p $TMPDIR
383 # change permissions down to TMPDIR
388 export TOPDIR=$WORKSPACE/fuel/prototypes/auto-deploy
390 # log info to console
391 echo "Starting the deployment using $INSTALLER. This could take some time..."
392 echo "--------------------------------------------------------"
395 # start the deployment
396 echo "Issuing command"
397 echo "sudo TMPDIR=${TMPDIR} ${TOPDIR}/deploy/deploy.sh ${WORKSPACE}/opnfv.iso ${TOPDIR}/configs/lf_pod1/dea_no-ha.yaml ${TOPDIR}/configs/lf_pod1/dha.yaml"
398 sudo TMPDIR=${TMPDIR} ${TOPDIR}/deploy/deploy.sh ${WORKSPACE}/opnfv.iso ${TOPDIR}/configs/lf_pod1/dea_no-ha.yaml ${TOPDIR}/configs/lf_pod1/dha.yaml
401 echo "--------------------------------------------------------"
405 name: 'fuel-deploy-virtual'
413 # log info to console
414 echo "Starting the deployment on virtual environment using $INSTALLER. This could take some time..."
415 echo "--------------------------------------------------------"
418 ssh -o BatchMode=yes -o TCPKeepAlive=yes cideploy@10.118.34.205 ./cideploy.sh
421 echo "--------------------------------------------------------"
425 name: 'fuel-upload-artifact'
433 # log info to console
434 echo "Uploading the $INSTALLER artifact. This could take some time..."
435 echo "--------------------------------------------------------"
438 # source the opnfv.properties to get ARTIFACT_VERSION
439 source $WORKSPACE/opnfv.properties
441 # upload artifact and additional files to google storage
442 gsutil cp $BUILD_DIRECTORY/opnfv-$OPNFV_ARTIFACT_VERSION.iso gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso > gsutil.iso.log 2>&1
443 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.properties > gsutil.properties.log 2>&1
444 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/latest.properties > gsutil.latest.log 2>&1
447 echo "--------------------------------------------------------"
451 name: 'fuel-download-artifact'
459 # log info to console
460 echo "Downloading the $INSTALLER artifact. This could take some time..."
461 echo "--------------------------------------------------------"
464 # get the latest.properties file in order to get info regarding latest artifact
465 curl -s -o $WORKSPACE/latest.properties http://$GS_URL/latest.properties
467 # check if we got the file
468 [[ -f latest.properties ]] || exit 1
470 # source the file so we get OPNFV vars
471 source latest.properties
474 curl -s -o $WORKSPACE/opnfv.iso http://$OPNFV_ARTIFACT_URL > gsutil.iso.log 2>&1
477 ls -al $WORKSPACE/opnfv.iso
480 echo "--------------------------------------------------------"
484 name: 'fuel-workspace-cleanup'
492 # delete everything that is in $WORKSPACE
493 /bin/rm -rf $WORKSPACE