1 # this is the job configuration for bgs
10 - 'compass-verify-on-ericsson-node'
12 - 'compass-daily-{stream}'
15 - 'compass-deploy-virtual-{flavor}'
17 # stream: branch with - in place of / (eg. stable-helium)
18 # branch: branch (eg. stable/helium)
28 conf: 'virtual_cluster'
33 project: 'compass4nfv'
35 ########################
37 ########################
39 name: 'compass-verify-on-ericsson-node'
41 project-type: freestyle
50 artifactDaysToKeep: -1
59 installer: '{installer}'
63 credentials-id: '{ssh-credentials}'
64 refspec: '$GERRIT_REFSPEC'
65 choosing-strategy: 'gerrit'
68 - ssh-agent-credentials:
69 user: '{ssh-credentials}'
74 - patchset-created-event:
75 exclude-drafts: 'false'
76 exclude-trivial-rebase: 'false'
77 exclude-no-code-change: 'false'
78 - draft-published-event
79 - comment-added-contains-event:
80 comment-contains-value: 'recheck'
81 - comment-added-contains-event:
82 comment-contains-value: 'reverify'
84 - project-compare-type: 'ANT'
85 project-pattern: '{project}'
87 - branch-compare-type: 'ANT'
88 branch-pattern: '**/master'
94 - 'builder-compass-build-iso'
95 - 'builder-compass-workspace-cleanup'
98 name: 'compass-verify'
100 project-type: freestyle
109 artifactDaysToKeep: -1
110 artifactNumToKeep: -1
118 installer: '{installer}'
121 default: 'virtual_cluster'
124 - gerrit-trigger-scm:
125 credentials-id: '{ssh-credentials}'
126 refspec: '$GERRIT_REFSPEC'
127 choosing-strategy: 'gerrit'
130 - ssh-agent-credentials:
131 user: '{ssh-credentials}'
136 - patchset-created-event:
137 exclude-drafts: 'false'
138 exclude-trivial-rebase: 'false'
139 exclude-no-code-change: 'false'
140 - draft-published-event
141 - comment-added-contains-event:
142 comment-contains-value: 'recheck'
143 - comment-added-contains-event:
144 comment-contains-value: 'reverify'
146 - project-compare-type: 'ANT'
147 project-pattern: '{project}'
149 - branch-compare-type: 'ANT'
150 branch-pattern: '**/master'
151 forbidden-file-paths:
156 - 'builder-compass-build-iso'
157 - 'builder-compass-deploy-virtual-flavor'
158 - 'builder-compass-backup-logs'
161 artifacts: 'ansible.log'
166 name: 'compass-merge'
168 # builder-merge job to run JJB update
170 # This job's purpose is to update all the JJB
172 project-type: freestyle
179 artifactDaysToKeep: -1
188 installer: '{installer}'
191 - gerrit-trigger-scm:
192 credentials-id: '{ssh-credentials}'
194 choosing-strategy: 'default'
197 - ssh-agent-credentials:
198 user: '{ssh-credentials}'
203 - change-merged-event
204 - comment-added-contains-event:
205 comment-contains-value: 'remerge'
207 - project-compare-type: 'ANT'
208 project-pattern: '{project}'
210 - branch-compare-type: 'ANT'
211 branch-pattern: '**/master'
214 - 'builder-compass-merge'
217 name: 'compass-daily-{stream}'
219 project-type: freestyle
227 installer: '{installer}'
231 credentials-id: '{ssh-credentials}'
241 artifactDaysToKeep: -1
242 artifactNumToKeep: -1
246 - project: 'compass-build-iso'
250 - project: 'compass-deploy-virtual-cluster'
255 name: 'compass-build-iso'
257 project-type: freestyle
264 artifactDaysToKeep: -1
265 artifactNumToKeep: -1
271 installer: '{installer}'
275 credentials-id: '{ssh-credentials}'
280 - 'builder-compass-build-iso'
281 - 'builder-compass-upload-artifact'
282 - 'builder-compass-workspace-cleanup'
285 name: 'compass-build-ppa'
287 description: "build ppa(using docker) in huawei lab"
289 project-type: freestyle
296 artifactDaysToKeep: -1
297 artifactNumToKeep: -1
303 installer: '{installer}'
307 credentials-id: '{ssh-credentials}'
312 - timed: 'H 16 * * *'
315 - 'builder-compass-make-ppa'
318 name: 'compass-deploy-virtual-{flavor}'
320 project-type: freestyle
330 installer: '{installer}'
340 artifactDaysToKeep: -1
341 artifactNumToKeep: -1
345 - 'builder-compass-ci-preclean-workspace'
346 - 'builder-compass-download-artifact'
347 - 'builder-compass-deploy-virtual-flavor'
348 - 'builder-compass-backup-logs'
351 artifacts: 'ansible.log'
355 ########################
357 ########################
359 name: compass-parameter
363 default: '{installer}'
364 description: "Installer to use."
366 name: BUILD_DIRECTORY
367 default: $WORKSPACE/build_output
368 description: "Directory where the build artifact will be located upon the completion of the build."
370 name: CACHE_DIRECTORY
371 default: $HOME/opnfv/cache/$PROJECT
372 description: "Directory where the cache to be used during the build is located."
375 default: https://gerrit.opnfv.org/gerrit/$PROJECT
376 description: "Used for overriding the GIT URL coming from Global Jenkins configuration in case if the stuff is done on none-LF HW."
379 default: artifacts.opnfv.org/$PROJECT/
380 description: "URL to Google Storage."
383 default: build.opnfv.org/artifacts/$PROJECT/
384 description: "URL to Google Storage proxy"
390 default: "http://58.251.166.184:9999"
393 default: "$WORKSPACE/work/repo/"
395 ########################
397 ########################
399 name: 'builder-compass-merge'
406 name: 'builder-compass-make-ppa'
419 for i in $(find *.gz *.iso *.img -type f)
421 md5=$(md5sum $i | cut -d ' ' -f1)
424 curl -T $i.md5 $PPA_REPO
428 name: 'builder-compass-build-iso'
436 # log info to console
437 echo "Starting the build of $INSTALLER. This could take some time..."
438 echo "--------------------------------------------------------"
441 # create the cache directory if it doesn't exist
442 [[ -d $CACHE_DIRECTORY ]] || mkdir -p $CACHE_DIRECTORY
443 [[ -d $BUILD_DIRECTORY ]] || mkdir -p $BUILD_DIRECTORY
445 # set OPNFV_ARTIFACT_VERSION
446 export OPNFV_ARTIFACT_VERSION=$(date -u +"%Y-%m-%d_%H-%M-%S")
451 cp $PPA_CACHE/*.tar.gz $PPA_CACHE/*.iso $PPA_CACHE/*.img $CACHE_DIRECTORY/ -f
455 ./build.sh --iso-dir $BUILD_DIRECTORY/ --iso-name compass.iso -c $CACHE_DIRECTORY
457 # list the build artifacts
458 ls -al $BUILD_DIRECTORY
460 # save information regarding artifact into file
462 echo "OPNFV_ARTIFACT_VERSION=$OPNFV_ARTIFACT_VERSION"
463 echo "OPNFV_GIT_URL=$(git config --get remote.origin.url)"
464 echo "OPNFV_GIT_SHA1=$(git rev-parse HEAD)"
465 echo "OPNFV_ARTIFACT_URL=$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
466 echo "OPNFV_ARTIFACT_MD5SUM=$(md5sum $BUILD_DIRECTORY/compass.iso | cut -d' ' -f1)"
467 echo "OPNFV_BUILD_URL=$BUILD_URL"
468 ) > $BUILD_DIRECTORY/opnfv.properties
470 echo "--------------------------------------------------------"
474 name: 'builder-compass-deploy-virtual-flavor'
480 # log info to console
481 echo "Starting the deployment on virtual environment using $INSTALLER. This could take some time..."
482 echo "--------------------------------------------------------"
485 export ISO_URL=file://$BUILD_DIRECTORY/compass.iso
487 ./deploy.sh $FLAVOR_CONF
490 echo "--------------------------------------------------------"
494 name: 'builder-compass-upload-artifact'
502 # log info to console
503 echo "Uploading the $INSTALLER artifact. This could take some time..."
504 echo "--------------------------------------------------------"
507 # source the opnfv.properties to get ARTIFACT_VERSION
508 source $BUILD_DIRECTORY/opnfv.properties
510 # upload artifact and additional files to google storage
511 gsutil cp $BUILD_DIRECTORY/compass.iso gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso > gsutil.iso.log 2>&1
512 gsutil cp $BUILD_DIRECTORY/opnfv.properties gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.properties > gsutil.properties.log 2>&1
513 gsutil cp $BUILD_DIRECTORY/opnfv.properties gs://$GS_URL/latest.properties > gsutil.latest.log 2>&1
517 echo "--------------------------------------------------------"
519 echo "Artifact is available as http://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
522 name: 'builder-compass-download-artifact'
530 # log info to console
531 echo "Downloading the $INSTALLER artifact. This could take some time..."
532 echo "--------------------------------------------------------"
535 # get the latest.properties file in order to get info regarding latest artifact
536 [[ -d $BUILD_DIRECTORY ]] || mkdir -p $BUILD_DIRECTORY
537 curl -s -o $BUILD_DIRECTORY/latest.properties http://$GS_URL/latest.properties
539 # check if we got the file
540 [[ -f $BUILD_DIRECTORY/latest.properties ]] || exit 1
542 # source the file so we get OPNFV vars
543 source $BUILD_DIRECTORY/latest.properties
546 curl -s -o $BUILD_DIRECTORY/compass.iso http://$OPNFV_ARTIFACT_URL > gsutil.iso.log 2>&1
549 ls -al $BUILD_DIRECTORY/compass.iso
552 echo "--------------------------------------------------------"
556 name: 'builder-compass-workspace-cleanup'
564 # delete everything that is in $WORKSPACE
565 /bin/rm -rf $WORKSPACE
568 name: 'builder-compass-ci-preclean-workspace'
577 sudo rm $WORKSPACE -rf
578 git clone $GIT_BASE $WORKSPACE
581 name: 'builder-compass-backup-logs'
584 ssh_options="-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no"
585 sshpass -p root scp 2>/dev/null $ssh_options root@${installer_ip}:/var/ansible/run/openstack_juno-opnfv2/ansible.log ./ &> /dev/null