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)
28 conf: 'virtual_cluster'
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-from-upstream-build'
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'
121 name: 'compass-verify'
123 project-type: freestyle
132 artifactDaysToKeep: -1
133 artifactNumToKeep: -1
141 installer: '{installer}'
144 default: 'virtual_cluster'
147 - gerrit-trigger-scm:
148 credentials-id: '{ssh-credentials}'
149 refspec: '$GERRIT_REFSPEC'
150 choosing-strategy: 'gerrit'
153 - ssh-agent-credentials:
154 user: '{ssh-credentials}'
159 - patchset-created-event:
160 exclude-drafts: 'false'
161 exclude-trivial-rebase: 'false'
162 exclude-no-code-change: 'false'
163 - draft-published-event
164 - comment-added-contains-event:
165 comment-contains-value: 'recheck'
166 - comment-added-contains-event:
167 comment-contains-value: 'reverify'
169 - project-compare-type: 'ANT'
170 project-pattern: '{project}'
172 - branch-compare-type: 'ANT'
173 branch-pattern: '**/master'
177 #- 'compass-deploy-virtual-flavor'
180 name: 'compass-merge'
182 # builder-merge job to run JJB update
184 # This job's purpose is to update all the JJB
186 project-type: freestyle
193 artifactDaysToKeep: -1
202 installer: '{installer}'
204 - gerrit-trigger-scm:
205 credentials-id: '{ssh-credentials}'
207 choosing-strategy: 'default'
210 - ssh-agent-credentials:
211 user: '{ssh-credentials}'
216 - change-merged-event
217 - comment-added-contains-event:
218 comment-contains-value: 'remerge'
220 - project-compare-type: 'ANT'
221 project-pattern: '{project}'
223 - branch-compare-type: 'ANT'
224 branch-pattern: '**/master'
229 name: 'compass-daily-{stream}'
231 project-type: freestyle
239 installer: '{installer}'
243 credentials-id: '{ssh-credentials}'
248 - pollscm: '@midnight'
253 artifactDaysToKeep: -1
254 artifactNumToKeep: -1
258 #- 'compass-upload-artifact'
259 #- 'compass-workspace-cleanup'
262 echo "compass-deploy-virtual job will be triggered!"
266 project: 'compass-build'
269 project: 'compass-deploy-virtual-cluster'
273 name: 'compass-build'
275 project-type: freestyle
282 artifactDaysToKeep: -1
283 artifactNumToKeep: -1
289 installer: '{installer}'
293 credentials-id: '{ssh-credentials}'
299 - 'compass-workspace-cleanup'
303 artifacts: '$BUILD_DIRECTORY/*.*'
307 project: 'compass-upload-iso'
311 name: 'compass-deploy-virtual-{flavor}'
313 project-type: freestyle
323 installer: '{installer}'
330 - pollscm: "H/2 * * * *"
335 artifactDaysToKeep: -1
336 artifactNumToKeep: -1
339 - 'compass-ci-preclean-workspace'
340 - 'compass-download-artifact-from-internal-repo'
341 - 'compass-deploy-virtual-flavor'
343 ########################
345 ########################
347 name: compass-parameter
351 default: '{installer}'
352 description: "Installer to use."
354 name: BUILD_DIRECTORY
355 default: build_output
356 description: "Directory where the build artifact will be located upon the completion of the build."
358 name: CACHE_DIRECTORY
359 default: $HOME/opnfv/cache/
360 description: "Directory where the cache to be used during the build is located."
363 default: https://gerrit.opnfv.org/gerrit/$PROJECT
364 description: "Used for overriding the GIT URL coming from Global Jenkins configuration in case if the stuff is done on none-LF HW."
367 default: artifacts.opnfv.org/$PROJECT/$INSTALLER
368 description: "URL to Google Storage."
370 name: INTERNAL_REPO_XA
371 default: "root@192.168.127.11:~/xh/work/build/work"
372 description: "Artifact Repository"
375 default: "http://192.168.127.11:9999/"
377 ########################
379 ########################
381 name: compass-copy-artifact-from-upstream-build
384 project: "compass-build"
385 filter: "$BUILD_DIRECTORY/compass.iso, $BUILD_DIRECTORY/opnfv.properties"
387 which-build: upstream-build
390 parameter-filters: PUBLISH=true
403 name: 'compass-build'
411 # log info to console
412 echo "Starting the build of $INSTALLER. This could take some time..."
413 echo "--------------------------------------------------------"
416 # create the cache directory if it doesn't exist
417 [[ -d $CACHE_DIRECTORY ]] || mkdir -p $CACHE_DIRECTORY
419 # set OPNFV_ARTIFACT_VERSION
420 export OPNFV_ARTIFACT_VERSION=$(date -u +"%Y-%m-%d_%H-%M-%S")
424 mkdir $WORKSPACE/$BUILD_DIRECTORY
425 ./build.sh --iso-dir $WORKSPACE/$BUILD_DIRECTORY/ --iso-name compass.iso -c $CACHE_DIRECTORY
427 # list the build artifacts
428 ls -al $WORKSPACE/$BUILD_DIRECTORY
430 # save information regarding artifact into file
432 echo "OPNFV_ARTIFACT_VERSION=$OPNFV_ARTIFACT_VERSION"
433 echo "OPNFV_GIT_URL=$(git config --get remote.origin.url)"
434 echo "OPNFV_GIT_SHA1=$(git rev-parse HEAD)"
435 echo "OPNFV_ARTIFACT_URL=$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
436 echo "OPNFV_ARTIFACT_MD5SUM=$(md5sum $WORKSPACE/$BUILD_DIRECTORY/compass.iso | cut -d' ' -f1)"
437 echo "OPNFV_BUILD_URL=$BUILD_URL"
438 ) > $WORKSPACE/$BUILD_DIRECTORY/opnfv.properties
440 echo "--------------------------------------------------------"
443 sudo rm -rf $WORKSPACE/work/
446 name: 'compass-deploy-virtual-flavor'
454 # log info to console
455 echo "Starting the deployment on virtual environment using $INSTALLER. This could take some time..."
456 echo "--------------------------------------------------------"
459 export ISO_URL=$WORKSPACE/$BUILD_DIRECTORY/compass.iso
461 ./deploy.sh $FLAVOR_CONF
464 echo "--------------------------------------------------------"
467 name: 'compass-download-artifact-from-internal-repo'
471 echo "download iso from internal repo"
472 curl -s -o $WORKSPACE/$BUILD_DIRECTORY/compass.iso $ISO_DIRECTORY/compass.iso > download.iso.log 2>&1
475 name: 'compass-upload-artifact'
483 # log info to console
484 echo "Uploading the $INSTALLER artifact. This could take some time..."
485 echo "--------------------------------------------------------"
488 # source the opnfv.properties to get ARTIFACT_VERSION
489 source $WORKSPACE/$BUILD_DIRECTORY/opnfv.properties
491 scp $WORKSPACE/$BUILD_DIRECTORY/compass.iso $INTERNAL_REPO_XA/
492 scp $WORKSPACE/$BUILD_DIRECTORY/opnfv.properties $INTERNAL_REPO_XA/
493 scp $WORKSPACE/$BUILD_DIRECTORY/compass.iso $INTERNAL_REPO_XA/opnfv-$OPNFV_ARTIFACT_VERSION.iso
495 # upload artifact and additional files to google storage
496 gsutil cp $WORKSPACE/$BUILD_DIRECTORY/compass.iso gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso > gsutil.iso.log 2>&1
497 gsutil cp $WORKSPACE/$BUILD_DIRECTORY/opnfv.properties gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.properties > gsutil.properties.log 2>&1
498 gsutil cp $WORKSPACE/$BUILD_DIRECTORY/opnfv.properties gs://$GS_URL/latest.properties > gsutil.latest.log 2>&1
501 echo "--------------------------------------------------------"
503 echo "Artifact is available as http://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
506 name: 'compass-download-artifact-from-opnfv-repo'
514 # log info to console
515 echo "Downloading the $INSTALLER artifact. This could take some time..."
516 echo "--------------------------------------------------------"
519 # get the latest.properties file in order to get info regarding latest artifact
520 curl -s -o $WORKSPACE/latest.properties http://$GS_URL/latest.properties
522 # check if we got the file
523 [[ -f latest.properties ]] || exit 1
525 # source the file so we get OPNFV vars
526 source latest.properties
529 curl -s -o $WORKSPACE/opnfv.iso http://$OPNFV_ARTIFACT_URL > gsutil.iso.log 2>&1
532 ls -al $WORKSPACE/opnfv.iso
535 echo "--------------------------------------------------------"
539 name: 'compass-workspace-cleanup'
547 # delete everything that is in $WORKSPACE
548 sudo /bin/rm -rf $WORKSPACE
551 name: 'compass-ci-preclean-workspace'
560 sudo rm $WORKSPACE -rf
561 git clone $GIT_BASE $WORKSPACE