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: artifacts.opnfv.org/$PROJECT/$INSTALLER{gs-pathname}
326 description: "URL to Google Storage."
328 ########################
330 ########################
340 # log info to console
341 echo "Starting the build of $INSTALLER. This could take some time..."
342 echo "--------------------------------------------------------"
345 # create the cache directory if it doesn't exist
346 [[ -d $CACHE_DIRECTORY ]] || mkdir -p $CACHE_DIRECTORY
348 # set OPNFV_ARTIFACT_VERSION
349 export OPNFV_ARTIFACT_VERSION=$(date -u +"%Y-%m-%d_%H-%M-%S")
352 cd $WORKSPACE/$INSTALLER/ci
353 ./build.sh -v $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY $BUILD_DIRECTORY
355 # list the build artifacts
356 ls -al $BUILD_DIRECTORY
358 # save information regarding artifact into file
360 echo "OPNFV_ARTIFACT_VERSION=$OPNFV_ARTIFACT_VERSION"
361 echo "OPNFV_GIT_URL=$(git config --get remote.origin.url)"
362 echo "OPNFV_GIT_SHA1=$(git rev-parse HEAD)"
363 echo "OPNFV_ARTIFACT_URL=$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
364 echo "OPNFV_ARTIFACT_MD5SUM=$(md5sum $BUILD_DIRECTORY/opnfv-$OPNFV_ARTIFACT_VERSION.iso | cut -d' ' -f1)"
365 echo "OPNFV_BUILD_URL=$BUILD_URL"
366 ) > $WORKSPACE/opnfv.properties
369 echo "--------------------------------------------------------"
381 # source the file so we get OPNFV vars
382 source latest.properties
384 # echo the info about artifact that is used during the deployment
385 echo "Using $(echo $OPNFV_ARTIFACT_URL | cut -d'/' -f4) for deployment"
387 # create TMPDIR if it doesn't exist
388 export TMPDIR=$HOME/tmpdir
389 [[ -d $TMPDIR ]] || mkdir -p $TMPDIR
391 # change permissions down to TMPDIR
396 export TOPDIR=$WORKSPACE/fuel/prototypes/auto-deploy
398 # log info to console
399 echo "Starting the deployment using $INSTALLER. This could take some time..."
400 echo "--------------------------------------------------------"
403 # start the deployment
404 echo "Issuing command"
405 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"
406 sudo TMPDIR=${TMPDIR} ${TOPDIR}/deploy/deploy.sh ${WORKSPACE}/opnfv.iso ${TOPDIR}/configs/lf_pod1/dea_no-ha.yaml ${TOPDIR}/configs/lf_pod1/dha.yaml
409 echo "--------------------------------------------------------"
413 name: 'fuel-deploy-virtual'
421 # log info to console
422 echo "Starting the deployment on virtual environment using $INSTALLER. This could take some time..."
423 echo "--------------------------------------------------------"
426 ssh -o BatchMode=yes -o TCPKeepAlive=yes cideploy@10.118.34.205 ./cideploy.sh
429 echo "--------------------------------------------------------"
433 name: 'fuel-upload-artifact'
441 # log info to console
442 echo "Uploading the $INSTALLER artifact. This could take some time..."
443 echo "--------------------------------------------------------"
446 # source the opnfv.properties to get ARTIFACT_VERSION
447 source $WORKSPACE/opnfv.properties
449 # upload artifact and additional files to google storage
450 gsutil cp $BUILD_DIRECTORY/opnfv-$OPNFV_ARTIFACT_VERSION.iso gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso > gsutil.iso.log 2>&1
451 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.properties > gsutil.properties.log 2>&1
452 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/latest.properties > gsutil.latest.log 2>&1
455 echo "--------------------------------------------------------"
459 name: 'fuel-download-artifact'
467 # get the latest.properties file in order to get info regarding latest artifact
468 curl -s -o $WORKSPACE/latest.properties http://$GS_URL/latest.properties
470 # check if we got the file
471 [[ -f latest.properties ]] || exit 1
473 # source the file so we get OPNFV vars
474 source latest.properties
476 # log info to console
477 echo "Downloading the $INSTALLER artifact using URL http://$OPNFV_ARTIFACT_URL"
478 echo "This could take some time..."
479 echo "--------------------------------------------------------"
483 curl -s -o $WORKSPACE/opnfv.iso http://$OPNFV_ARTIFACT_URL > gsutil.iso.log 2>&1
486 ls -al $WORKSPACE/opnfv.iso
489 echo "--------------------------------------------------------"
493 name: 'fuel-workspace-cleanup'
501 # delete everything that is in $WORKSPACE
502 /bin/rm -rf $WORKSPACE