1 # this is the job configuration for bgs
11 - 'compass-daily-{stream}'
14 - 'compass-deploy-virtual-{flavor}'
15 - 'compass-deploy-bare-huawei-us'
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'
32 node: 'huawei-deploy-vm'
34 project: 'compass4nfv'
36 ########################
38 ########################
40 name: 'compass-verify'
42 project-type: freestyle
46 node: 'huawei-deploy-vm'
51 artifactDaysToKeep: -1
60 installer: '{installer}'
63 default: 'virtual_cluster'
67 credentials-id: '{ssh-credentials}'
68 refspec: '$GERRIT_REFSPEC'
69 choosing-strategy: 'gerrit'
72 - ssh-agent-credentials:
73 user: '{ssh-credentials}'
78 - patchset-created-event:
79 exclude-drafts: 'false'
80 exclude-trivial-rebase: 'false'
81 exclude-no-code-change: 'false'
82 - draft-published-event
83 - comment-added-contains-event:
84 comment-contains-value: 'recheck'
85 - comment-added-contains-event:
86 comment-contains-value: 'reverify'
88 - project-compare-type: 'ANT'
89 project-pattern: '{project}'
91 - branch-compare-type: 'ANT'
92 branch-pattern: '**/master'
98 - 'builder-compass-build-iso'
99 - 'builder-compass-deploy-virtual-flavor'
102 artifacts: 'ansible.log'
107 name: 'compass-merge'
109 # builder-merge job to run JJB update
111 # This job's purpose is to update all the JJB
113 project-type: freestyle
120 artifactDaysToKeep: -1
129 installer: '{installer}'
132 - gerrit-trigger-scm:
133 credentials-id: '{ssh-credentials}'
135 choosing-strategy: 'default'
138 - ssh-agent-credentials:
139 user: '{ssh-credentials}'
144 - change-merged-event
145 - comment-added-contains-event:
146 comment-contains-value: 'remerge'
148 - project-compare-type: 'ANT'
149 project-pattern: '{project}'
151 - branch-compare-type: 'ANT'
152 branch-pattern: '**/master'
155 - 'builder-compass-merge'
158 name: 'compass-daily-{stream}'
160 project-type: freestyle
168 installer: '{installer}'
172 credentials-id: '{ssh-credentials}'
182 artifactDaysToKeep: -1
183 artifactNumToKeep: -1
187 - project: 'compass-build-iso'
191 - project: 'compass-deploy-virtual-cluster'
195 - project: 'compass-deploy-virtual-cluster-odl'
199 - project: 'compass-deploy-virtual-cluster-onos'
204 name: 'compass-build-iso'
206 project-type: freestyle
213 artifactDaysToKeep: -1
214 artifactNumToKeep: -1
220 installer: '{installer}'
224 credentials-id: '{ssh-credentials}'
229 - 'builder-compass-build-iso'
230 - 'builder-compass-upload-artifact'
231 - 'builder-compass-workspace-cleanup'
234 name: 'compass-build-ppa'
236 description: "build ppa(using docker) in huawei lab"
238 project-type: freestyle
245 artifactDaysToKeep: -1
246 artifactNumToKeep: -1
252 installer: '{installer}'
256 credentials-id: '{ssh-credentials}'
261 - timed: 'H 16 * * *'
264 - 'builder-compass-make-ppa'
267 name: 'compass-deploy-virtual-{flavor}'
269 project-type: freestyle
279 installer: '{installer}'
289 artifactDaysToKeep: -1
290 artifactNumToKeep: -1
294 - 'builder-compass-ci-preclean-workspace'
295 - 'builder-compass-download-artifact'
296 - 'builder-compass-deploy-virtual-flavor'
299 artifacts: 'ansible.log'
305 name: 'compass-deploy-bare-huawei-us'
307 project-type: freestyle
311 node: 'huawei-us-deploy-bare-1'
317 installer: '{installer}'
322 artifactDaysToKeep: -1
323 artifactNumToKeep: -1
326 - 'builder-compass-ci-preclean-workspace'
327 - 'builder-compass-download-artifact'
328 - 'builder-compass-deploy-bare'
332 artifacts: 'ansible.log'
337 ########################
339 ########################
341 name: compass-parameter
345 default: '{installer}'
346 description: "Installer to use."
348 name: BUILD_DIRECTORY
349 default: $WORKSPACE/build_output
350 description: "Directory where the build artifact will be located upon the completion of the build."
352 name: CACHE_DIRECTORY
353 default: $HOME/opnfv/cache/$PROJECT
354 description: "Directory where the cache to be used during the build is located."
357 default: https://gerrit.opnfv.org/gerrit/$PROJECT
358 description: "Used for overriding the GIT URL coming from Global Jenkins configuration in case if the stuff is done on none-LF HW."
361 default: artifacts.opnfv.org/$PROJECT/
362 description: "URL to Google Storage."
365 default: build.opnfv.org/artifacts/$PROJECT/
366 description: "URL to Google Storage proxy"
372 default: "http://58.251.166.184:9999"
375 default: "$WORKSPACE/work/repo/"
377 ########################
379 ########################
381 name: 'builder-compass-merge'
388 name: 'builder-compass-make-ppa'
401 for i in $(find *.gz *.iso *.img -type f)
403 md5=$(md5sum $i | cut -d ' ' -f1)
406 curl -T $i.md5 $PPA_REPO
410 name: 'builder-compass-build-iso'
418 # log info to console
419 echo "Starting the build of $INSTALLER. This could take some time..."
420 echo "--------------------------------------------------------"
423 # create the cache directory if it doesn't exist
424 [[ -d $CACHE_DIRECTORY ]] || mkdir -p $CACHE_DIRECTORY
425 [[ -d $BUILD_DIRECTORY ]] || mkdir -p $BUILD_DIRECTORY
427 # set OPNFV_ARTIFACT_VERSION
428 export OPNFV_ARTIFACT_VERSION=$(date -u +"%Y-%m-%d_%H-%M-%S")
433 cp $PPA_CACHE/*.tar.gz $PPA_CACHE/*.iso $PPA_CACHE/*.img $CACHE_DIRECTORY/ -f
437 ./build.sh --iso-dir $BUILD_DIRECTORY/ --iso-name compass.iso -c $CACHE_DIRECTORY
439 # list the build artifacts
440 ls -al $BUILD_DIRECTORY
442 # save information regarding artifact into file
444 echo "OPNFV_ARTIFACT_VERSION=$OPNFV_ARTIFACT_VERSION"
445 echo "OPNFV_GIT_URL=$(git config --get remote.origin.url)"
446 echo "OPNFV_GIT_SHA1=$(git rev-parse HEAD)"
447 echo "OPNFV_ARTIFACT_URL=$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
448 echo "OPNFV_ARTIFACT_MD5SUM=$(md5sum $BUILD_DIRECTORY/compass.iso | cut -d' ' -f1)"
449 echo "OPNFV_BUILD_URL=$BUILD_URL"
450 ) > $BUILD_DIRECTORY/opnfv.properties
452 echo "--------------------------------------------------------"
456 name: 'builder-compass-deploy-virtual-flavor'
462 # log info to console
463 echo "Starting the deployment on virtual environment using $INSTALLER. This could take some time..."
464 echo "--------------------------------------------------------"
467 export ISO_URL=file://$BUILD_DIRECTORY/compass.iso
470 ./deploy.sh $FLAVOR_CONF
471 if [ $? -ne 0 ]; then
472 echo "depolyment failed!"
477 echo "--------------------------------------------------------"
480 ssh_options="-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no"
481 sshpass -p root scp 2>/dev/null $ssh_options root@${installer_ip}:/var/ansible/run/openstack_juno-opnfv2/ansible.log ./ &> /dev/null
486 name: 'builder-compass-deploy-bare'
492 # log info to console
493 echo "Starting the deployment on baremetal environment using $INSTALLER. This could take some time..."
494 echo "--------------------------------------------------------"
497 export CONFDIR=$WORKSPACE/deploy/conf/hardware_environment/huawei_us_lab/pod1
498 export ISO_URL=file://$BUILD_DIRECTORY/compass.iso
501 ./deploy.sh --dha $CONFDIR/dha.yml --network $CONFDIR/network.yml
502 if [ $? -ne 0 ]; then
503 echo "depolyment failed!"
508 echo "--------------------------------------------------------"
511 ssh_options="-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no"
512 sshpass -p root scp 2>/dev/null $ssh_options root@${installer_ip}:/var/ansible/run/openstack_juno-opnfv2/ansible.log ./ &> /dev/null
517 name: 'builder-compass-upload-artifact'
525 # log info to console
526 echo "Uploading the $INSTALLER artifact. This could take some time..."
527 echo "--------------------------------------------------------"
530 # source the opnfv.properties to get ARTIFACT_VERSION
531 source $BUILD_DIRECTORY/opnfv.properties
533 # upload artifact and additional files to google storage
534 gsutil cp $BUILD_DIRECTORY/compass.iso gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso > gsutil.iso.log 2>&1
535 gsutil cp $BUILD_DIRECTORY/opnfv.properties gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.properties > gsutil.properties.log 2>&1
536 gsutil cp $BUILD_DIRECTORY/opnfv.properties gs://$GS_URL/latest.properties > gsutil.latest.log 2>&1
540 echo "--------------------------------------------------------"
542 echo "Artifact is available as http://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
545 name: 'builder-compass-download-artifact'
553 # log info to console
554 echo "Downloading the $INSTALLER artifact. This could take some time..."
555 echo "--------------------------------------------------------"
558 # get the latest.properties file in order to get info regarding latest artifact
559 [[ -d $BUILD_DIRECTORY ]] || mkdir -p $BUILD_DIRECTORY
560 curl -s -o $BUILD_DIRECTORY/latest.properties http://$GS_URL/latest.properties
562 # check if we got the file
563 [[ -f $BUILD_DIRECTORY/latest.properties ]] || exit 1
565 # source the file so we get OPNFV vars
566 source $BUILD_DIRECTORY/latest.properties
569 curl -s -o $BUILD_DIRECTORY/compass.iso http://$OPNFV_ARTIFACT_URL > gsutil.iso.log 2>&1
572 ls -al $BUILD_DIRECTORY/compass.iso
575 echo "--------------------------------------------------------"
579 name: 'builder-compass-workspace-cleanup'
587 # delete everything that is in $WORKSPACE
588 /bin/rm -rf $WORKSPACE
591 name: 'builder-compass-ci-preclean-workspace'
600 sudo rm $WORKSPACE -rf
601 git clone $GIT_BASE $WORKSPACE