1 # this is the job configuration for bgs
9 - 'genesis-compass-verify'
10 - 'genesis-compass-upload-iso'
11 - 'genesis-compass-merge'
12 - 'genesis-compass-daily-{stream}'
13 - 'genesis-compass-build'
14 - 'genesis-compass-deploy-virtual-{flavor}'
16 # stream: branch with - in place of / (eg. stable-helium)
17 # branch: branch (eg. stable/helium)
25 node: 'compass-build-deploy-02'
28 node: 'compass-build-deploy-03'
32 project: 'compass4nfv'
34 ########################
36 ########################
38 name: 'genesis-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: 'genesis-compass-verify'
67 project-type: freestyle
71 node: compass-build-deploy-03
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: 'genesis'
113 - branch-compare-type: 'ANT'
114 branch-pattern: '**/master'
119 pattern: 'compass/**'
124 #- 'compass-workspace-cleanup'
127 name: 'genesis-compass-merge'
129 # builder-merge job to run JJB update
131 # This job's purpose is to update all the JJB
133 project-type: freestyle
135 node: compass-build-deploy-03
140 artifactDaysToKeep: -1
149 installer: '{installer}'
151 - gerrit-trigger-scm:
152 credentials-id: '{ssh-credentials}'
154 choosing-strategy: 'default'
157 - ssh-agent-credentials:
158 user: '{ssh-credentials}'
163 - change-merged-event
164 - comment-added-contains-event:
165 comment-contains-value: 'remerge'
167 - project-compare-type: 'ANT'
168 project-pattern: 'genesis'
170 - branch-compare-type: 'ANT'
171 branch-pattern: '**/master'
176 pattern: 'compass/**'
182 name: 'genesis-compass-daily-{stream}'
184 project-type: freestyle
186 node: compass-build-deploy-03
192 installer: '{installer}'
196 credentials-id: '{ssh-credentials}'
201 - pollscm: '@midnight'
206 artifactDaysToKeep: -1
207 artifactNumToKeep: -1
211 #- 'compass-upload-artifact'
212 #- 'compass-workspace-cleanup'
215 echo "genesis-compass-deploy-virtual job will be triggered!"
219 project: 'genesis-compass-deploy-virtual-five'
222 project: 'genesis-compass-deploy-virtual-cluster'
226 name: 'genesis-compass-build'
228 project-type: freestyle
230 node: compass-build-deploy-03
235 artifactDaysToKeep: -1
236 artifactNumToKeep: -1
242 installer: '{installer}'
246 credentials-id: '{ssh-credentials}'
252 - 'compass-workspace-cleanup'
256 artifacts: '$BUILD_DIRECTORY/*.*'
260 project: 'genesis-compass-upload-iso'
264 name: 'genesis-compass-deploy-virtual-{flavor}'
266 project-type: freestyle
276 installer: '{installer}'
283 - pollscm: "H/2 * * * *"
288 artifactDaysToKeep: -1
289 artifactNumToKeep: -1
292 - 'compass-ci-preclean-workspace'
293 - 'compass-deploy-virtual-flavor'
295 ########################
297 ########################
299 name: compass-parameter
303 default: '{installer}'
304 description: "Installer to use."
306 name: BUILD_DIRECTORY
307 default: build_output
308 description: "Directory where the build artifact will be located upon the completion of the build."
310 name: CACHE_DIRECTORY
311 default: $HOME/opnfv/cache/genesis-$INSTALLER
312 description: "Directory where the cache to be used during the build is located."
315 default: https://gerrit.opnfv.org/gerrit/$PROJECT
316 description: "Used for overriding the GIT URL coming from Global Jenkins configuration in case if the stuff is done on none-LF HW."
319 default: artifacts.opnfv.org/$PROJECT/$INSTALLER
320 description: "URL to Google Storage."
323 default: "root@192.168.127.11:~/xh/work/build/work"
324 description: "Artifact Repository"
325 ########################
327 ########################
329 name: compass-copy-artifact
332 project: "genesis-compass-build"
333 filter: "$BUILD_DIRECTORY/compass.iso, $BUILD_DIRECTORY/opnfv.properties"
335 which-build: upstream-build
338 parameter-filters: PUBLISH=true
350 name: 'compass-build'
358 # log info to console
359 echo "Starting the build of $INSTALLER. This could take some time..."
360 echo "--------------------------------------------------------"
363 # create the cache directory if it doesn't exist
364 [[ -d $CACHE_DIRECTORY ]] || mkdir -p $CACHE_DIRECTORY
366 # set OPNFV_ARTIFACT_VERSION
367 export OPNFV_ARTIFACT_VERSION=$(date -u +"%Y-%m-%d_%H-%M-%S")
370 cd $WORKSPACE/$INSTALLER/ci
372 mkdir $WORKSPACE/$BUILD_DIRECTORY
373 mv $WORKSPACE/$INSTALLER/ci/work/compass.iso $WORKSPACE/$BUILD_DIRECTORY/
375 # list the build artifacts
376 ls -al $WORKSPACE/$BUILD_DIRECTORY
378 # save information regarding artifact into file
380 echo "OPNFV_ARTIFACT_VERSION=$OPNFV_ARTIFACT_VERSION"
381 echo "OPNFV_GIT_URL=$(git config --get remote.origin.url)"
382 echo "OPNFV_GIT_SHA1=$(git rev-parse HEAD)"
383 echo "OPNFV_ARTIFACT_URL=$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
384 echo "OPNFV_ARTIFACT_MD5SUM=$(md5sum $WORKSPACE/$BUILD_DIRECTORY/compass.iso | cut -d' ' -f1)"
385 echo "OPNFV_BUILD_URL=$BUILD_URL"
386 ) > $WORKSPACE/$BUILD_DIRECTORY/opnfv.properties
389 echo "--------------------------------------------------------"
393 name: 'compass-deploy'
401 # log info to console
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 cd $WORKSPACE/compass
419 ./ci/deploy.sh $FLAVOR_CONF
420 # ssh -o BatchMode=yes -o TCPKeepAlive=yes cideploy@10.118.34.205 ./cideploy.sh
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 $WORKSPACE/opnfv.properties
443 scp $WORKSPACE/compass.iso $INTERNAL_REPO/
444 scp $WORKSPACE/opnfv.properties $INTERNAL_REPO/
445 scp $WORKSPACE/compass.iso $INTERNAL_REPO/opnfv-$OPNFV_ARTIFACT_VERSION.iso
447 # upload artifact and additional files to google storage
448 gsutil cp $WORKSPACE/compass.iso gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso > gsutil.iso.log 2>&1
449 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.properties > gsutil.properties.log 2>&1
450 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/latest.properties > gsutil.latest.log 2>&1
453 echo "--------------------------------------------------------"
455 echo "Artifact is available as http://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
458 name: 'compass-download-artifact'
466 # log info to console
467 echo "Downloading the $INSTALLER artifact. This could take some time..."
468 echo "--------------------------------------------------------"
471 # get the latest.properties file in order to get info regarding latest artifact
472 curl -s -o $WORKSPACE/latest.properties http://$GS_URL/latest.properties
474 # check if we got the file
475 [[ -f latest.properties ]] || exit 1
477 # source the file so we get OPNFV vars
478 source latest.properties
481 curl -s -o $WORKSPACE/opnfv.iso http://$OPNFV_ARTIFACT_URL > gsutil.iso.log 2>&1
484 ls -al $WORKSPACE/opnfv.iso
487 echo "--------------------------------------------------------"
491 name: 'compass-workspace-cleanup'
499 # delete everything that is in $WORKSPACE
500 /bin/rm -rf $WORKSPACE
503 name: 'compass-ci-preclean-workspace'
512 sudo rm $WORKSPACE -rf
513 git clone $GIT_BASE $WORKSPACE