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
131 installer: '{installer}'
134 - gerrit-trigger-scm:
135 credentials-id: '{ssh-credentials}'
137 choosing-strategy: 'default'
142 - change-merged-event
143 - comment-added-contains-event:
144 comment-contains-value: 'remerge'
146 - project-compare-type: 'ANT'
147 project-pattern: '{project}'
149 - branch-compare-type: 'ANT'
150 branch-pattern: '**/master'
153 - 'builder-compass-merge'
156 name: 'compass-daily-{stream}'
172 installer: '{installer}'
176 credentials-id: '{ssh-credentials}'
186 artifactDaysToKeep: -1
187 artifactNumToKeep: -1
191 - project: 'compass-build-iso'
195 - project: 'compass-deploy-virtual-cluster'
199 # - project: 'compass-deploy-virtual-cluster-odl'
203 - project: 'compass-deploy-virtual-cluster-onos'
208 name: 'compass-build-iso'
223 artifactDaysToKeep: -1
224 artifactNumToKeep: -1
230 installer: '{installer}'
234 credentials-id: '{ssh-credentials}'
239 - 'builder-compass-build-iso'
240 - 'builder-compass-upload-artifact'
241 - 'builder-compass-workspace-cleanup'
244 name: 'compass-build-ppa'
246 description: "build ppa(using docker) in huawei lab"
261 artifactDaysToKeep: -1
262 artifactNumToKeep: -1
268 installer: '{installer}'
272 credentials-id: '{ssh-credentials}'
277 - timed: 'H 16 * * *'
280 - 'builder-compass-make-ppa'
283 name: 'compass-deploy-virtual-{flavor}'
301 installer: '{installer}'
310 artifactDaysToKeep: -1
311 artifactNumToKeep: -1
314 - 'builder-compass-ci-preclean-workspace'
315 - 'builder-compass-download-artifact'
316 - 'builder-compass-deploy-virtual-flavor'
319 artifacts: 'ansible.log'
324 name: 'compass-deploy-bare-huawei-us'
328 node: 'huawei-us-deploy-bare-1'
342 installer: '{installer}'
347 artifactDaysToKeep: -1
348 artifactNumToKeep: -1
351 - 'builder-compass-ci-preclean-workspace'
352 - 'builder-compass-download-artifact'
353 - 'builder-compass-deploy-bare'
357 artifacts: 'ansible.log'
361 ########################
363 ########################
365 name: compass-parameter
369 default: '{installer}'
370 description: "Installer to use."
372 name: BUILD_DIRECTORY
373 default: $WORKSPACE/build_output
374 description: "Directory where the build artifact will be located upon the completion of the build."
376 name: CACHE_DIRECTORY
377 default: $HOME/opnfv/cache/$PROJECT
378 description: "Directory where the cache to be used during the build is located."
381 default: https://gerrit.opnfv.org/gerrit/$PROJECT
382 description: "Used for overriding the GIT URL coming from Global Jenkins configuration in case if the stuff is done on none-LF HW."
385 default: artifacts.opnfv.org/$PROJECT/
386 description: "URL to Google Storage."
389 default: build.opnfv.org/artifacts/$PROJECT/
390 description: "URL to Google Storage proxy"
393 default: "192.168.200.2"
396 default: "http://205.177.226.235:9999"
399 default: "$WORKSPACE/work/repo/"
401 ########################
403 ########################
405 name: 'builder-compass-merge'
412 name: 'builder-compass-make-ppa'
425 for i in $(find *.gz *.iso *.img -type f)
427 md5=$(md5sum $i | cut -d ' ' -f1)
430 curl -T $i.md5 $PPA_REPO
434 name: 'builder-compass-build-iso'
442 # log info to console
443 echo "Starting the build of $INSTALLER. This could take some time..."
444 echo "--------------------------------------------------------"
447 # create the cache directory if it doesn't exist
448 [[ -d $CACHE_DIRECTORY ]] || mkdir -p $CACHE_DIRECTORY
449 [[ -d $BUILD_DIRECTORY ]] || mkdir -p $BUILD_DIRECTORY
451 # set OPNFV_ARTIFACT_VERSION
452 export OPNFV_ARTIFACT_VERSION=$(date -u +"%Y-%m-%d_%H-%M-%S")
457 cp $PPA_CACHE/*.tar.gz $PPA_CACHE/*.iso $PPA_CACHE/*.img $CACHE_DIRECTORY/ -f
461 ./build.sh --iso-dir $BUILD_DIRECTORY/ --iso-name compass.iso -c $CACHE_DIRECTORY
463 # list the build artifacts
464 ls -al $BUILD_DIRECTORY
466 # save information regarding artifact into file
468 echo "OPNFV_ARTIFACT_VERSION=$OPNFV_ARTIFACT_VERSION"
469 echo "OPNFV_GIT_URL=$(git config --get remote.origin.url)"
470 echo "OPNFV_GIT_SHA1=$(git rev-parse HEAD)"
471 echo "OPNFV_ARTIFACT_URL=$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
472 echo "OPNFV_ARTIFACT_MD5SUM=$(md5sum $BUILD_DIRECTORY/compass.iso | cut -d' ' -f1)"
473 echo "OPNFV_BUILD_URL=$BUILD_URL"
474 ) > $BUILD_DIRECTORY/opnfv.properties
476 echo "--------------------------------------------------------"
480 name: 'builder-compass-deploy-virtual-flavor'
486 # log info to console
487 echo "Starting the deployment on virtual environment using $INSTALLER. This could take some time..."
488 echo "--------------------------------------------------------"
491 export ISO_URL=file://$BUILD_DIRECTORY/compass.iso
494 ./deploy.sh $FLAVOR_CONF
495 if [ $? -ne 0 ]; then
496 echo "depolyment failed!"
501 echo "--------------------------------------------------------"
504 ssh_options="-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no"
505 sshpass -p root scp 2>/dev/null $ssh_options root@${installer_ip}:/var/ansible/run/openstack_juno-opnfv2/ansible.log ./ &> /dev/null
510 name: 'builder-compass-deploy-bare'
516 # log info to console
517 echo "Starting the deployment on baremetal environment using $INSTALLER. This could take some time..."
518 echo "--------------------------------------------------------"
521 export CONFDIR=$WORKSPACE/deploy/conf/hardware_environment/huawei_us_lab/pod1
522 export ISO_URL=file://$BUILD_DIRECTORY/compass.iso
523 export EXTERNAL_NIC=eth0
524 export INSTALL_NIC=eth1
528 ./deploy.sh --dha $CONFDIR/dha.yml --network $CONFDIR/network.yml
529 if [ $? -ne 0 ]; then
530 echo "depolyment failed!"
535 echo "--------------------------------------------------------"
538 ssh_options="-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no"
539 sshpass -p root scp 2>/dev/null $ssh_options root@${installer_ip}:/var/ansible/run/openstack_juno-opnfv2/ansible.log ./ &> /dev/null
544 name: 'builder-compass-upload-artifact'
552 # log info to console
553 echo "Uploading the $INSTALLER artifact. This could take some time..."
554 echo "--------------------------------------------------------"
557 # source the opnfv.properties to get ARTIFACT_VERSION
558 source $BUILD_DIRECTORY/opnfv.properties
560 # upload artifact and additional files to google storage
561 gsutil cp $BUILD_DIRECTORY/compass.iso gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso > gsutil.iso.log 2>&1
562 gsutil cp $BUILD_DIRECTORY/opnfv.properties gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.properties > gsutil.properties.log 2>&1
563 gsutil cp $BUILD_DIRECTORY/opnfv.properties gs://$GS_URL/latest.properties > gsutil.latest.log 2>&1
566 echo "--------------------------------------------------------"
568 echo "Artifact is available as http://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
571 name: 'builder-compass-download-artifact'
579 # log info to console
580 echo "Downloading the $INSTALLER artifact. This could take some time..."
581 echo "--------------------------------------------------------"
584 # get the latest.properties file in order to get info regarding latest artifact
585 [[ -d $BUILD_DIRECTORY ]] || mkdir -p $BUILD_DIRECTORY
586 curl -s -o $BUILD_DIRECTORY/latest.properties http://$GS_URL/latest.properties
588 # check if we got the file
589 [[ -f $BUILD_DIRECTORY/latest.properties ]] || exit 1
591 # source the file so we get OPNFV vars
592 source $BUILD_DIRECTORY/latest.properties
595 curl -s -o $BUILD_DIRECTORY/compass.iso http://$OPNFV_ARTIFACT_URL > gsutil.iso.log 2>&1
598 ls -al $BUILD_DIRECTORY/compass.iso
601 echo "--------------------------------------------------------"
605 name: 'builder-compass-workspace-cleanup'
613 # delete everything that is in $WORKSPACE
614 /bin/rm -rf $WORKSPACE
617 name: 'builder-compass-ci-preclean-workspace'
626 sudo rm $WORKSPACE -rf
627 git clone $GIT_BASE $WORKSPACE