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'
157 - 'compass-backup-logs'
160 artifacts: 'ansible.log'
165 name: 'compass-merge'
167 # builder-merge job to run JJB update
169 # This job's purpose is to update all the JJB
171 project-type: freestyle
178 artifactDaysToKeep: -1
187 installer: '{installer}'
190 - gerrit-trigger-scm:
191 credentials-id: '{ssh-credentials}'
193 choosing-strategy: 'default'
196 - ssh-agent-credentials:
197 user: '{ssh-credentials}'
202 - change-merged-event
203 - comment-added-contains-event:
204 comment-contains-value: 'remerge'
206 - project-compare-type: 'ANT'
207 project-pattern: '{project}'
209 - branch-compare-type: 'ANT'
210 branch-pattern: '**/master'
215 name: 'compass-daily-{stream}'
217 project-type: freestyle
225 installer: '{installer}'
229 credentials-id: '{ssh-credentials}'
234 - pollscm: '@midnight'
239 artifactDaysToKeep: -1
240 artifactNumToKeep: -1
244 #- 'compass-upload-artifact'
245 #- 'compass-workspace-cleanup'
248 echo "compass-deploy-virtual job will be triggered!"
252 project: 'compass-build'
255 project: 'compass-deploy-virtual-cluster'
259 name: 'compass-build'
261 project-type: freestyle
268 artifactDaysToKeep: -1
269 artifactNumToKeep: -1
275 installer: '{installer}'
279 credentials-id: '{ssh-credentials}'
285 - 'compass-upload-artifact'
286 - 'compass-workspace-cleanup'
289 name: 'compass-deploy-virtual-{flavor}'
291 project-type: freestyle
301 installer: '{installer}'
308 - pollscm: "H/2 * * * *"
313 artifactDaysToKeep: -1
314 artifactNumToKeep: -1
317 - 'compass-ci-preclean-workspace'
318 - 'compass-download-artifact'
319 - 'compass-deploy-virtual-flavor'
320 - 'compass-backup-logs'
323 artifacts: 'ansible.log'
327 ########################
329 ########################
331 name: compass-parameter
335 default: '{installer}'
336 description: "Installer to use."
338 name: BUILD_DIRECTORY
339 default: $WORKSPACE/build_output
340 description: "Directory where the build artifact will be located upon the completion of the build."
342 name: CACHE_DIRECTORY
343 default: $HOME/opnfv/cache/$PROJECT
344 description: "Directory where the cache to be used during the build is located."
347 default: https://gerrit.opnfv.org/gerrit/$PROJECT
348 description: "Used for overriding the GIT URL coming from Global Jenkins configuration in case if the stuff is done on none-LF HW."
351 default: artifacts.opnfv.org/$PROJECT/
352 description: "URL to Google Storage."
355 default: build.opnfv.org/artifacts/$PROJECT/
356 description: "URL to Google Storage proxy"
358 name: INTERNAL_REPO_XA
359 default: "root@192.168.127.11:~/xh/work/build/work"
360 description: "Artifact Repository"
366 ########################
368 ########################
379 name: 'compass-build'
387 # log info to console
388 echo "Starting the build of $INSTALLER. This could take some time..."
389 echo "--------------------------------------------------------"
392 # create the cache directory if it doesn't exist
393 [[ -d $CACHE_DIRECTORY ]] || mkdir -p $CACHE_DIRECTORY
394 [[ -d $BUILD_DIRECTORY ]] || mkdir -p $BUILD_DIRECTORY
396 # set OPNFV_ARTIFACT_VERSION
397 export OPNFV_ARTIFACT_VERSION=$(date -u +"%Y-%m-%d_%H-%M-%S")
401 ./build.sh --iso-dir $BUILD_DIRECTORY/ --iso-name compass.iso -c $CACHE_DIRECTORY
403 # list the build artifacts
404 ls -al $BUILD_DIRECTORY
406 # save information regarding artifact into file
408 echo "OPNFV_ARTIFACT_VERSION=$OPNFV_ARTIFACT_VERSION"
409 echo "OPNFV_GIT_URL=$(git config --get remote.origin.url)"
410 echo "OPNFV_GIT_SHA1=$(git rev-parse HEAD)"
411 echo "OPNFV_ARTIFACT_URL=$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
412 echo "OPNFV_ARTIFACT_MD5SUM=$(md5sum $BUILD_DIRECTORY/compass.iso | cut -d' ' -f1)"
413 echo "OPNFV_BUILD_URL=$BUILD_URL"
414 ) > $BUILD_DIRECTORY/opnfv.properties
416 echo "--------------------------------------------------------"
420 name: 'compass-deploy-virtual-flavor'
429 # log info to console
430 echo "Starting the deployment on virtual environment using $INSTALLER. This could take some time..."
431 echo "--------------------------------------------------------"
434 export ISO_URL=file://$BUILD_DIRECTORY/compass.iso
436 ./deploy.sh $FLAVOR_CONF
439 echo "--------------------------------------------------------"
443 name: 'compass-upload-artifact'
451 # log info to console
452 echo "Uploading the $INSTALLER artifact. This could take some time..."
453 echo "--------------------------------------------------------"
456 # source the opnfv.properties to get ARTIFACT_VERSION
457 source $BUILD_DIRECTORY/opnfv.properties
459 # upload artifact and additional files to google storage
460 gsutil cp $BUILD_DIRECTORY/compass.iso gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso > gsutil.iso.log 2>&1
461 gsutil cp $BUILD_DIRECTORY/opnfv.properties gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.properties > gsutil.properties.log 2>&1
462 gsutil cp $BUILD_DIRECTORY/opnfv.properties gs://$GS_URL/latest.properties > gsutil.latest.log 2>&1
466 echo "--------------------------------------------------------"
468 echo "Artifact is available as http://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
471 name: 'compass-download-artifact'
479 # log info to console
480 echo "Downloading the $INSTALLER artifact. This could take some time..."
481 echo "--------------------------------------------------------"
484 # get the latest.properties file in order to get info regarding latest artifact
485 curl -s -o $WORKSPACE/latest.properties http://$GS_URL/latest.properties
487 # check if we got the file
488 [[ -f latest.properties ]] || exit 1
490 # source the file so we get OPNFV vars
491 source latest.properties
494 curl -s -o $WORKSPACE/opnfv.iso http://$OPNFV_ARTIFACT_URL > gsutil.iso.log 2>&1
497 ls -al $WORKSPACE/opnfv.iso
500 echo "--------------------------------------------------------"
504 name: 'compass-workspace-cleanup'
512 # delete everything that is in $WORKSPACE
513 /bin/rm -rf $WORKSPACE
516 name: 'compass-ci-preclean-workspace'
525 sudo rm $WORKSPACE -rf
526 git clone $GIT_BASE $WORKSPACE
529 name: 'compass-backup-logs'
532 ssh_options="-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no"
533 sshpass -p root scp 2>/dev/null $ssh_options root@${installer_ip}:/var/ansible/run/openstack_juno-opnfv2/ansible.log ./ &> /dev/null