1 # this is the job configuration for bgs
10 - 'compass-verify-on-ericsson-node'
12 - 'compass-daily-{stream}'
14 - 'compass-deploy-virtual-{flavor}'
16 # stream: branch with - in place of / (eg. stable-helium)
17 # branch: branch (eg. stable/helium)
27 conf: 'virtual_cluster'
32 project: 'compass4nfv'
34 ########################
36 ########################
38 name: 'compass-verify-on-ericsson-node'
40 project-type: freestyle
49 artifactDaysToKeep: -1
58 installer: '{installer}'
62 credentials-id: '{ssh-credentials}'
63 refspec: '$GERRIT_REFSPEC'
64 choosing-strategy: 'gerrit'
67 - ssh-agent-credentials:
68 user: '{ssh-credentials}'
73 - patchset-created-event:
74 exclude-drafts: 'false'
75 exclude-trivial-rebase: 'false'
76 exclude-no-code-change: 'false'
77 - draft-published-event
78 - comment-added-contains-event:
79 comment-contains-value: 'recheck'
80 - comment-added-contains-event:
81 comment-contains-value: 'reverify'
83 - project-compare-type: 'ANT'
84 project-pattern: '{project}'
86 - branch-compare-type: 'ANT'
87 branch-pattern: '**/master'
94 - 'compass-workspace-cleanup'
97 name: 'compass-verify'
99 project-type: freestyle
108 artifactDaysToKeep: -1
109 artifactNumToKeep: -1
117 installer: '{installer}'
120 default: 'virtual_cluster'
123 - gerrit-trigger-scm:
124 credentials-id: '{ssh-credentials}'
125 refspec: '$GERRIT_REFSPEC'
126 choosing-strategy: 'gerrit'
129 - ssh-agent-credentials:
130 user: '{ssh-credentials}'
135 - patchset-created-event:
136 exclude-drafts: 'false'
137 exclude-trivial-rebase: 'false'
138 exclude-no-code-change: 'false'
139 - draft-published-event
140 - comment-added-contains-event:
141 comment-contains-value: 'recheck'
142 - comment-added-contains-event:
143 comment-contains-value: 'reverify'
145 - project-compare-type: 'ANT'
146 project-pattern: '{project}'
148 - branch-compare-type: 'ANT'
149 branch-pattern: '**/master'
150 forbidden-file-paths:
156 #- 'compass-deploy-virtual-flavor'
159 name: 'compass-merge'
161 # builder-merge job to run JJB update
163 # This job's purpose is to update all the JJB
165 project-type: freestyle
172 artifactDaysToKeep: -1
181 installer: '{installer}'
184 - gerrit-trigger-scm:
185 credentials-id: '{ssh-credentials}'
187 choosing-strategy: 'default'
190 - ssh-agent-credentials:
191 user: '{ssh-credentials}'
196 - change-merged-event
197 - comment-added-contains-event:
198 comment-contains-value: 'remerge'
200 - project-compare-type: 'ANT'
201 project-pattern: '{project}'
203 - branch-compare-type: 'ANT'
204 branch-pattern: '**/master'
209 name: 'compass-daily-{stream}'
211 project-type: freestyle
219 installer: '{installer}'
223 credentials-id: '{ssh-credentials}'
228 - pollscm: '@midnight'
233 artifactDaysToKeep: -1
234 artifactNumToKeep: -1
238 #- 'compass-upload-artifact'
239 #- 'compass-workspace-cleanup'
242 echo "compass-deploy-virtual job will be triggered!"
246 project: 'compass-build'
249 project: 'compass-deploy-virtual-cluster'
253 name: 'compass-build'
255 project-type: freestyle
262 artifactDaysToKeep: -1
263 artifactNumToKeep: -1
269 installer: '{installer}'
273 credentials-id: '{ssh-credentials}'
279 - 'compass-upload-artifact'
280 - 'compass-workspace-cleanup'
283 name: 'compass-deploy-virtual-{flavor}'
285 project-type: freestyle
295 installer: '{installer}'
302 - pollscm: "H/2 * * * *"
307 artifactDaysToKeep: -1
308 artifactNumToKeep: -1
311 - 'compass-ci-preclean-workspace'
312 - 'compass-download-artifact'
313 - 'compass-deploy-virtual-flavor'
315 ########################
317 ########################
319 name: compass-parameter
323 default: '{installer}'
324 description: "Installer to use."
326 name: BUILD_DIRECTORY
327 default: $WORKSPACE/build_output
328 description: "Directory where the build artifact will be located upon the completion of the build."
330 name: CACHE_DIRECTORY
331 default: $HOME/opnfv/cache/$PROJECT
332 description: "Directory where the cache to be used during the build is located."
335 default: https://gerrit.opnfv.org/gerrit/$PROJECT
336 description: "Used for overriding the GIT URL coming from Global Jenkins configuration in case if the stuff is done on none-LF HW."
339 default: artifacts.opnfv.org/$PROJECT/
340 description: "URL to Google Storage."
343 default: build.opnfv.org/artifacts/$PROJECT/
344 description: "URL to Google Storage proxy"
346 name: INTERNAL_REPO_XA
347 default: "root@192.168.127.11:~/xh/work/build/work"
348 description: "Artifact Repository"
351 ########################
353 ########################
364 name: 'compass-build'
372 # log info to console
373 echo "Starting the build of $INSTALLER. This could take some time..."
374 echo "--------------------------------------------------------"
377 # create the cache directory if it doesn't exist
378 [[ -d $CACHE_DIRECTORY ]] || mkdir -p $CACHE_DIRECTORY
379 [[ -d $BUILD_DIRECTORY ]] || mkdir -p $BUILD_DIRECTORY
381 # set OPNFV_ARTIFACT_VERSION
382 export OPNFV_ARTIFACT_VERSION=$(date -u +"%Y-%m-%d_%H-%M-%S")
386 ./build.sh --iso-dir $BUILD_DIRECTORY/ --iso-name compass.iso -c $CACHE_DIRECTORY
388 # list the build artifacts
389 ls -al $BUILD_DIRECTORY
391 # save information regarding artifact into file
393 echo "OPNFV_ARTIFACT_VERSION=$OPNFV_ARTIFACT_VERSION"
394 echo "OPNFV_GIT_URL=$(git config --get remote.origin.url)"
395 echo "OPNFV_GIT_SHA1=$(git rev-parse HEAD)"
396 echo "OPNFV_ARTIFACT_URL=$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
397 echo "OPNFV_ARTIFACT_MD5SUM=$(md5sum $BUILD_DIRECTORY/compass.iso | cut -d' ' -f1)"
398 echo "OPNFV_BUILD_URL=$BUILD_URL"
399 ) > $BUILD_DIRECTORY/opnfv.properties
401 echo "--------------------------------------------------------"
405 name: 'compass-deploy-virtual-flavor'
413 # log info to console
414 echo "Starting the deployment on virtual environment using $INSTALLER. This could take some time..."
415 echo "--------------------------------------------------------"
418 export ISO_URL=file://$BUILD_DIRECTORY/compass.iso
420 ./deploy.sh $FLAVOR_CONF
423 echo "--------------------------------------------------------"
427 name: 'compass-upload-artifact'
435 # log info to console
436 echo "Uploading the $INSTALLER artifact. This could take some time..."
437 echo "--------------------------------------------------------"
440 # source the opnfv.properties to get ARTIFACT_VERSION
441 source $BUILD_DIRECTORY/opnfv.properties
443 # upload artifact and additional files to google storage
444 gsutil cp $BUILD_DIRECTORY/compass.iso gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso > gsutil.iso.log 2>&1
445 gsutil cp $BUILD_DIRECTORY/opnfv.properties gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.properties > gsutil.properties.log 2>&1
446 gsutil cp $BUILD_DIRECTORY/opnfv.properties gs://$GS_URL/latest.properties > gsutil.latest.log 2>&1
450 echo "--------------------------------------------------------"
452 echo "Artifact is available as http://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
455 name: 'compass-download-artifact'
463 # log info to console
464 echo "Downloading the $INSTALLER artifact. This could take some time..."
465 echo "--------------------------------------------------------"
468 # get the latest.properties file in order to get info regarding latest artifact
469 curl -s -o $WORKSPACE/latest.properties http://$GS_URL/latest.properties
471 # check if we got the file
472 [[ -f latest.properties ]] || exit 1
474 # source the file so we get OPNFV vars
475 source latest.properties
478 curl -s -o $WORKSPACE/opnfv.iso http://$OPNFV_ARTIFACT_URL > gsutil.iso.log 2>&1
481 ls -al $WORKSPACE/opnfv.iso
484 echo "--------------------------------------------------------"
488 name: 'compass-workspace-cleanup'
496 # delete everything that is in $WORKSPACE
497 /bin/rm -rf $WORKSPACE
500 name: 'compass-ci-preclean-workspace'
509 sudo rm $WORKSPACE -rf
510 git clone $GIT_BASE $WORKSPACE