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'
93 name: 'compass-verify'
95 project-type: freestyle
104 artifactDaysToKeep: -1
105 artifactNumToKeep: -1
113 installer: '{installer}'
116 default: 'virtual_cluster'
119 - gerrit-trigger-scm:
120 credentials-id: '{ssh-credentials}'
121 refspec: '$GERRIT_REFSPEC'
122 choosing-strategy: 'gerrit'
125 - ssh-agent-credentials:
126 user: '{ssh-credentials}'
131 - patchset-created-event:
132 exclude-drafts: 'false'
133 exclude-trivial-rebase: 'false'
134 exclude-no-code-change: 'false'
135 - draft-published-event
136 - comment-added-contains-event:
137 comment-contains-value: 'recheck'
138 - comment-added-contains-event:
139 comment-contains-value: 'reverify'
141 - project-compare-type: 'ANT'
142 project-pattern: '{project}'
144 - branch-compare-type: 'ANT'
145 branch-pattern: '**/master'
149 #- 'compass-deploy-virtual-flavor'
152 name: 'compass-merge'
154 # builder-merge job to run JJB update
156 # This job's purpose is to update all the JJB
158 project-type: freestyle
165 artifactDaysToKeep: -1
174 installer: '{installer}'
177 - gerrit-trigger-scm:
178 credentials-id: '{ssh-credentials}'
180 choosing-strategy: 'default'
183 - ssh-agent-credentials:
184 user: '{ssh-credentials}'
189 - change-merged-event
190 - comment-added-contains-event:
191 comment-contains-value: 'remerge'
193 - project-compare-type: 'ANT'
194 project-pattern: '{project}'
196 - branch-compare-type: 'ANT'
197 branch-pattern: '**/master'
202 name: 'compass-daily-{stream}'
204 project-type: freestyle
212 installer: '{installer}'
216 credentials-id: '{ssh-credentials}'
221 - pollscm: '@midnight'
226 artifactDaysToKeep: -1
227 artifactNumToKeep: -1
231 #- 'compass-upload-artifact'
232 #- 'compass-workspace-cleanup'
235 echo "compass-deploy-virtual job will be triggered!"
239 project: 'compass-build'
242 project: 'compass-deploy-virtual-cluster'
246 name: 'compass-build'
248 project-type: freestyle
255 artifactDaysToKeep: -1
256 artifactNumToKeep: -1
262 installer: '{installer}'
266 credentials-id: '{ssh-credentials}'
272 - 'compass-upload-artifact'
275 name: 'compass-deploy-virtual-{flavor}'
277 project-type: freestyle
287 installer: '{installer}'
294 - pollscm: "H/2 * * * *"
299 artifactDaysToKeep: -1
300 artifactNumToKeep: -1
303 - 'compass-ci-preclean-workspace'
304 - 'compass-download-artifact'
305 - 'compass-deploy-virtual-flavor'
307 ########################
309 ########################
311 name: compass-parameter
315 default: '{installer}'
316 description: "Installer to use."
318 name: BUILD_DIRECTORY
319 default: $WORKSPACE/build_output
320 description: "Directory where the build artifact will be located upon the completion of the build."
322 name: CACHE_DIRECTORY
323 default: $HOME/opnfv/cache/$PROJECT
324 description: "Directory where the cache to be used during the build is located."
327 default: https://gerrit.opnfv.org/gerrit/$PROJECT
328 description: "Used for overriding the GIT URL coming from Global Jenkins configuration in case if the stuff is done on none-LF HW."
331 default: artifacts.opnfv.org/$PROJECT/
332 description: "URL to Google Storage."
335 default: build.opnfv.org/artifacts/$PROJECT/
336 description: "URL to Google Storage proxy"
338 name: INTERNAL_REPO_XA
339 default: "root@192.168.127.11:~/xh/work/build/work"
340 description: "Artifact Repository"
343 ########################
345 ########################
356 name: 'compass-build'
364 # log info to console
365 echo "Starting the build of $INSTALLER. This could take some time..."
366 echo "--------------------------------------------------------"
369 # create the cache directory if it doesn't exist
370 [[ -d $CACHE_DIRECTORY ]] || mkdir -p $CACHE_DIRECTORY
371 [[ -d $BUILD_DIRECTORY ]] || mkdir -p $BUILD_DIRECTORY
373 # set OPNFV_ARTIFACT_VERSION
374 export OPNFV_ARTIFACT_VERSION=$(date -u +"%Y-%m-%d_%H-%M-%S")
378 ./build.sh --iso-dir $BUILD_DIRECTORY/ --iso-name compass.iso -c $CACHE_DIRECTORY
380 # list the build artifacts
381 ls -al $BUILD_DIRECTORY
383 # save information regarding artifact into file
385 echo "OPNFV_ARTIFACT_VERSION=$OPNFV_ARTIFACT_VERSION"
386 echo "OPNFV_GIT_URL=$(git config --get remote.origin.url)"
387 echo "OPNFV_GIT_SHA1=$(git rev-parse HEAD)"
388 echo "OPNFV_ARTIFACT_URL=$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
389 echo "OPNFV_ARTIFACT_MD5SUM=$(md5sum $BUILD_DIRECTORY/compass.iso | cut -d' ' -f1)"
390 echo "OPNFV_BUILD_URL=$BUILD_URL"
391 ) > $BUILD_DIRECTORY/opnfv.properties
393 echo "--------------------------------------------------------"
396 sudo rm -rf $WORKSPACE/work
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 sudo /bin/rm -rf $WORKSPACE
494 name: 'compass-ci-preclean-workspace'
503 sudo rm $WORKSPACE -rf
504 git clone $GIT_BASE $WORKSPACE