1 ########################
2 # Job configuration for genesis/fuel
3 ########################
13 - 'genesis-fuel-verify'
14 - 'genesis-fuel-merge'
15 - 'genesis-fuel-daily-{stream}'
16 - 'genesis-fuel-build'
17 - 'genesis-fuel-deploy'
18 - 'genesis-fuel-deploy-virtual'
24 ########################
26 ########################
29 name: 'genesis-fuel-verify'
31 project-type: freestyle
45 artifactDaysToKeep: -1
54 installer: '{installer}'
58 credentials-id: '{ssh-credentials}'
59 refspec: '$GERRIT_REFSPEC'
60 choosing-strategy: 'gerrit'
63 - ssh-agent-credentials:
64 user: '{ssh-credentials}'
69 - patchset-created-event:
70 exclude-drafts: 'false'
71 exclude-trivial-rebase: 'false'
72 exclude-no-code-change: 'false'
73 - draft-published-event
74 - comment-added-contains-event:
75 comment-contains-value: 'recheck'
76 - comment-added-contains-event:
77 comment-contains-value: 'reverify'
79 - project-compare-type: 'ANT'
80 project-pattern: 'genesis'
82 - branch-compare-type: 'ANT'
83 branch-pattern: '**/master'
88 pattern: '{installer}/**'
92 - 'fuel-workspace-cleanup'
95 name: 'genesis-fuel-merge'
97 project-type: freestyle
111 artifactDaysToKeep: -1
120 installer: '{installer}'
123 - gerrit-trigger-scm:
124 credentials-id: '{ssh-credentials}'
126 choosing-strategy: 'default'
129 - ssh-agent-credentials:
130 user: '{ssh-credentials}'
135 - change-merged-event
136 - comment-added-contains-event:
137 comment-contains-value: 'remerge'
139 - project-compare-type: 'ANT'
140 project-pattern: 'genesis'
142 - branch-compare-type: 'ANT'
143 branch-pattern: '**/master'
148 pattern: '{installer}/**'
152 - 'fuel-workspace-cleanup'
155 name: 'genesis-fuel-daily-{stream}'
157 project-type: freestyle
167 installer: '{installer}'
171 credentials-id: '{ssh-credentials}'
176 - timed: 'H */6 * * *'
181 artifactDaysToKeep: -1
182 artifactNumToKeep: -1
186 - project: 'genesis-fuel-build'
190 - project: 'genesis-fuel-deploy'
194 - project: 'functest-opnfv-jump-1'
198 name: 'genesis-fuel-build'
200 project-type: freestyle
207 artifactDaysToKeep: -1
208 artifactNumToKeep: -1
214 installer: '{installer}'
218 credentials-id: '{ssh-credentials}'
224 - 'fuel-upload-artifact'
225 - 'fuel-workspace-cleanup'
228 name: 'genesis-fuel-deploy'
230 project-type: freestyle
240 installer: '{installer}'
243 default: ssh://gerrit.opnfv.org:29418/$PROJECT
244 description: "POD1 has some issues with cloning using https so that's why GIT_BASE is overriden here again."
248 credentials-id: '{ssh-credentials}'
255 artifactDaysToKeep: -1
256 artifactNumToKeep: -1
259 - 'fuel-download-artifact'
263 name: 'genesis-fuel-deploy-virtual'
265 project-type: freestyle
275 installer: '{installer}'
279 credentials-id: '{ssh-credentials}'
286 artifactDaysToKeep: -1
287 artifactNumToKeep: -1
290 - 'fuel-deploy-virtual'
292 ########################
294 ########################
300 default: '{installer}'
301 description: "Installer to use."
303 name: BUILD_DIRECTORY
304 default: $WORKSPACE/build_output
305 description: "Directory where the build artifact will be located upon the completion of the build."
307 name: CACHE_DIRECTORY
308 default: $HOME/opnfv/cache/genesis-$INSTALLER
309 description: "Directory where the cache to be used during the build is located."
312 default: https://gerrit.opnfv.org/gerrit/$PROJECT
313 description: "Used for overriding the GIT URL coming from Global Jenkins configuration in case if the stuff is done on none-LF HW."
316 default: artifacts.opnfv.org/$PROJECT/$INSTALLER
317 description: "URL to Google Storage."
319 ########################
321 ########################
331 # log info to console
332 echo "Starting the build of $INSTALLER. This could take some time..."
333 echo "--------------------------------------------------------"
336 # create the cache directory if it doesn't exist
337 [[ -d $CACHE_DIRECTORY ]] || mkdir -p $CACHE_DIRECTORY
339 # set OPNFV_ARTIFACT_VERSION
340 export OPNFV_ARTIFACT_VERSION=$(date -u +"%Y-%m-%d_%H-%M-%S")
343 cd $WORKSPACE/$INSTALLER/ci
344 ./build.sh -v $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY $BUILD_DIRECTORY
346 # list the build artifacts
347 ls -al $BUILD_DIRECTORY
349 # save information regarding artifact into file
351 echo "OPNFV_ARTIFACT_VERSION=$OPNFV_ARTIFACT_VERSION"
352 echo "OPNFV_GIT_URL=$(git config --get remote.origin.url)"
353 echo "OPNFV_GIT_SHA1=$(git rev-parse HEAD)"
354 echo "OPNFV_ARTIFACT_URL=$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
355 echo "OPNFV_ARTIFACT_MD5SUM=$(md5sum $BUILD_DIRECTORY/opnfv-$OPNFV_ARTIFACT_VERSION.iso | cut -d' ' -f1)"
356 echo "OPNFV_BUILD_URL=$BUILD_URL"
357 ) > $WORKSPACE/opnfv.properties
360 echo "--------------------------------------------------------"
372 # source the file so we get OPNFV vars
373 source latest.properties
375 # echo the info about artifact that is used during the deployment
376 echo "Using $(echo $OPNFV_ARTIFACT_URL | cut -d'/' -f4) for deployment"
378 # create TMPDIR if it doesn't exist
379 export TMPDIR=$HOME/tmpdir
380 [[ -d $TMPDIR ]] || mkdir -p $TMPDIR
382 # change permissions down to TMPDIR
387 export TOPDIR=$WORKSPACE/fuel/prototypes/auto-deploy
389 # log info to console
390 echo "Starting the deployment using $INSTALLER. This could take some time..."
391 echo "--------------------------------------------------------"
394 # start the deployment
395 echo "Issuing command"
396 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"
397 sudo TMPDIR=${TMPDIR} ${TOPDIR}/deploy/deploy.sh ${WORKSPACE}/opnfv.iso ${TOPDIR}/configs/lf_pod1/dea_no-ha.yaml ${TOPDIR}/configs/lf_pod1/dha.yaml
400 echo "--------------------------------------------------------"
404 name: 'fuel-deploy-virtual'
412 # log info to console
413 echo "Starting the deployment on virtual environment using $INSTALLER. This could take some time..."
414 echo "--------------------------------------------------------"
417 ssh -o BatchMode=yes -o TCPKeepAlive=yes cideploy@10.118.34.205 ./cideploy.sh
420 echo "--------------------------------------------------------"
424 name: 'fuel-upload-artifact'
432 # log info to console
433 echo "Uploading the $INSTALLER artifact. This could take some time..."
434 echo "--------------------------------------------------------"
437 # source the opnfv.properties to get ARTIFACT_VERSION
438 source $WORKSPACE/opnfv.properties
440 # upload artifact and additional files to google storage
441 gsutil cp $BUILD_DIRECTORY/opnfv-$OPNFV_ARTIFACT_VERSION.iso gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso > gsutil.iso.log 2>&1
442 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.properties > gsutil.properties.log 2>&1
443 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/latest.properties > gsutil.latest.log 2>&1
446 echo "--------------------------------------------------------"
450 name: 'fuel-download-artifact'
458 # log info to console
459 echo "Downloading the $INSTALLER artifact. This could take some time..."
460 echo "--------------------------------------------------------"
463 # get the latest.properties file in order to get info regarding latest artifact
464 curl -s -o $WORKSPACE/latest.properties http://$GS_URL/latest.properties
466 # check if we got the file
467 [[ -f latest.properties ]] || exit 1
469 # source the file so we get OPNFV vars
470 source latest.properties
473 curl -s -o $WORKSPACE/opnfv.iso http://$OPNFV_ARTIFACT_URL > gsutil.iso.log 2>&1
476 ls -al $WORKSPACE/opnfv.iso
479 echo "--------------------------------------------------------"
483 name: 'fuel-workspace-cleanup'
491 # delete everything that is in $WORKSPACE
492 /bin/rm -rf $WORKSPACE