1 ########################
2 # Job configuration for genesis/fuel
3 ########################
13 - 'genesis-fuel-verify-{stream}'
14 - 'genesis-fuel-merge'
15 - 'genesis-fuel-daily-{stream}'
16 - 'genesis-fuel-build-{stream}'
17 - 'genesis-fuel-deploy-{stream}'
18 - 'genesis-fuel-deploy-virtual'
20 # stream: branch with - in place of / (eg. stable-arno)
21 # branch: branch (eg. stable/arno)
30 ########################
32 ########################
35 name: 'genesis-fuel-verify-{stream}'
37 project-type: freestyle
51 artifactDaysToKeep: -1
60 installer: '{installer}'
61 gs-pathname: '{gs-pathname}'
65 credentials-id: '{ssh-credentials}'
66 refspec: '$GERRIT_REFSPEC'
67 choosing-strategy: 'gerrit'
70 - ssh-agent-credentials:
71 user: '{ssh-credentials}'
76 - patchset-created-event:
77 exclude-drafts: 'false'
78 exclude-trivial-rebase: 'false'
79 exclude-no-code-change: 'false'
80 - draft-published-event
81 - comment-added-contains-event:
82 comment-contains-value: 'recheck'
83 - comment-added-contains-event:
84 comment-contains-value: 'reverify'
86 - project-compare-type: 'ANT'
87 project-pattern: 'genesis'
89 - branch-compare-type: 'ANT'
90 branch-pattern: '**/{branch}'
95 pattern: '{installer}/**'
99 - 'fuel-workspace-cleanup'
102 name: 'genesis-fuel-merge'
104 project-type: freestyle
118 artifactDaysToKeep: -1
127 installer: '{installer}'
131 - gerrit-trigger-scm:
132 credentials-id: '{ssh-credentials}'
134 choosing-strategy: 'default'
137 - ssh-agent-credentials:
138 user: '{ssh-credentials}'
143 - change-merged-event
144 - comment-added-contains-event:
145 comment-contains-value: 'remerge'
147 - project-compare-type: 'ANT'
148 project-pattern: 'genesis'
150 - branch-compare-type: 'ANT'
151 branch-pattern: '**/master'
156 pattern: '{installer}/**'
160 - 'fuel-workspace-cleanup'
163 name: 'genesis-fuel-daily-{stream}'
165 project-type: freestyle
175 installer: '{installer}'
176 gs-pathname: '{gs-pathname}'
180 credentials-id: '{ssh-credentials}'
187 artifactDaysToKeep: -1
188 artifactNumToKeep: -1
192 - project: 'genesis-fuel-build-{stream}'
196 - project: 'genesis-fuel-deploy-{stream}'
200 - project: 'functest-opnfv-jump-1'
204 name: 'genesis-fuel-build-{stream}'
206 project-type: freestyle
213 artifactDaysToKeep: -1
214 artifactNumToKeep: -1
220 installer: '{installer}'
221 gs-pathname: '{gs-pathname}'
225 credentials-id: '{ssh-credentials}'
231 - 'fuel-upload-artifact'
232 - 'fuel-workspace-cleanup'
235 name: 'genesis-fuel-deploy-{stream}'
237 project-type: freestyle
247 installer: '{installer}'
248 gs-pathname: '{gs-pathname}'
251 default: ssh://gerrit.opnfv.org:29418/$PROJECT
252 description: "POD1 has some issues with cloning using https so that's why GIT_BASE is overriden here again."
256 credentials-id: '{ssh-credentials}'
263 artifactDaysToKeep: -1
264 artifactNumToKeep: -1
267 - 'fuel-download-artifact'
271 name: 'genesis-fuel-deploy-virtual'
273 project-type: freestyle
283 installer: '{installer}'
288 credentials-id: '{ssh-credentials}'
295 artifactDaysToKeep: -1
296 artifactNumToKeep: -1
299 - 'fuel-deploy-virtual'
301 ########################
303 ########################
309 default: '{installer}'
310 description: "Installer to use."
312 name: BUILD_DIRECTORY
313 default: $WORKSPACE/build_output
314 description: "Directory where the build artifact will be located upon the completion of the build."
316 name: CACHE_DIRECTORY
317 default: $HOME/opnfv/cache/genesis-$INSTALLER
318 description: "Directory where the cache to be used during the build is located."
321 default: https://gerrit.opnfv.org/gerrit/$PROJECT
322 description: "Used for overriding the GIT URL coming from Global Jenkins configuration in case if the stuff is done on none-LF HW."
325 default: '{gs-pathname}'
326 description: "Subdirectory to store artifacts for different branches."
329 default: artifacts.opnfv.org/$PROJECT/$INSTALLER/$GS_PATHNAME
330 description: "URL to Google Storage."
332 ########################
334 ########################
344 # log info to console
345 echo "Starting the build of $INSTALLER. This could take some time..."
346 echo "--------------------------------------------------------"
349 # create the cache directory if it doesn't exist
350 [[ -d $CACHE_DIRECTORY ]] || mkdir -p $CACHE_DIRECTORY
352 # set OPNFV_ARTIFACT_VERSION
353 export OPNFV_ARTIFACT_VERSION=$(date -u +"%Y-%m-%d_%H-%M-%S")
356 cd $WORKSPACE/$INSTALLER/ci
357 ./build.sh -v $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY $BUILD_DIRECTORY
359 # list the build artifacts
360 ls -al $BUILD_DIRECTORY
362 # save information regarding artifact into file
364 echo "OPNFV_ARTIFACT_VERSION=$OPNFV_ARTIFACT_VERSION"
365 echo "OPNFV_GIT_URL=$(git config --get remote.origin.url)"
366 echo "OPNFV_GIT_SHA1=$(git rev-parse HEAD)"
367 echo "OPNFV_ARTIFACT_URL=$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
368 echo "OPNFV_ARTIFACT_MD5SUM=$(md5sum $BUILD_DIRECTORY/opnfv-$OPNFV_ARTIFACT_VERSION.iso | cut -d' ' -f1)"
369 echo "OPNFV_BUILD_URL=$BUILD_URL"
370 ) > $WORKSPACE/opnfv.properties
373 echo "--------------------------------------------------------"
385 # source the file so we get OPNFV vars
386 source latest.properties
388 # echo the info about artifact that is used during the deployment
389 echo "Using $(echo $OPNFV_ARTIFACT_URL | cut -d'/' -f4) for deployment"
391 # create TMPDIR if it doesn't exist
392 export TMPDIR=$HOME/tmpdir
393 [[ -d $TMPDIR ]] || mkdir -p $TMPDIR
395 # change permissions down to TMPDIR
400 export TOPDIR=$WORKSPACE/fuel/prototypes/auto-deploy
402 # log info to console
403 echo "Starting the deployment using $INSTALLER. This could take some time..."
404 echo "--------------------------------------------------------"
407 # start the deployment
408 echo "Issuing command"
409 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"
410 sudo TMPDIR=${TMPDIR} ${TOPDIR}/deploy/deploy.sh ${WORKSPACE}/opnfv.iso ${TOPDIR}/configs/lf_pod1/dea_no-ha.yaml ${TOPDIR}/configs/lf_pod1/dha.yaml
413 echo "--------------------------------------------------------"
417 name: 'fuel-deploy-virtual'
425 # log info to console
426 echo "Starting the deployment on virtual environment using $INSTALLER. This could take some time..."
427 echo "--------------------------------------------------------"
430 ssh -o BatchMode=yes -o TCPKeepAlive=yes cideploy@10.118.34.205 ./cideploy.sh
433 echo "--------------------------------------------------------"
437 name: 'fuel-upload-artifact'
445 # log info to console
446 echo "Uploading the $INSTALLER artifact. This could take some time..."
447 echo "--------------------------------------------------------"
450 # source the opnfv.properties to get ARTIFACT_VERSION
451 source $WORKSPACE/opnfv.properties
453 # upload artifact and additional files to google storage
454 gsutil cp $BUILD_DIRECTORY/opnfv-$OPNFV_ARTIFACT_VERSION.iso gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso > gsutil.iso.log 2>&1
455 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.properties > gsutil.properties.log 2>&1
456 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/latest.properties > gsutil.latest.log 2>&1
459 echo "--------------------------------------------------------"
463 name: 'fuel-download-artifact'
471 # get the latest.properties file in order to get info regarding latest artifact
472 curl -s -o $WORKSPACE/latest.properties http://$GS_URL/latest.properties
474 # check if we got the file
475 [[ -f latest.properties ]] || exit 1
477 # source the file so we get OPNFV vars
478 source latest.properties
480 # log info to console
481 echo "Downloading the $INSTALLER artifact using URL http://$OPNFV_ARTIFACT_URL"
482 echo "This could take some time..."
483 echo "--------------------------------------------------------"
487 curl -s -o $WORKSPACE/opnfv.iso http://$OPNFV_ARTIFACT_URL > gsutil.iso.log 2>&1
490 ls -al $WORKSPACE/opnfv.iso
493 echo "--------------------------------------------------------"
497 name: 'fuel-workspace-cleanup'
505 # delete everything that is in $WORKSPACE
506 /bin/rm -rf $WORKSPACE