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'
91 - 'compass-workspace-cleanup'
94 name: 'compass-verify'
96 project-type: freestyle
105 artifactDaysToKeep: -1
106 artifactNumToKeep: -1
114 installer: '{installer}'
117 default: 'virtual_cluster'
120 - gerrit-trigger-scm:
121 credentials-id: '{ssh-credentials}'
122 refspec: '$GERRIT_REFSPEC'
123 choosing-strategy: 'gerrit'
126 - ssh-agent-credentials:
127 user: '{ssh-credentials}'
132 - patchset-created-event:
133 exclude-drafts: 'false'
134 exclude-trivial-rebase: 'false'
135 exclude-no-code-change: 'false'
136 - draft-published-event
137 - comment-added-contains-event:
138 comment-contains-value: 'recheck'
139 - comment-added-contains-event:
140 comment-contains-value: 'reverify'
142 - project-compare-type: 'ANT'
143 project-pattern: '{project}'
145 - branch-compare-type: 'ANT'
146 branch-pattern: '**/master'
150 #- 'compass-deploy-virtual-flavor'
153 name: 'compass-merge'
155 # builder-merge job to run JJB update
157 # This job's purpose is to update all the JJB
159 project-type: freestyle
166 artifactDaysToKeep: -1
175 installer: '{installer}'
178 - gerrit-trigger-scm:
179 credentials-id: '{ssh-credentials}'
181 choosing-strategy: 'default'
184 - ssh-agent-credentials:
185 user: '{ssh-credentials}'
190 - change-merged-event
191 - comment-added-contains-event:
192 comment-contains-value: 'remerge'
194 - project-compare-type: 'ANT'
195 project-pattern: '{project}'
197 - branch-compare-type: 'ANT'
198 branch-pattern: '**/master'
203 name: 'compass-daily-{stream}'
205 project-type: freestyle
213 installer: '{installer}'
217 credentials-id: '{ssh-credentials}'
222 - pollscm: '@midnight'
227 artifactDaysToKeep: -1
228 artifactNumToKeep: -1
232 #- 'compass-upload-artifact'
233 #- 'compass-workspace-cleanup'
236 echo "compass-deploy-virtual job will be triggered!"
240 project: 'compass-build'
243 project: 'compass-deploy-virtual-cluster'
247 name: 'compass-build'
249 project-type: freestyle
256 artifactDaysToKeep: -1
257 artifactNumToKeep: -1
263 installer: '{installer}'
267 credentials-id: '{ssh-credentials}'
273 - 'compass-upload-artifact'
274 - 'compass-workspace-cleanup'
277 name: 'compass-deploy-virtual-{flavor}'
279 project-type: freestyle
289 installer: '{installer}'
296 - pollscm: "H/2 * * * *"
301 artifactDaysToKeep: -1
302 artifactNumToKeep: -1
305 - 'compass-ci-preclean-workspace'
306 - 'compass-download-artifact'
307 - 'compass-deploy-virtual-flavor'
309 ########################
311 ########################
313 name: compass-parameter
317 default: '{installer}'
318 description: "Installer to use."
320 name: BUILD_DIRECTORY
321 default: $WORKSPACE/build_output
322 description: "Directory where the build artifact will be located upon the completion of the build."
324 name: CACHE_DIRECTORY
325 default: $HOME/opnfv/cache/$PROJECT
326 description: "Directory where the cache to be used during the build is located."
329 default: https://gerrit.opnfv.org/gerrit/$PROJECT
330 description: "Used for overriding the GIT URL coming from Global Jenkins configuration in case if the stuff is done on none-LF HW."
333 default: artifacts.opnfv.org/$PROJECT/
334 description: "URL to Google Storage."
337 default: build.opnfv.org/artifacts/$PROJECT/
338 description: "URL to Google Storage proxy"
340 name: INTERNAL_REPO_XA
341 default: "root@192.168.127.11:~/xh/work/build/work"
342 description: "Artifact Repository"
345 ########################
347 ########################
358 name: 'compass-build'
366 # log info to console
367 echo "Starting the build of $INSTALLER. This could take some time..."
368 echo "--------------------------------------------------------"
371 # create the cache directory if it doesn't exist
372 [[ -d $CACHE_DIRECTORY ]] || mkdir -p $CACHE_DIRECTORY
373 [[ -d $BUILD_DIRECTORY ]] || mkdir -p $BUILD_DIRECTORY
375 # set OPNFV_ARTIFACT_VERSION
376 export OPNFV_ARTIFACT_VERSION=$(date -u +"%Y-%m-%d_%H-%M-%S")
380 ./build.sh --iso-dir $BUILD_DIRECTORY/ --iso-name compass.iso -c $CACHE_DIRECTORY
382 # list the build artifacts
383 ls -al $BUILD_DIRECTORY
385 # save information regarding artifact into file
387 echo "OPNFV_ARTIFACT_VERSION=$OPNFV_ARTIFACT_VERSION"
388 echo "OPNFV_GIT_URL=$(git config --get remote.origin.url)"
389 echo "OPNFV_GIT_SHA1=$(git rev-parse HEAD)"
390 echo "OPNFV_ARTIFACT_URL=$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
391 echo "OPNFV_ARTIFACT_MD5SUM=$(md5sum $BUILD_DIRECTORY/compass.iso | cut -d' ' -f1)"
392 echo "OPNFV_BUILD_URL=$BUILD_URL"
393 ) > $BUILD_DIRECTORY/opnfv.properties
395 echo "--------------------------------------------------------"
399 name: 'compass-deploy-virtual-flavor'
407 # log info to console
408 echo "Starting the deployment on virtual environment using $INSTALLER. This could take some time..."
409 echo "--------------------------------------------------------"
412 export ISO_URL=file://$BUILD_DIRECTORY/compass.iso
414 ./deploy.sh $FLAVOR_CONF
417 echo "--------------------------------------------------------"
421 name: 'compass-upload-artifact'
429 # log info to console
430 echo "Uploading the $INSTALLER artifact. This could take some time..."
431 echo "--------------------------------------------------------"
434 # source the opnfv.properties to get ARTIFACT_VERSION
435 source $BUILD_DIRECTORY/opnfv.properties
437 # upload artifact and additional files to google storage
438 gsutil cp $BUILD_DIRECTORY/compass.iso gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso > gsutil.iso.log 2>&1
439 gsutil cp $BUILD_DIRECTORY/opnfv.properties gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.properties > gsutil.properties.log 2>&1
440 gsutil cp $BUILD_DIRECTORY/opnfv.properties gs://$GS_URL/latest.properties > gsutil.latest.log 2>&1
444 echo "--------------------------------------------------------"
446 echo "Artifact is available as http://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
449 name: 'compass-download-artifact'
457 # log info to console
458 echo "Downloading the $INSTALLER artifact. This could take some time..."
459 echo "--------------------------------------------------------"
462 # get the latest.properties file in order to get info regarding latest artifact
463 curl -s -o $WORKSPACE/latest.properties http://$GS_URL/latest.properties
465 # check if we got the file
466 [[ -f latest.properties ]] || exit 1
468 # source the file so we get OPNFV vars
469 source latest.properties
472 curl -s -o $WORKSPACE/opnfv.iso http://$OPNFV_ARTIFACT_URL > gsutil.iso.log 2>&1
475 ls -al $WORKSPACE/opnfv.iso
478 echo "--------------------------------------------------------"
482 name: 'compass-workspace-cleanup'
490 # delete everything that is in $WORKSPACE
491 /bin/rm -rf $WORKSPACE
494 name: 'compass-ci-preclean-workspace'
503 sudo rm $WORKSPACE -rf
504 git clone $GIT_BASE $WORKSPACE