1 # this is the job configuration for bgs
11 - 'compass-daily-{stream}'
14 - 'compass-deploy-virtual-{flavor}'
16 # stream: branch with - in place of / (eg. stable-helium)
17 # branch: branch (eg. stable/helium)
24 conf: 'virtual_cluster_odl'
25 node: 'huawei-deploy-vm'
27 conf: 'virtual_cluster_onos'
28 node: 'huawei-deploy-vm'
30 conf: 'virtual_cluster'
31 node: 'huawei-deploy-vm'
33 project: 'compass4nfv'
35 ########################
37 ########################
39 name: 'compass-verify'
41 project-type: freestyle
45 node: 'huawei-deploy-vm'
50 artifactDaysToKeep: -1
59 installer: '{installer}'
62 default: 'virtual_cluster'
66 credentials-id: '{ssh-credentials}'
67 refspec: '$GERRIT_REFSPEC'
68 choosing-strategy: 'gerrit'
71 - ssh-agent-credentials:
72 user: '{ssh-credentials}'
77 - patchset-created-event:
78 exclude-drafts: 'false'
79 exclude-trivial-rebase: 'false'
80 exclude-no-code-change: 'false'
81 - draft-published-event
82 - comment-added-contains-event:
83 comment-contains-value: 'recheck'
84 - comment-added-contains-event:
85 comment-contains-value: 'reverify'
87 - project-compare-type: 'ANT'
88 project-pattern: '{project}'
90 - branch-compare-type: 'ANT'
91 branch-pattern: '**/master'
97 - 'builder-compass-build-iso'
98 - 'builder-compass-deploy-virtual-flavor'
101 artifacts: 'ansible.log'
106 name: 'compass-merge'
108 # builder-merge job to run JJB update
110 # This job's purpose is to update all the JJB
112 project-type: freestyle
119 artifactDaysToKeep: -1
128 installer: '{installer}'
131 - gerrit-trigger-scm:
132 credentials-id: '{ssh-credentials}'
134 choosing-strategy: 'default'
137 - ssh-agent-credentials:
138 user: '{ssh-credentials}'
143 - change-merged-event
144 - comment-added-contains-event:
145 comment-contains-value: 'remerge'
147 - project-compare-type: 'ANT'
148 project-pattern: '{project}'
150 - branch-compare-type: 'ANT'
151 branch-pattern: '**/master'
154 - 'builder-compass-merge'
157 name: 'compass-daily-{stream}'
159 project-type: freestyle
167 installer: '{installer}'
171 credentials-id: '{ssh-credentials}'
181 artifactDaysToKeep: -1
182 artifactNumToKeep: -1
186 - project: 'compass-build-iso'
190 - project: 'compass-deploy-virtual-cluster'
194 - project: 'compass-deploy-virtual-cluster-odl'
198 - project: 'compass-deploy-virtual-cluster-onos'
203 name: 'compass-build-iso'
205 project-type: freestyle
212 artifactDaysToKeep: -1
213 artifactNumToKeep: -1
219 installer: '{installer}'
223 credentials-id: '{ssh-credentials}'
228 - 'builder-compass-build-iso'
229 - 'builder-compass-upload-artifact'
230 - 'builder-compass-workspace-cleanup'
233 name: 'compass-build-ppa'
235 description: "build ppa(using docker) in huawei lab"
237 project-type: freestyle
244 artifactDaysToKeep: -1
245 artifactNumToKeep: -1
251 installer: '{installer}'
255 credentials-id: '{ssh-credentials}'
260 - timed: 'H 16 * * *'
263 - 'builder-compass-make-ppa'
266 name: 'compass-deploy-virtual-{flavor}'
268 project-type: freestyle
278 installer: '{installer}'
288 artifactDaysToKeep: -1
289 artifactNumToKeep: -1
293 - 'builder-compass-ci-preclean-workspace'
294 - 'builder-compass-download-artifact'
295 - 'builder-compass-deploy-virtual-flavor'
298 artifacts: 'ansible.log'
302 ########################
304 ########################
306 name: compass-parameter
310 default: '{installer}'
311 description: "Installer to use."
313 name: BUILD_DIRECTORY
314 default: $WORKSPACE/build_output
315 description: "Directory where the build artifact will be located upon the completion of the build."
317 name: CACHE_DIRECTORY
318 default: $HOME/opnfv/cache/$PROJECT
319 description: "Directory where the cache to be used during the build is located."
322 default: https://gerrit.opnfv.org/gerrit/$PROJECT
323 description: "Used for overriding the GIT URL coming from Global Jenkins configuration in case if the stuff is done on none-LF HW."
326 default: artifacts.opnfv.org/$PROJECT/
327 description: "URL to Google Storage."
330 default: build.opnfv.org/artifacts/$PROJECT/
331 description: "URL to Google Storage proxy"
337 default: "http://58.251.166.184:9999"
340 default: "$WORKSPACE/work/repo/"
342 ########################
344 ########################
346 name: 'builder-compass-merge'
353 name: 'builder-compass-make-ppa'
366 for i in $(find *.gz *.iso *.img -type f)
368 md5=$(md5sum $i | cut -d ' ' -f1)
371 curl -T $i.md5 $PPA_REPO
375 name: 'builder-compass-build-iso'
383 # log info to console
384 echo "Starting the build of $INSTALLER. This could take some time..."
385 echo "--------------------------------------------------------"
388 # create the cache directory if it doesn't exist
389 [[ -d $CACHE_DIRECTORY ]] || mkdir -p $CACHE_DIRECTORY
390 [[ -d $BUILD_DIRECTORY ]] || mkdir -p $BUILD_DIRECTORY
392 # set OPNFV_ARTIFACT_VERSION
393 export OPNFV_ARTIFACT_VERSION=$(date -u +"%Y-%m-%d_%H-%M-%S")
398 cp $PPA_CACHE/*.tar.gz $PPA_CACHE/*.iso $PPA_CACHE/*.img $CACHE_DIRECTORY/ -f
402 ./build.sh --iso-dir $BUILD_DIRECTORY/ --iso-name compass.iso -c $CACHE_DIRECTORY
404 # list the build artifacts
405 ls -al $BUILD_DIRECTORY
407 # save information regarding artifact into file
409 echo "OPNFV_ARTIFACT_VERSION=$OPNFV_ARTIFACT_VERSION"
410 echo "OPNFV_GIT_URL=$(git config --get remote.origin.url)"
411 echo "OPNFV_GIT_SHA1=$(git rev-parse HEAD)"
412 echo "OPNFV_ARTIFACT_URL=$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
413 echo "OPNFV_ARTIFACT_MD5SUM=$(md5sum $BUILD_DIRECTORY/compass.iso | cut -d' ' -f1)"
414 echo "OPNFV_BUILD_URL=$BUILD_URL"
415 ) > $BUILD_DIRECTORY/opnfv.properties
417 echo "--------------------------------------------------------"
421 name: 'builder-compass-deploy-virtual-flavor'
427 # log info to console
428 echo "Starting the deployment on virtual environment using $INSTALLER. This could take some time..."
429 echo "--------------------------------------------------------"
432 export ISO_URL=file://$BUILD_DIRECTORY/compass.iso
435 ./deploy.sh $FLAVOR_CONF
436 if [ $? -ne 0 ]; then
437 echo "depolyment failed!"
442 echo "--------------------------------------------------------"
445 ssh_options="-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no"
446 sshpass -p root scp 2>/dev/null $ssh_options root@${installer_ip}:/var/ansible/run/openstack_juno-opnfv2/ansible.log ./ &> /dev/null
452 name: 'builder-compass-upload-artifact'
460 # log info to console
461 echo "Uploading the $INSTALLER artifact. This could take some time..."
462 echo "--------------------------------------------------------"
465 # source the opnfv.properties to get ARTIFACT_VERSION
466 source $BUILD_DIRECTORY/opnfv.properties
468 # upload artifact and additional files to google storage
469 gsutil cp $BUILD_DIRECTORY/compass.iso gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso > gsutil.iso.log 2>&1
470 gsutil cp $BUILD_DIRECTORY/opnfv.properties gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.properties > gsutil.properties.log 2>&1
471 gsutil cp $BUILD_DIRECTORY/opnfv.properties gs://$GS_URL/latest.properties > gsutil.latest.log 2>&1
475 echo "--------------------------------------------------------"
477 echo "Artifact is available as http://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
480 name: 'builder-compass-download-artifact'
488 # log info to console
489 echo "Downloading the $INSTALLER artifact. This could take some time..."
490 echo "--------------------------------------------------------"
493 # get the latest.properties file in order to get info regarding latest artifact
494 [[ -d $BUILD_DIRECTORY ]] || mkdir -p $BUILD_DIRECTORY
495 curl -s -o $BUILD_DIRECTORY/latest.properties http://$GS_URL/latest.properties
497 # check if we got the file
498 [[ -f $BUILD_DIRECTORY/latest.properties ]] || exit 1
500 # source the file so we get OPNFV vars
501 source $BUILD_DIRECTORY/latest.properties
504 curl -s -o $BUILD_DIRECTORY/compass.iso http://$OPNFV_ARTIFACT_URL > gsutil.iso.log 2>&1
507 ls -al $BUILD_DIRECTORY/compass.iso
510 echo "--------------------------------------------------------"
514 name: 'builder-compass-workspace-cleanup'
522 # delete everything that is in $WORKSPACE
523 /bin/rm -rf $WORKSPACE
526 name: 'builder-compass-ci-preclean-workspace'
535 sudo rm $WORKSPACE -rf
536 git clone $GIT_BASE $WORKSPACE