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'
59 artifactDaysToKeep: -1
68 installer: '{installer}'
71 default: 'virtual_cluster'
75 credentials-id: '{ssh-credentials}'
76 refspec: '$GERRIT_REFSPEC'
77 choosing-strategy: 'gerrit'
80 - ssh-agent-credentials:
81 user: '{ssh-credentials}'
86 - patchset-created-event:
87 exclude-drafts: 'false'
88 exclude-trivial-rebase: 'false'
89 exclude-no-code-change: 'false'
90 - draft-published-event
91 - comment-added-contains-event:
92 comment-contains-value: 'recheck'
93 - comment-added-contains-event:
94 comment-contains-value: 'reverify'
96 - project-compare-type: 'ANT'
97 project-pattern: '{project}'
99 - branch-compare-type: 'ANT'
100 branch-pattern: '**/master'
101 forbidden-file-paths:
106 - 'builder-compass-build-iso'
107 - 'builder-compass-deploy-virtual-flavor'
110 artifacts: 'ansible.log'
115 name: 'compass-merge'
117 # builder-merge job to run JJB update
119 # This job's purpose is to update all the JJB
121 project-type: freestyle
136 artifactDaysToKeep: -1
145 installer: '{installer}'
148 - gerrit-trigger-scm:
149 credentials-id: '{ssh-credentials}'
151 choosing-strategy: 'default'
154 - ssh-agent-credentials:
155 user: '{ssh-credentials}'
160 - change-merged-event
161 - comment-added-contains-event:
162 comment-contains-value: 'remerge'
164 - project-compare-type: 'ANT'
165 project-pattern: '{project}'
167 - branch-compare-type: 'ANT'
168 branch-pattern: '**/master'
171 - 'builder-compass-merge'
174 name: 'compass-daily-{stream}'
176 project-type: freestyle
192 installer: '{installer}'
196 credentials-id: '{ssh-credentials}'
206 artifactDaysToKeep: -1
207 artifactNumToKeep: -1
211 - project: 'compass-build-iso'
215 - project: 'compass-deploy-virtual-cluster'
219 # - project: 'compass-deploy-virtual-cluster-odl'
223 - project: 'compass-deploy-virtual-cluster-onos'
228 name: 'compass-build-iso'
230 project-type: freestyle
245 artifactDaysToKeep: -1
246 artifactNumToKeep: -1
252 installer: '{installer}'
256 credentials-id: '{ssh-credentials}'
261 - 'builder-compass-build-iso'
262 - 'builder-compass-upload-artifact'
263 - 'builder-compass-workspace-cleanup'
266 name: 'compass-build-ppa'
268 description: "build ppa(using docker) in huawei lab"
270 project-type: freestyle
285 artifactDaysToKeep: -1
286 artifactNumToKeep: -1
292 installer: '{installer}'
296 credentials-id: '{ssh-credentials}'
301 - timed: 'H 16 * * *'
304 - 'builder-compass-make-ppa'
307 name: 'compass-deploy-virtual-{flavor}'
309 project-type: freestyle
327 installer: '{installer}'
337 artifactDaysToKeep: -1
338 artifactNumToKeep: -1
342 - 'builder-compass-ci-preclean-workspace'
343 - 'builder-compass-download-artifact'
344 - 'builder-compass-deploy-virtual-flavor'
347 artifacts: 'ansible.log'
353 name: 'compass-deploy-bare-huawei-us'
355 project-type: freestyle
359 node: 'huawei-us-deploy-bare-1'
373 installer: '{installer}'
378 artifactDaysToKeep: -1
379 artifactNumToKeep: -1
382 - 'builder-compass-ci-preclean-workspace'
383 - 'builder-compass-download-artifact'
384 - 'builder-compass-deploy-bare'
388 artifacts: 'ansible.log'
393 ########################
395 ########################
397 name: compass-parameter
401 default: '{installer}'
402 description: "Installer to use."
404 name: BUILD_DIRECTORY
405 default: $WORKSPACE/build_output
406 description: "Directory where the build artifact will be located upon the completion of the build."
408 name: CACHE_DIRECTORY
409 default: $HOME/opnfv/cache/$PROJECT
410 description: "Directory where the cache to be used during the build is located."
413 default: https://gerrit.opnfv.org/gerrit/$PROJECT
414 description: "Used for overriding the GIT URL coming from Global Jenkins configuration in case if the stuff is done on none-LF HW."
417 default: artifacts.opnfv.org/$PROJECT/
418 description: "URL to Google Storage."
421 default: build.opnfv.org/artifacts/$PROJECT/
422 description: "URL to Google Storage proxy"
425 default: "192.168.200.2"
428 default: "http://205.177.226.235:9999"
431 default: "$WORKSPACE/work/repo/"
433 ########################
435 ########################
437 name: 'builder-compass-merge'
444 name: 'builder-compass-make-ppa'
457 for i in $(find *.gz *.iso *.img -type f)
459 md5=$(md5sum $i | cut -d ' ' -f1)
462 curl -T $i.md5 $PPA_REPO
466 name: 'builder-compass-build-iso'
474 # log info to console
475 echo "Starting the build of $INSTALLER. This could take some time..."
476 echo "--------------------------------------------------------"
479 # create the cache directory if it doesn't exist
480 [[ -d $CACHE_DIRECTORY ]] || mkdir -p $CACHE_DIRECTORY
481 [[ -d $BUILD_DIRECTORY ]] || mkdir -p $BUILD_DIRECTORY
483 # set OPNFV_ARTIFACT_VERSION
484 export OPNFV_ARTIFACT_VERSION=$(date -u +"%Y-%m-%d_%H-%M-%S")
489 cp $PPA_CACHE/*.tar.gz $PPA_CACHE/*.iso $PPA_CACHE/*.img $CACHE_DIRECTORY/ -f
493 ./build.sh --iso-dir $BUILD_DIRECTORY/ --iso-name compass.iso -c $CACHE_DIRECTORY
495 # list the build artifacts
496 ls -al $BUILD_DIRECTORY
498 # save information regarding artifact into file
500 echo "OPNFV_ARTIFACT_VERSION=$OPNFV_ARTIFACT_VERSION"
501 echo "OPNFV_GIT_URL=$(git config --get remote.origin.url)"
502 echo "OPNFV_GIT_SHA1=$(git rev-parse HEAD)"
503 echo "OPNFV_ARTIFACT_URL=$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
504 echo "OPNFV_ARTIFACT_MD5SUM=$(md5sum $BUILD_DIRECTORY/compass.iso | cut -d' ' -f1)"
505 echo "OPNFV_BUILD_URL=$BUILD_URL"
506 ) > $BUILD_DIRECTORY/opnfv.properties
508 echo "--------------------------------------------------------"
512 name: 'builder-compass-deploy-virtual-flavor'
518 # log info to console
519 echo "Starting the deployment on virtual environment using $INSTALLER. This could take some time..."
520 echo "--------------------------------------------------------"
523 export ISO_URL=file://$BUILD_DIRECTORY/compass.iso
526 ./deploy.sh $FLAVOR_CONF
527 if [ $? -ne 0 ]; then
528 echo "depolyment failed!"
533 echo "--------------------------------------------------------"
536 ssh_options="-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no"
537 sshpass -p root scp 2>/dev/null $ssh_options root@${installer_ip}:/var/ansible/run/openstack_juno-opnfv2/ansible.log ./ &> /dev/null
542 name: 'builder-compass-deploy-bare'
548 # log info to console
549 echo "Starting the deployment on baremetal environment using $INSTALLER. This could take some time..."
550 echo "--------------------------------------------------------"
553 export CONFDIR=$WORKSPACE/deploy/conf/hardware_environment/huawei_us_lab/pod1
554 export ISO_URL=file://$BUILD_DIRECTORY/compass.iso
555 export EXTERNAL_NIC=eth0
556 export INSTALL_NIC=eth1
560 ./deploy.sh --dha $CONFDIR/dha.yml --network $CONFDIR/network.yml
561 if [ $? -ne 0 ]; then
562 echo "depolyment failed!"
567 echo "--------------------------------------------------------"
570 ssh_options="-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no"
571 sshpass -p root scp 2>/dev/null $ssh_options root@${installer_ip}:/var/ansible/run/openstack_juno-opnfv2/ansible.log ./ &> /dev/null
576 name: 'builder-compass-upload-artifact'
584 # log info to console
585 echo "Uploading the $INSTALLER artifact. This could take some time..."
586 echo "--------------------------------------------------------"
589 # source the opnfv.properties to get ARTIFACT_VERSION
590 source $BUILD_DIRECTORY/opnfv.properties
592 # upload artifact and additional files to google storage
593 gsutil cp $BUILD_DIRECTORY/compass.iso gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso > gsutil.iso.log 2>&1
594 gsutil cp $BUILD_DIRECTORY/opnfv.properties gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.properties > gsutil.properties.log 2>&1
595 gsutil cp $BUILD_DIRECTORY/opnfv.properties gs://$GS_URL/latest.properties > gsutil.latest.log 2>&1
599 echo "--------------------------------------------------------"
601 echo "Artifact is available as http://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
604 name: 'builder-compass-download-artifact'
612 # log info to console
613 echo "Downloading the $INSTALLER artifact. This could take some time..."
614 echo "--------------------------------------------------------"
617 # get the latest.properties file in order to get info regarding latest artifact
618 [[ -d $BUILD_DIRECTORY ]] || mkdir -p $BUILD_DIRECTORY
619 curl -s -o $BUILD_DIRECTORY/latest.properties http://$GS_URL/latest.properties
621 # check if we got the file
622 [[ -f $BUILD_DIRECTORY/latest.properties ]] || exit 1
624 # source the file so we get OPNFV vars
625 source $BUILD_DIRECTORY/latest.properties
628 curl -s -o $BUILD_DIRECTORY/compass.iso http://$OPNFV_ARTIFACT_URL > gsutil.iso.log 2>&1
631 ls -al $BUILD_DIRECTORY/compass.iso
634 echo "--------------------------------------------------------"
638 name: 'builder-compass-workspace-cleanup'
646 # delete everything that is in $WORKSPACE
647 /bin/rm -rf $WORKSPACE
650 name: 'builder-compass-ci-preclean-workspace'
659 sudo rm $WORKSPACE -rf
660 git clone $GIT_BASE $WORKSPACE