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)
25 conf: 'virtual_cluster_odl'
26 node: 'huawei-deploy-vm'
28 conf: 'virtual_cluster_onos'
29 node: 'huawei-deploy-vm'
31 conf: 'virtual_cluster'
36 project: 'compass4nfv'
38 ########################
40 ########################
42 name: 'compass-verify-on-ericsson-node'
44 project-type: freestyle
53 artifactDaysToKeep: -1
62 installer: '{installer}'
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-workspace-cleanup'
101 name: 'compass-verify'
103 project-type: freestyle
112 artifactDaysToKeep: -1
113 artifactNumToKeep: -1
121 installer: '{installer}'
124 default: 'virtual_cluster'
127 - gerrit-trigger-scm:
128 credentials-id: '{ssh-credentials}'
129 refspec: '$GERRIT_REFSPEC'
130 choosing-strategy: 'gerrit'
133 - ssh-agent-credentials:
134 user: '{ssh-credentials}'
139 - patchset-created-event:
140 exclude-drafts: 'false'
141 exclude-trivial-rebase: 'false'
142 exclude-no-code-change: 'false'
143 - draft-published-event
144 - comment-added-contains-event:
145 comment-contains-value: 'recheck'
146 - comment-added-contains-event:
147 comment-contains-value: 'reverify'
149 - project-compare-type: 'ANT'
150 project-pattern: '{project}'
152 - branch-compare-type: 'ANT'
153 branch-pattern: '**/master'
154 forbidden-file-paths:
159 - 'builder-compass-build-iso'
160 - 'builder-compass-deploy-virtual-flavor'
163 artifacts: 'ansible.log'
168 name: 'compass-merge'
170 # builder-merge job to run JJB update
172 # This job's purpose is to update all the JJB
174 project-type: freestyle
181 artifactDaysToKeep: -1
190 installer: '{installer}'
193 - gerrit-trigger-scm:
194 credentials-id: '{ssh-credentials}'
196 choosing-strategy: 'default'
199 - ssh-agent-credentials:
200 user: '{ssh-credentials}'
205 - change-merged-event
206 - comment-added-contains-event:
207 comment-contains-value: 'remerge'
209 - project-compare-type: 'ANT'
210 project-pattern: '{project}'
212 - branch-compare-type: 'ANT'
213 branch-pattern: '**/master'
216 - 'builder-compass-merge'
219 name: 'compass-daily-{stream}'
221 project-type: freestyle
229 installer: '{installer}'
233 credentials-id: '{ssh-credentials}'
243 artifactDaysToKeep: -1
244 artifactNumToKeep: -1
248 - project: 'compass-build-iso'
252 - project: 'compass-deploy-virtual-cluster'
256 - project: 'compass-deploy-virtual-cluster-odl'
260 - project: 'compass-deploy-virtual-cluster-onos'
265 name: 'compass-build-iso'
267 project-type: freestyle
274 artifactDaysToKeep: -1
275 artifactNumToKeep: -1
281 installer: '{installer}'
285 credentials-id: '{ssh-credentials}'
290 - 'builder-compass-build-iso'
291 - 'builder-compass-upload-artifact'
292 - 'builder-compass-workspace-cleanup'
295 name: 'compass-build-ppa'
297 description: "build ppa(using docker) in huawei lab"
299 project-type: freestyle
306 artifactDaysToKeep: -1
307 artifactNumToKeep: -1
313 installer: '{installer}'
317 credentials-id: '{ssh-credentials}'
322 - timed: 'H 16 * * *'
325 - 'builder-compass-make-ppa'
328 name: 'compass-deploy-virtual-{flavor}'
330 project-type: freestyle
340 installer: '{installer}'
350 artifactDaysToKeep: -1
351 artifactNumToKeep: -1
355 - 'builder-compass-ci-preclean-workspace'
356 - 'builder-compass-download-artifact'
357 - 'builder-compass-deploy-virtual-flavor'
360 artifacts: 'ansible.log'
364 ########################
366 ########################
368 name: compass-parameter
372 default: '{installer}'
373 description: "Installer to use."
375 name: BUILD_DIRECTORY
376 default: $WORKSPACE/build_output
377 description: "Directory where the build artifact will be located upon the completion of the build."
379 name: CACHE_DIRECTORY
380 default: $HOME/opnfv/cache/$PROJECT
381 description: "Directory where the cache to be used during the build is located."
384 default: https://gerrit.opnfv.org/gerrit/$PROJECT
385 description: "Used for overriding the GIT URL coming from Global Jenkins configuration in case if the stuff is done on none-LF HW."
388 default: artifacts.opnfv.org/$PROJECT/
389 description: "URL to Google Storage."
392 default: build.opnfv.org/artifacts/$PROJECT/
393 description: "URL to Google Storage proxy"
399 default: "http://58.251.166.184:9999"
402 default: "$WORKSPACE/work/repo/"
404 ########################
406 ########################
408 name: 'builder-compass-merge'
415 name: 'builder-compass-make-ppa'
428 for i in $(find *.gz *.iso *.img -type f)
430 md5=$(md5sum $i | cut -d ' ' -f1)
433 curl -T $i.md5 $PPA_REPO
437 name: 'builder-compass-build-iso'
445 # log info to console
446 echo "Starting the build of $INSTALLER. This could take some time..."
447 echo "--------------------------------------------------------"
450 # create the cache directory if it doesn't exist
451 [[ -d $CACHE_DIRECTORY ]] || mkdir -p $CACHE_DIRECTORY
452 [[ -d $BUILD_DIRECTORY ]] || mkdir -p $BUILD_DIRECTORY
454 # set OPNFV_ARTIFACT_VERSION
455 export OPNFV_ARTIFACT_VERSION=$(date -u +"%Y-%m-%d_%H-%M-%S")
460 cp $PPA_CACHE/*.tar.gz $PPA_CACHE/*.iso $PPA_CACHE/*.img $CACHE_DIRECTORY/ -f
464 ./build.sh --iso-dir $BUILD_DIRECTORY/ --iso-name compass.iso -c $CACHE_DIRECTORY
466 # list the build artifacts
467 ls -al $BUILD_DIRECTORY
469 # save information regarding artifact into file
471 echo "OPNFV_ARTIFACT_VERSION=$OPNFV_ARTIFACT_VERSION"
472 echo "OPNFV_GIT_URL=$(git config --get remote.origin.url)"
473 echo "OPNFV_GIT_SHA1=$(git rev-parse HEAD)"
474 echo "OPNFV_ARTIFACT_URL=$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
475 echo "OPNFV_ARTIFACT_MD5SUM=$(md5sum $BUILD_DIRECTORY/compass.iso | cut -d' ' -f1)"
476 echo "OPNFV_BUILD_URL=$BUILD_URL"
477 ) > $BUILD_DIRECTORY/opnfv.properties
479 echo "--------------------------------------------------------"
483 name: 'builder-compass-deploy-virtual-flavor'
489 # log info to console
490 echo "Starting the deployment on virtual environment using $INSTALLER. This could take some time..."
491 echo "--------------------------------------------------------"
494 export ISO_URL=file://$BUILD_DIRECTORY/compass.iso
497 ./deploy.sh $FLAVOR_CONF
498 if [ $? -ne 0 ]; then
499 echo "depolyment failed!"
504 echo "--------------------------------------------------------"
507 ssh_options="-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no"
508 sshpass -p root scp 2>/dev/null $ssh_options root@${installer_ip}:/var/ansible/run/openstack_juno-opnfv2/ansible.log ./ &> /dev/null
514 name: 'builder-compass-upload-artifact'
522 # log info to console
523 echo "Uploading the $INSTALLER artifact. This could take some time..."
524 echo "--------------------------------------------------------"
527 # source the opnfv.properties to get ARTIFACT_VERSION
528 source $BUILD_DIRECTORY/opnfv.properties
530 # upload artifact and additional files to google storage
531 gsutil cp $BUILD_DIRECTORY/compass.iso gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso > gsutil.iso.log 2>&1
532 gsutil cp $BUILD_DIRECTORY/opnfv.properties gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.properties > gsutil.properties.log 2>&1
533 gsutil cp $BUILD_DIRECTORY/opnfv.properties gs://$GS_URL/latest.properties > gsutil.latest.log 2>&1
537 echo "--------------------------------------------------------"
539 echo "Artifact is available as http://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
542 name: 'builder-compass-download-artifact'
550 # log info to console
551 echo "Downloading the $INSTALLER artifact. This could take some time..."
552 echo "--------------------------------------------------------"
555 # get the latest.properties file in order to get info regarding latest artifact
556 [[ -d $BUILD_DIRECTORY ]] || mkdir -p $BUILD_DIRECTORY
557 curl -s -o $BUILD_DIRECTORY/latest.properties http://$GS_URL/latest.properties
559 # check if we got the file
560 [[ -f $BUILD_DIRECTORY/latest.properties ]] || exit 1
562 # source the file so we get OPNFV vars
563 source $BUILD_DIRECTORY/latest.properties
566 curl -s -o $BUILD_DIRECTORY/compass.iso http://$OPNFV_ARTIFACT_URL > gsutil.iso.log 2>&1
569 ls -al $BUILD_DIRECTORY/compass.iso
572 echo "--------------------------------------------------------"
576 name: 'builder-compass-workspace-cleanup'
584 # delete everything that is in $WORKSPACE
585 /bin/rm -rf $WORKSPACE
588 name: 'builder-compass-ci-preclean-workspace'
597 sudo rm $WORKSPACE -rf
598 git clone $GIT_BASE $WORKSPACE