1 # this is the job configuration for bgs
10 - 'compass-upload-iso'
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)
32 project: 'compass4nfv'
34 ########################
36 ########################
38 name: 'compass-upload-iso'
39 project-type: freestyle
47 artifactDaysToKeep: -1
54 installer: '{installer}'
57 - ssh-agent-credentials:
58 user: '{ssh-credentials}'
61 - 'compass-copy-artifact'
62 - 'compass-upload-artifact'
65 name: 'compass-verify'
67 project-type: freestyle
76 artifactDaysToKeep: -1
85 installer: '{installer}'
89 credentials-id: '{ssh-credentials}'
90 refspec: '$GERRIT_REFSPEC'
91 choosing-strategy: 'gerrit'
94 - ssh-agent-credentials:
95 user: '{ssh-credentials}'
100 - patchset-created-event:
101 exclude-drafts: 'false'
102 exclude-trivial-rebase: 'false'
103 exclude-no-code-change: 'false'
104 - draft-published-event
105 - comment-added-contains-event:
106 comment-contains-value: 'recheck'
107 - comment-added-contains-event:
108 comment-contains-value: 'reverify'
110 - project-compare-type: 'ANT'
111 project-pattern: '{project}'
113 - branch-compare-type: 'ANT'
114 branch-pattern: '**/master'
118 #- 'compass-workspace-cleanup'
121 name: 'compass-merge'
123 # builder-merge job to run JJB update
125 # This job's purpose is to update all the JJB
127 project-type: freestyle
134 artifactDaysToKeep: -1
143 installer: '{installer}'
145 - gerrit-trigger-scm:
146 credentials-id: '{ssh-credentials}'
148 choosing-strategy: 'default'
151 - ssh-agent-credentials:
152 user: '{ssh-credentials}'
157 - change-merged-event
158 - comment-added-contains-event:
159 comment-contains-value: 'remerge'
161 - project-compare-type: 'ANT'
162 project-pattern: '{project}'
164 - branch-compare-type: 'ANT'
165 branch-pattern: '**/master'
170 name: 'compass-daily-{stream}'
172 project-type: freestyle
180 installer: '{installer}'
184 credentials-id: '{ssh-credentials}'
189 - pollscm: '@midnight'
194 artifactDaysToKeep: -1
195 artifactNumToKeep: -1
199 #- 'compass-upload-artifact'
200 #- 'compass-workspace-cleanup'
203 echo "compass-deploy-virtual job will be triggered!"
207 project: 'compass-deploy-virtual-five'
210 project: 'compass-deploy-virtual-cluster'
214 name: 'compass-build'
216 project-type: freestyle
223 artifactDaysToKeep: -1
224 artifactNumToKeep: -1
230 installer: '{installer}'
234 credentials-id: '{ssh-credentials}'
240 - 'compass-workspace-cleanup'
244 artifacts: '$BUILD_DIRECTORY/*.*'
248 project: 'compass-upload-iso'
252 name: 'compass-deploy-virtual-{flavor}'
254 project-type: freestyle
264 installer: '{installer}'
271 - pollscm: "H/2 * * * *"
276 artifactDaysToKeep: -1
277 artifactNumToKeep: -1
280 - 'compass-ci-preclean-workspace'
281 - 'compass-deploy-virtual-flavor'
283 ########################
285 ########################
287 name: compass-parameter
291 default: '{installer}'
292 description: "Installer to use."
294 name: BUILD_DIRECTORY
295 default: build_output
296 description: "Directory where the build artifact will be located upon the completion of the build."
298 name: CACHE_DIRECTORY
299 default: $HOME/opnfv/cache/$INSTALLER
300 description: "Directory where the cache to be used during the build is located."
303 default: https://gerrit.opnfv.org/gerrit/$PROJECT
304 description: "Used for overriding the GIT URL coming from Global Jenkins configuration in case if the stuff is done on none-LF HW."
307 default: artifacts.opnfv.org/$PROJECT/$INSTALLER
308 description: "URL to Google Storage."
311 default: "root@192.168.127.11:~/xh/work/build/work"
312 description: "Artifact Repository"
313 ########################
315 ########################
317 name: compass-copy-artifact
320 project: "compass-build"
321 filter: "$BUILD_DIRECTORY/compass.iso, $BUILD_DIRECTORY/opnfv.properties"
323 which-build: upstream-build
326 parameter-filters: PUBLISH=true
338 name: 'compass-build'
346 # log info to console
347 echo "Starting the build of $INSTALLER. This could take some time..."
348 echo "--------------------------------------------------------"
351 # create the cache directory if it doesn't exist
352 [[ -d $CACHE_DIRECTORY ]] || mkdir -p $CACHE_DIRECTORY
354 # set OPNFV_ARTIFACT_VERSION
355 export OPNFV_ARTIFACT_VERSION=$(date -u +"%Y-%m-%d_%H-%M-%S")
360 mkdir $WORKSPACE/$BUILD_DIRECTORY
361 mv $WORKSPACE/ci/work/compass.iso $WORKSPACE/$BUILD_DIRECTORY/
363 # list the build artifacts
364 ls -al $WORKSPACE/$BUILD_DIRECTORY
366 # save information regarding artifact into file
368 echo "OPNFV_ARTIFACT_VERSION=$OPNFV_ARTIFACT_VERSION"
369 echo "OPNFV_GIT_URL=$(git config --get remote.origin.url)"
370 echo "OPNFV_GIT_SHA1=$(git rev-parse HEAD)"
371 echo "OPNFV_ARTIFACT_URL=$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
372 echo "OPNFV_ARTIFACT_MD5SUM=$(md5sum $WORKSPACE/$BUILD_DIRECTORY/compass.iso | cut -d' ' -f1)"
373 echo "OPNFV_BUILD_URL=$BUILD_URL"
374 ) > $WORKSPACE/$BUILD_DIRECTORY/opnfv.properties
377 echo "--------------------------------------------------------"
381 name: 'compass-deploy'
389 # log info to console
393 name: 'compass-deploy-virtual-flavor'
401 # log info to console
402 echo "Starting the deployment on virtual environment using $INSTALLER. This could take some time..."
403 echo "--------------------------------------------------------"
407 ./ci/deploy.sh $FLAVOR_CONF
408 # ssh -o BatchMode=yes -o TCPKeepAlive=yes cideploy@10.118.34.205 ./cideploy.sh
411 echo "--------------------------------------------------------"
415 name: 'compass-upload-artifact'
423 # log info to console
424 echo "Uploading the $INSTALLER artifact. This could take some time..."
425 echo "--------------------------------------------------------"
428 # source the opnfv.properties to get ARTIFACT_VERSION
429 source $WORKSPACE/opnfv.properties
431 scp $WORKSPACE/compass.iso $INTERNAL_REPO/
432 scp $WORKSPACE/opnfv.properties $INTERNAL_REPO/
433 scp $WORKSPACE/compass.iso $INTERNAL_REPO/opnfv-$OPNFV_ARTIFACT_VERSION.iso
435 # upload artifact and additional files to google storage
436 gsutil cp $WORKSPACE/compass.iso gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso > gsutil.iso.log 2>&1
437 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.properties > gsutil.properties.log 2>&1
438 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/latest.properties > gsutil.latest.log 2>&1
441 echo "--------------------------------------------------------"
443 echo "Artifact is available as http://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
446 name: 'compass-download-artifact'
454 # log info to console
455 echo "Downloading the $INSTALLER artifact. This could take some time..."
456 echo "--------------------------------------------------------"
459 # get the latest.properties file in order to get info regarding latest artifact
460 curl -s -o $WORKSPACE/latest.properties http://$GS_URL/latest.properties
462 # check if we got the file
463 [[ -f latest.properties ]] || exit 1
465 # source the file so we get OPNFV vars
466 source latest.properties
469 curl -s -o $WORKSPACE/opnfv.iso http://$OPNFV_ARTIFACT_URL > gsutil.iso.log 2>&1
472 ls -al $WORKSPACE/opnfv.iso
475 echo "--------------------------------------------------------"
479 name: 'compass-workspace-cleanup'
487 # delete everything that is in $WORKSPACE
488 /bin/rm -rf $WORKSPACE
491 name: 'compass-ci-preclean-workspace'
500 sudo rm $WORKSPACE -rf
501 git clone $GIT_BASE $WORKSPACE