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'
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'
213 - 'builder-compass-merge'
216 name: 'compass-daily-{stream}'
218 project-type: freestyle
226 installer: '{installer}'
230 credentials-id: '{ssh-credentials}'
240 artifactDaysToKeep: -1
241 artifactNumToKeep: -1
245 - project: 'compass-build-iso'
249 - project: 'compass-deploy-virtual-cluster'
254 name: 'compass-build-iso'
256 project-type: freestyle
263 artifactDaysToKeep: -1
264 artifactNumToKeep: -1
270 installer: '{installer}'
274 credentials-id: '{ssh-credentials}'
279 - 'builder-compass-build-iso'
280 - 'builder-compass-upload-artifact'
281 - 'builder-compass-workspace-cleanup'
284 name: 'compass-build-ppa'
286 description: "build ppa(using docker) in huawei lab"
288 project-type: freestyle
295 artifactDaysToKeep: -1
296 artifactNumToKeep: -1
302 installer: '{installer}'
306 credentials-id: '{ssh-credentials}'
311 - timed: 'H 16 * * *'
314 - 'builder-compass-make-ppa'
317 name: 'compass-deploy-virtual-{flavor}'
319 project-type: freestyle
329 installer: '{installer}'
339 artifactDaysToKeep: -1
340 artifactNumToKeep: -1
344 - 'builder-compass-ci-preclean-workspace'
345 - 'builder-compass-download-artifact'
346 - 'builder-compass-deploy-virtual-flavor'
349 artifacts: 'ansible.log'
353 ########################
355 ########################
357 name: compass-parameter
361 default: '{installer}'
362 description: "Installer to use."
364 name: BUILD_DIRECTORY
365 default: $WORKSPACE/build_output
366 description: "Directory where the build artifact will be located upon the completion of the build."
368 name: CACHE_DIRECTORY
369 default: $HOME/opnfv/cache/$PROJECT
370 description: "Directory where the cache to be used during the build is located."
373 default: https://gerrit.opnfv.org/gerrit/$PROJECT
374 description: "Used for overriding the GIT URL coming from Global Jenkins configuration in case if the stuff is done on none-LF HW."
377 default: artifacts.opnfv.org/$PROJECT/
378 description: "URL to Google Storage."
381 default: build.opnfv.org/artifacts/$PROJECT/
382 description: "URL to Google Storage proxy"
388 default: "http://58.251.166.184:9999"
391 default: "$WORKSPACE/work/repo/"
393 ########################
395 ########################
397 name: 'builder-compass-merge'
404 name: 'builder-compass-make-ppa'
417 for i in $(find *.gz *.iso *.img -type f)
419 md5=$(md5sum $i | cut -d ' ' -f1)
422 curl -T $i.md5 $PPA_REPO
426 name: 'builder-compass-build-iso'
434 # log info to console
435 echo "Starting the build of $INSTALLER. This could take some time..."
436 echo "--------------------------------------------------------"
439 # create the cache directory if it doesn't exist
440 [[ -d $CACHE_DIRECTORY ]] || mkdir -p $CACHE_DIRECTORY
441 [[ -d $BUILD_DIRECTORY ]] || mkdir -p $BUILD_DIRECTORY
443 # set OPNFV_ARTIFACT_VERSION
444 export OPNFV_ARTIFACT_VERSION=$(date -u +"%Y-%m-%d_%H-%M-%S")
449 cp $PPA_CACHE/*.tar.gz $PPA_CACHE/*.iso $PPA_CACHE/*.img $CACHE_DIRECTORY/ -f
453 ./build.sh --iso-dir $BUILD_DIRECTORY/ --iso-name compass.iso -c $CACHE_DIRECTORY
455 # list the build artifacts
456 ls -al $BUILD_DIRECTORY
458 # save information regarding artifact into file
460 echo "OPNFV_ARTIFACT_VERSION=$OPNFV_ARTIFACT_VERSION"
461 echo "OPNFV_GIT_URL=$(git config --get remote.origin.url)"
462 echo "OPNFV_GIT_SHA1=$(git rev-parse HEAD)"
463 echo "OPNFV_ARTIFACT_URL=$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
464 echo "OPNFV_ARTIFACT_MD5SUM=$(md5sum $BUILD_DIRECTORY/compass.iso | cut -d' ' -f1)"
465 echo "OPNFV_BUILD_URL=$BUILD_URL"
466 ) > $BUILD_DIRECTORY/opnfv.properties
468 echo "--------------------------------------------------------"
472 name: 'builder-compass-deploy-virtual-flavor'
478 # log info to console
479 echo "Starting the deployment on virtual environment using $INSTALLER. This could take some time..."
480 echo "--------------------------------------------------------"
483 export ISO_URL=file://$BUILD_DIRECTORY/compass.iso
486 ./deploy.sh $FLAVOR_CONF
487 if [ $? -ne 0 ]; then
488 echo "depolyment failed!"
493 echo "--------------------------------------------------------"
496 ssh_options="-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no"
497 sshpass -p root scp 2>/dev/null $ssh_options root@${installer_ip}:/var/ansible/run/openstack_juno-opnfv2/ansible.log ./ &> /dev/null
503 name: 'builder-compass-upload-artifact'
511 # log info to console
512 echo "Uploading the $INSTALLER artifact. This could take some time..."
513 echo "--------------------------------------------------------"
516 # source the opnfv.properties to get ARTIFACT_VERSION
517 source $BUILD_DIRECTORY/opnfv.properties
519 # upload artifact and additional files to google storage
520 gsutil cp $BUILD_DIRECTORY/compass.iso gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso > gsutil.iso.log 2>&1
521 gsutil cp $BUILD_DIRECTORY/opnfv.properties gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.properties > gsutil.properties.log 2>&1
522 gsutil cp $BUILD_DIRECTORY/opnfv.properties gs://$GS_URL/latest.properties > gsutil.latest.log 2>&1
526 echo "--------------------------------------------------------"
528 echo "Artifact is available as http://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
531 name: 'builder-compass-download-artifact'
539 # log info to console
540 echo "Downloading the $INSTALLER artifact. This could take some time..."
541 echo "--------------------------------------------------------"
544 # get the latest.properties file in order to get info regarding latest artifact
545 [[ -d $BUILD_DIRECTORY ]] || mkdir -p $BUILD_DIRECTORY
546 curl -s -o $BUILD_DIRECTORY/latest.properties http://$GS_URL/latest.properties
548 # check if we got the file
549 [[ -f $BUILD_DIRECTORY/latest.properties ]] || exit 1
551 # source the file so we get OPNFV vars
552 source $BUILD_DIRECTORY/latest.properties
555 curl -s -o $BUILD_DIRECTORY/compass.iso http://$OPNFV_ARTIFACT_URL > gsutil.iso.log 2>&1
558 ls -al $BUILD_DIRECTORY/compass.iso
561 echo "--------------------------------------------------------"
565 name: 'builder-compass-workspace-cleanup'
573 # delete everything that is in $WORKSPACE
574 /bin/rm -rf $WORKSPACE
577 name: 'builder-compass-ci-preclean-workspace'
586 sudo rm $WORKSPACE -rf
587 git clone $GIT_BASE $WORKSPACE