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}'
181 artifactDaysToKeep: -1
182 artifactNumToKeep: -1
186 - project: 'genesis-fuel-build'
190 - project: 'genesis-fuel-deploy-virtual'
195 name: 'genesis-fuel-build'
197 project-type: freestyle
204 artifactDaysToKeep: -1
205 artifactNumToKeep: -1
211 installer: '{installer}'
215 credentials-id: '{ssh-credentials}'
221 - 'fuel-upload-artifact'
222 - 'fuel-workspace-cleanup'
225 name: 'genesis-fuel-deploy'
227 project-type: freestyle
237 installer: '{installer}'
241 credentials-id: '{ssh-credentials}'
248 artifactDaysToKeep: -1
249 artifactNumToKeep: -1
252 - 'fuel-download-artifact'
256 name: 'genesis-fuel-deploy-virtual'
258 project-type: freestyle
268 installer: '{installer}'
272 credentials-id: '{ssh-credentials}'
279 artifactDaysToKeep: -1
280 artifactNumToKeep: -1
283 - 'fuel-download-artifact'
284 - 'fuel-deploy-virtual'
286 ########################
288 ########################
294 default: '{installer}'
295 description: "Installer to use."
297 name: BUILD_DIRECTORY
298 default: $WORKSPACE/build_output
299 description: "Directory where the build artifact will be located upon the completion of the build."
301 name: CACHE_DIRECTORY
302 default: $HOME/opnfv/cache/genesis-$INSTALLER
303 description: "Directory where the cache to be used during the build is located."
306 default: https://gerrit.opnfv.org/gerrit/$PROJECT
307 description: "Used for overriding the GIT URL coming from Global Jenkins configuration in case if the stuff is done on none-LF HW."
310 default: artifacts.opnfv.org/$PROJECT/$INSTALLER
311 description: "URL to Google Storage."
313 ########################
315 ########################
325 # log info to console
326 echo "Starting the build of $INSTALLER. This could take some time..."
327 echo "--------------------------------------------------------"
330 # create the cache directory if it doesn't exist
331 [[ -d $CACHE_DIRECTORY ]] || mkdir -p $CACHE_DIRECTORY
333 # set OPNFV_ARTIFACT_VERSION
334 export OPNFV_ARTIFACT_VERSION=$(date -u +"%Y-%m-%d_%H-%M-%S")
337 cd $WORKSPACE/$INSTALLER/ci
338 ./build.sh -v $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY $BUILD_DIRECTORY
340 # list the build artifacts
341 ls -al $BUILD_DIRECTORY
343 # list the contents of BUILD_OUTPUT directory
344 ls -al $BUILD_DIRECTORY
346 # save information regarding artifact into file
348 echo "OPNFV_ARTIFACT_VERSION=$OPNFV_ARTIFACT_VERSION"
349 echo "OPNFV_GIT_URL=$(git config --get remote.origin.url)"
350 echo "OPNFV_GIT_SHA1=$(git rev-parse HEAD)"
351 echo "OPNFV_ARTIFACT_URL=$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
352 echo "OPNFV_ARTIFACT_MD5SUM=$(md5sum $BUILD_DIRECTORY/opnfv-$OPNFV_ARTIFACT_VERSION.iso | cut -d' ' -f1)"
353 echo "OPNFV_BUILD_URL=$BUILD_URL"
354 ) > $WORKSPACE/opnfv.properties
357 echo "--------------------------------------------------------"
369 # source the file so we get OPNFV vars
370 source latest.properties
372 # echo the info about artifact that is used during the deployment
373 echo "Using $(echo $OPNFV_ARTIFACT_URL | cut -d'/' -f4) for deployment"
376 export TOPDIR=$WORKSPACE/fuel/prototypes/auto-deploy
378 # log info to console
379 echo "Startint the deployment using $INSTALLER. This could take some time..."
380 echo "--------------------------------------------------------"
383 # start the deployment
384 echo "sudo ${TOPDIR}/deploy/deploy.sh $WORKSPACE/opnfv.iso ${TOPDIR}/configs/lf_pod1/dea.yaml ${TOPDIR}/configs/lf_pod1/dha.yaml"
387 echo "--------------------------------------------------------"
391 name: 'fuel-deploy-virtual'
399 # log info to console
400 echo "Startint the deployment on virtual environment using $INSTALLER. This could take some time..."
401 echo "--------------------------------------------------------"
404 ssh -o BatchMode=yes -o TCPKeepAlive=yes cideploy@10.118.34.205 ./cideploy.sh
407 echo "--------------------------------------------------------"
411 name: 'fuel-upload-artifact'
419 # log info to console
420 echo "Uploading the $INSTALLER artifact. This could take some time..."
421 echo "--------------------------------------------------------"
424 # source the opnfv.properties to get ARTIFACT_VERSION
425 source $WORKSPACE/opnfv.properties
427 # upload artifact and additional files to google storage
428 gsutil cp $BUILD_DIRECTORY/opnfv-$OPNFV_ARTIFACT_VERSION.iso gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso > gsutil.iso.log 2>&1
429 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.properties > gsutil.properties.log 2>&1
430 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/latest.properties > gsutil.latest.log 2>&1
433 echo "--------------------------------------------------------"
437 name: 'fuel-download-artifact'
445 # log info to console
446 echo "Downloading the $INSTALLER artifact. This could take some time..."
447 echo "--------------------------------------------------------"
450 # get the latest.properties file in order to get info regarding latest artifact
451 gsutil cp gs://$GS_URL/latest.properties $WORKSPACE/latest.properties
453 # check if we got the file
454 [[ -f latest.properties ]] || exit 1
456 # source the file so we get OPNFV vars
457 source latest.properties
460 gsutil cp gs://$OPNFV_ARTIFACT_URL $WORKSPACE/opnfv.iso
463 ls -al $WORKSPACE/opnfv.iso
466 echo "--------------------------------------------------------"
470 name: 'fuel-workspace-cleanup'
478 # delete everything that is in $WORKSPACE
479 /bin/rm -rf $WORKSPACE