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'
44 node: 'huawei-deploy-vm'
57 artifactDaysToKeep: -1
66 installer: '{installer}'
69 default: 'virtual_cluster'
73 credentials-id: '{ssh-credentials}'
74 refspec: '$GERRIT_REFSPEC'
75 choosing-strategy: 'gerrit'
80 - patchset-created-event:
81 exclude-drafts: 'false'
82 exclude-trivial-rebase: 'false'
83 exclude-no-code-change: 'false'
84 - draft-published-event
85 - comment-added-contains-event:
86 comment-contains-value: 'recheck'
87 - comment-added-contains-event:
88 comment-contains-value: 'reverify'
90 - project-compare-type: 'ANT'
91 project-pattern: '{project}'
93 - branch-compare-type: 'ANT'
94 branch-pattern: '**/master'
100 - 'builder-compass-build-iso'
101 - 'builder-compass-deploy-virtual-flavor'
104 artifacts: 'ansible.log'
109 name: 'compass-merge'
111 # builder-merge job to run JJB update
113 # This job's purpose is to update all the JJB
128 artifactDaysToKeep: -1
137 installer: '{installer}'
140 - gerrit-trigger-scm:
141 credentials-id: '{ssh-credentials}'
143 choosing-strategy: 'default'
148 - change-merged-event
149 - comment-added-contains-event:
150 comment-contains-value: 'remerge'
152 - project-compare-type: 'ANT'
153 project-pattern: '{project}'
155 - branch-compare-type: 'ANT'
156 branch-pattern: '**/master'
159 - 'builder-compass-merge'
162 name: 'compass-daily-{stream}'
178 installer: '{installer}'
182 credentials-id: '{ssh-credentials}'
192 artifactDaysToKeep: -1
193 artifactNumToKeep: -1
197 - project: 'compass-build-iso'
201 - project: 'compass-deploy-virtual-cluster'
205 # - project: 'compass-deploy-virtual-cluster-odl'
209 - project: 'compass-deploy-virtual-cluster-onos'
214 name: 'compass-build-iso'
229 artifactDaysToKeep: -1
230 artifactNumToKeep: -1
236 installer: '{installer}'
240 credentials-id: '{ssh-credentials}'
245 - 'builder-compass-build-iso'
246 - 'builder-compass-upload-artifact'
247 - 'builder-compass-workspace-cleanup'
250 name: 'compass-build-ppa'
252 description: "build ppa(using docker) in huawei lab"
267 artifactDaysToKeep: -1
268 artifactNumToKeep: -1
274 installer: '{installer}'
278 credentials-id: '{ssh-credentials}'
283 - timed: 'H 16 * * *'
286 - 'builder-compass-make-ppa'
289 name: 'compass-deploy-virtual-{flavor}'
307 installer: '{installer}'
316 artifactDaysToKeep: -1
317 artifactNumToKeep: -1
320 - 'builder-compass-ci-preclean-workspace'
321 - 'builder-compass-download-artifact'
322 - 'builder-compass-deploy-virtual-flavor'
325 artifacts: 'ansible.log'
330 name: 'compass-deploy-bare-huawei-us'
334 node: 'huawei-us-deploy-bare-1'
348 installer: '{installer}'
353 artifactDaysToKeep: -1
354 artifactNumToKeep: -1
357 - 'builder-compass-ci-preclean-workspace'
358 - 'builder-compass-download-artifact'
359 - 'builder-compass-deploy-bare'
363 artifacts: 'ansible.log'
367 ########################
369 ########################
371 name: compass-parameter
375 default: '{installer}'
376 description: "Installer to use."
378 name: BUILD_DIRECTORY
379 default: $WORKSPACE/build_output
380 description: "Directory where the build artifact will be located upon the completion of the build."
382 name: CACHE_DIRECTORY
383 default: $HOME/opnfv/cache/$PROJECT
384 description: "Directory where the cache to be used during the build is located."
387 default: https://gerrit.opnfv.org/gerrit/$PROJECT
388 description: "Used for overriding the GIT URL coming from Global Jenkins configuration in case if the stuff is done on none-LF HW."
391 default: artifacts.opnfv.org/$PROJECT/
392 description: "URL to Google Storage."
395 default: build.opnfv.org/artifacts/$PROJECT/
396 description: "URL to Google Storage proxy"
399 default: "192.168.200.2"
402 default: "http://205.177.226.235:9999"
405 default: "$WORKSPACE/work/repo/"
407 ########################
409 ########################
411 name: 'builder-compass-merge'
418 name: 'builder-compass-make-ppa'
431 for i in $(find *.gz *.iso *.img -type f)
433 md5=$(md5sum $i | cut -d ' ' -f1)
436 curl -T $i.md5 $PPA_REPO
440 name: 'builder-compass-build-iso'
448 # log info to console
449 echo "Starting the build of $INSTALLER. This could take some time..."
450 echo "--------------------------------------------------------"
453 # create the cache directory if it doesn't exist
454 [[ -d $CACHE_DIRECTORY ]] || mkdir -p $CACHE_DIRECTORY
455 [[ -d $BUILD_DIRECTORY ]] || mkdir -p $BUILD_DIRECTORY
457 # set OPNFV_ARTIFACT_VERSION
458 export OPNFV_ARTIFACT_VERSION=$(date -u +"%Y-%m-%d_%H-%M-%S")
463 cp $PPA_CACHE/*.tar.gz $PPA_CACHE/*.iso $PPA_CACHE/*.img $CACHE_DIRECTORY/ -f
467 ./build.sh --iso-dir $BUILD_DIRECTORY/ --iso-name compass.iso -c $CACHE_DIRECTORY
469 # list the build artifacts
470 ls -al $BUILD_DIRECTORY
472 # save information regarding artifact into file
474 echo "OPNFV_ARTIFACT_VERSION=$OPNFV_ARTIFACT_VERSION"
475 echo "OPNFV_GIT_URL=$(git config --get remote.origin.url)"
476 echo "OPNFV_GIT_SHA1=$(git rev-parse HEAD)"
477 echo "OPNFV_ARTIFACT_URL=$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
478 echo "OPNFV_ARTIFACT_MD5SUM=$(md5sum $BUILD_DIRECTORY/compass.iso | cut -d' ' -f1)"
479 echo "OPNFV_BUILD_URL=$BUILD_URL"
480 ) > $BUILD_DIRECTORY/opnfv.properties
482 echo "--------------------------------------------------------"
486 name: 'builder-compass-deploy-virtual-flavor'
492 # log info to console
493 echo "Starting the deployment on virtual environment using $INSTALLER. This could take some time..."
494 echo "--------------------------------------------------------"
497 export ISO_URL=file://$BUILD_DIRECTORY/compass.iso
500 ./deploy.sh $FLAVOR_CONF
501 if [ $? -ne 0 ]; then
502 echo "depolyment failed!"
507 echo "--------------------------------------------------------"
510 ssh_options="-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no"
511 sshpass -p root scp 2>/dev/null $ssh_options root@${installer_ip}:/var/ansible/run/openstack_juno-opnfv2/ansible.log ./ &> /dev/null
516 name: 'builder-compass-deploy-bare'
522 # log info to console
523 echo "Starting the deployment on baremetal environment using $INSTALLER. This could take some time..."
524 echo "--------------------------------------------------------"
527 export CONFDIR=$WORKSPACE/deploy/conf/hardware_environment/huawei_us_lab/pod1
528 export ISO_URL=file://$BUILD_DIRECTORY/compass.iso
529 export EXTERNAL_NIC=eth0
530 export INSTALL_NIC=eth1
534 ./deploy.sh --dha $CONFDIR/dha.yml --network $CONFDIR/network.yml
535 if [ $? -ne 0 ]; then
536 echo "depolyment failed!"
541 echo "--------------------------------------------------------"
544 ssh_options="-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no"
545 sshpass -p root scp 2>/dev/null $ssh_options root@${installer_ip}:/var/ansible/run/openstack_juno-opnfv2/ansible.log ./ &> /dev/null
550 name: 'builder-compass-upload-artifact'
558 # log info to console
559 echo "Uploading the $INSTALLER artifact. This could take some time..."
560 echo "--------------------------------------------------------"
563 # source the opnfv.properties to get ARTIFACT_VERSION
564 source $BUILD_DIRECTORY/opnfv.properties
566 # upload artifact and additional files to google storage
567 gsutil cp $BUILD_DIRECTORY/compass.iso gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso > gsutil.iso.log 2>&1
568 gsutil cp $BUILD_DIRECTORY/opnfv.properties gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.properties > gsutil.properties.log 2>&1
569 gsutil cp $BUILD_DIRECTORY/opnfv.properties gs://$GS_URL/latest.properties > gsutil.latest.log 2>&1
572 echo "--------------------------------------------------------"
574 echo "Artifact is available as http://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
577 name: 'builder-compass-download-artifact'
585 # log info to console
586 echo "Downloading the $INSTALLER artifact. This could take some time..."
587 echo "--------------------------------------------------------"
590 # get the latest.properties file in order to get info regarding latest artifact
591 [[ -d $BUILD_DIRECTORY ]] || mkdir -p $BUILD_DIRECTORY
592 curl -s -o $BUILD_DIRECTORY/latest.properties http://$GS_URL/latest.properties
594 # check if we got the file
595 [[ -f $BUILD_DIRECTORY/latest.properties ]] || exit 1
597 # source the file so we get OPNFV vars
598 source $BUILD_DIRECTORY/latest.properties
601 curl -s -o $BUILD_DIRECTORY/compass.iso http://$OPNFV_ARTIFACT_URL > gsutil.iso.log 2>&1
604 ls -al $BUILD_DIRECTORY/compass.iso
607 echo "--------------------------------------------------------"
611 name: 'builder-compass-workspace-cleanup'
619 # delete everything that is in $WORKSPACE
620 /bin/rm -rf $WORKSPACE
623 name: 'builder-compass-ci-preclean-workspace'
632 sudo rm $WORKSPACE -rf
633 git clone $GIT_BASE $WORKSPACE