1 # this is the job configuration for bgs
10 - 'compass-verify-on-ericsson-node'
11 - 'compass-upload-iso'
13 - 'compass-daily-{stream}'
15 - 'compass-deploy-virtual-{flavor}'
17 # stream: branch with - in place of / (eg. stable-helium)
18 # branch: branch (eg. stable/helium)
33 project: 'compass4nfv'
35 ########################
37 ########################
39 name: 'compass-upload-iso'
40 project-type: freestyle
48 artifactDaysToKeep: -1
55 installer: '{installer}'
58 - ssh-agent-credentials:
59 user: '{ssh-credentials}'
62 - 'compass-copy-artifact'
63 - 'compass-upload-artifact'
66 name: 'compass-verify-on-ericsson-node'
68 project-type: freestyle
77 artifactDaysToKeep: -1
86 installer: '{installer}'
90 credentials-id: '{ssh-credentials}'
91 refspec: '$GERRIT_REFSPEC'
92 choosing-strategy: 'gerrit'
95 - ssh-agent-credentials:
96 user: '{ssh-credentials}'
101 - patchset-created-event:
102 exclude-drafts: 'false'
103 exclude-trivial-rebase: 'false'
104 exclude-no-code-change: 'false'
105 - draft-published-event
106 - comment-added-contains-event:
107 comment-contains-value: 'recheck'
108 - comment-added-contains-event:
109 comment-contains-value: 'reverify'
111 - project-compare-type: 'ANT'
112 project-pattern: '{project}'
114 - branch-compare-type: 'ANT'
115 branch-pattern: '**/master'
122 name: 'compass-verify'
124 project-type: freestyle
133 artifactDaysToKeep: -1
134 artifactNumToKeep: -1
142 installer: '{installer}'
145 - gerrit-trigger-scm:
146 credentials-id: '{ssh-credentials}'
147 refspec: '$GERRIT_REFSPEC'
148 choosing-strategy: 'gerrit'
151 - ssh-agent-credentials:
152 user: '{ssh-credentials}'
157 - patchset-created-event:
158 exclude-drafts: 'false'
159 exclude-trivial-rebase: 'false'
160 exclude-no-code-change: 'false'
161 - draft-published-event
162 - comment-added-contains-event:
163 comment-contains-value: 'recheck'
164 - comment-added-contains-event:
165 comment-contains-value: 'reverify'
167 - project-compare-type: 'ANT'
168 project-pattern: '{project}'
170 - branch-compare-type: 'ANT'
171 branch-pattern: '**/master'
175 #- 'compass-workspace-cleanup'
178 name: 'compass-merge'
180 # builder-merge job to run JJB update
182 # This job's purpose is to update all the JJB
184 project-type: freestyle
191 artifactDaysToKeep: -1
200 installer: '{installer}'
202 - gerrit-trigger-scm:
203 credentials-id: '{ssh-credentials}'
205 choosing-strategy: 'default'
208 - ssh-agent-credentials:
209 user: '{ssh-credentials}'
214 - change-merged-event
215 - comment-added-contains-event:
216 comment-contains-value: 'remerge'
218 - project-compare-type: 'ANT'
219 project-pattern: '{project}'
221 - branch-compare-type: 'ANT'
222 branch-pattern: '**/master'
227 name: 'compass-daily-{stream}'
229 project-type: freestyle
237 installer: '{installer}'
241 credentials-id: '{ssh-credentials}'
246 - pollscm: '@midnight'
251 artifactDaysToKeep: -1
252 artifactNumToKeep: -1
256 #- 'compass-upload-artifact'
257 #- 'compass-workspace-cleanup'
260 echo "compass-deploy-virtual job will be triggered!"
264 project: 'compass-deploy-virtual-five'
267 project: 'compass-deploy-virtual-cluster'
271 name: 'compass-build'
273 project-type: freestyle
280 artifactDaysToKeep: -1
281 artifactNumToKeep: -1
287 installer: '{installer}'
291 credentials-id: '{ssh-credentials}'
297 - 'compass-workspace-cleanup'
301 artifacts: '$BUILD_DIRECTORY/*.*'
305 project: 'compass-upload-iso'
309 name: 'compass-deploy-virtual-{flavor}'
311 project-type: freestyle
321 installer: '{installer}'
328 - pollscm: "H/2 * * * *"
333 artifactDaysToKeep: -1
334 artifactNumToKeep: -1
337 - 'compass-ci-preclean-workspace'
338 - 'compass-deploy-virtual-flavor'
340 ########################
342 ########################
344 name: compass-parameter
348 default: '{installer}'
349 description: "Installer to use."
351 name: BUILD_DIRECTORY
352 default: build_output
353 description: "Directory where the build artifact will be located upon the completion of the build."
355 name: CACHE_DIRECTORY
356 default: $HOME/opnfv/cache/$INSTALLER
357 description: "Directory where the cache to be used during the build is located."
360 default: https://gerrit.opnfv.org/gerrit/$PROJECT
361 description: "Used for overriding the GIT URL coming from Global Jenkins configuration in case if the stuff is done on none-LF HW."
364 default: artifacts.opnfv.org/$PROJECT/$INSTALLER
365 description: "URL to Google Storage."
368 default: "root@192.168.127.11:~/xh/work/build/work"
369 description: "Artifact Repository"
370 ########################
372 ########################
374 name: compass-copy-artifact
377 project: "compass-build"
378 filter: "$BUILD_DIRECTORY/compass.iso, $BUILD_DIRECTORY/opnfv.properties"
380 which-build: upstream-build
383 parameter-filters: PUBLISH=true
395 name: 'compass-build'
403 # log info to console
404 echo "Starting the build of $INSTALLER. This could take some time..."
405 echo "--------------------------------------------------------"
408 # create the cache directory if it doesn't exist
409 [[ -d $CACHE_DIRECTORY ]] || mkdir -p $CACHE_DIRECTORY
411 # set OPNFV_ARTIFACT_VERSION
412 export OPNFV_ARTIFACT_VERSION=$(date -u +"%Y-%m-%d_%H-%M-%S")
417 mkdir $WORKSPACE/$BUILD_DIRECTORY
418 mv $WORKSPACE/ci/work/compass.iso $WORKSPACE/$BUILD_DIRECTORY/
420 # list the build artifacts
421 ls -al $WORKSPACE/$BUILD_DIRECTORY
423 # save information regarding artifact into file
425 echo "OPNFV_ARTIFACT_VERSION=$OPNFV_ARTIFACT_VERSION"
426 echo "OPNFV_GIT_URL=$(git config --get remote.origin.url)"
427 echo "OPNFV_GIT_SHA1=$(git rev-parse HEAD)"
428 echo "OPNFV_ARTIFACT_URL=$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
429 echo "OPNFV_ARTIFACT_MD5SUM=$(md5sum $WORKSPACE/$BUILD_DIRECTORY/compass.iso | cut -d' ' -f1)"
430 echo "OPNFV_BUILD_URL=$BUILD_URL"
431 ) > $WORKSPACE/$BUILD_DIRECTORY/opnfv.properties
434 echo "--------------------------------------------------------"
438 name: 'compass-deploy'
446 # log info to console
450 name: 'compass-deploy-virtual-flavor'
458 # log info to console
459 echo "Starting the deployment on virtual environment using $INSTALLER. This could take some time..."
460 echo "--------------------------------------------------------"
464 ./ci/deploy.sh $FLAVOR_CONF
465 # ssh -o BatchMode=yes -o TCPKeepAlive=yes cideploy@10.118.34.205 ./cideploy.sh
468 echo "--------------------------------------------------------"
472 name: 'compass-upload-artifact'
480 # log info to console
481 echo "Uploading the $INSTALLER artifact. This could take some time..."
482 echo "--------------------------------------------------------"
485 # source the opnfv.properties to get ARTIFACT_VERSION
486 source $WORKSPACE/opnfv.properties
488 scp $WORKSPACE/compass.iso $INTERNAL_REPO/
489 scp $WORKSPACE/opnfv.properties $INTERNAL_REPO/
490 scp $WORKSPACE/compass.iso $INTERNAL_REPO/opnfv-$OPNFV_ARTIFACT_VERSION.iso
492 # upload artifact and additional files to google storage
493 gsutil cp $WORKSPACE/compass.iso gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso > gsutil.iso.log 2>&1
494 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.properties > gsutil.properties.log 2>&1
495 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/latest.properties > gsutil.latest.log 2>&1
498 echo "--------------------------------------------------------"
500 echo "Artifact is available as http://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
503 name: 'compass-download-artifact'
511 # log info to console
512 echo "Downloading the $INSTALLER artifact. This could take some time..."
513 echo "--------------------------------------------------------"
516 # get the latest.properties file in order to get info regarding latest artifact
517 curl -s -o $WORKSPACE/latest.properties http://$GS_URL/latest.properties
519 # check if we got the file
520 [[ -f latest.properties ]] || exit 1
522 # source the file so we get OPNFV vars
523 source latest.properties
526 curl -s -o $WORKSPACE/opnfv.iso http://$OPNFV_ARTIFACT_URL > gsutil.iso.log 2>&1
529 ls -al $WORKSPACE/opnfv.iso
532 echo "--------------------------------------------------------"
536 name: 'compass-workspace-cleanup'
544 # delete everything that is in $WORKSPACE
545 /bin/rm -rf $WORKSPACE
548 name: 'compass-ci-preclean-workspace'
557 sudo rm $WORKSPACE -rf
558 git clone $GIT_BASE $WORKSPACE