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'
60 installer: '{installer}'
63 default: 'virtual_cluster'
67 credentials-id: '{ssh-credentials}'
68 refspec: '$GERRIT_REFSPEC'
69 choosing-strategy: 'gerrit'
74 - patchset-created-event:
75 exclude-drafts: 'false'
76 exclude-trivial-rebase: 'false'
77 exclude-no-code-change: 'false'
78 - draft-published-event
79 - comment-added-contains-event:
80 comment-contains-value: 'recheck'
81 - comment-added-contains-event:
82 comment-contains-value: 'reverify'
84 - project-compare-type: 'ANT'
85 project-pattern: '{project}'
87 - branch-compare-type: 'ANT'
88 branch-pattern: '**/master'
94 - 'builder-compass-build-iso'
95 - 'builder-compass-deploy-virtual-flavor'
98 artifacts: 'ansible.log'
103 name: 'compass-merge'
105 # builder-merge job to run JJB update
107 # This job's purpose is to update all the JJB
125 installer: '{installer}'
128 - gerrit-trigger-scm:
129 credentials-id: '{ssh-credentials}'
131 choosing-strategy: 'default'
136 - change-merged-event
137 - comment-added-contains-event:
138 comment-contains-value: 'remerge'
140 - project-compare-type: 'ANT'
141 project-pattern: '{project}'
143 - branch-compare-type: 'ANT'
144 branch-pattern: '**/master'
147 - 'builder-compass-merge'
150 name: 'compass-daily-{stream}'
166 installer: '{installer}'
170 credentials-id: '{ssh-credentials}'
179 - project: 'compass-build-iso'
183 - project: 'compass-deploy-virtual-cluster'
187 # - project: 'compass-deploy-virtual-cluster-odl'
191 - project: 'compass-deploy-virtual-cluster-onos'
196 name: 'compass-build-iso'
212 installer: '{installer}'
216 credentials-id: '{ssh-credentials}'
221 - 'builder-compass-build-iso'
222 - 'builder-compass-upload-artifact'
223 - 'builder-compass-workspace-cleanup'
226 name: 'compass-build-ppa'
228 description: "build ppa(using docker) in huawei lab"
244 installer: '{installer}'
248 credentials-id: '{ssh-credentials}'
253 - timed: 'H 16 * * *'
256 - 'builder-compass-make-ppa'
259 name: 'compass-deploy-virtual-{flavor}'
277 installer: '{installer}'
284 - 'builder-compass-ci-preclean-workspace'
285 - 'builder-compass-download-artifact'
286 - 'builder-compass-deploy-virtual-flavor'
289 artifacts: 'ansible.log'
294 name: 'compass-deploy-bare-huawei-us'
298 node: 'huawei-us-deploy-bare-1'
312 installer: '{installer}'
315 - 'builder-compass-ci-preclean-workspace'
316 - 'builder-compass-download-artifact'
317 - 'builder-compass-deploy-bare'
321 artifacts: 'ansible.log'
325 ########################
327 ########################
329 name: compass-parameter
333 default: '{installer}'
334 description: "Installer to use."
336 name: BUILD_DIRECTORY
337 default: $WORKSPACE/build_output
338 description: "Directory where the build artifact will be located upon the completion of the build."
340 name: CACHE_DIRECTORY
341 default: $HOME/opnfv/cache/$PROJECT
342 description: "Directory where the cache to be used during the build is located."
345 default: https://gerrit.opnfv.org/gerrit/$PROJECT
346 description: "Used for overriding the GIT URL coming from Global Jenkins configuration in case if the stuff is done on none-LF HW."
349 default: artifacts.opnfv.org/$PROJECT/
350 description: "URL to Google Storage."
353 default: build.opnfv.org/artifacts/$PROJECT/
354 description: "URL to Google Storage proxy"
357 default: "192.168.200.2"
360 default: "http://205.177.226.235:9999"
363 default: "$WORKSPACE/work/repo/"
365 ########################
367 ########################
369 name: 'builder-compass-merge'
376 name: 'builder-compass-make-ppa'
389 for i in $(find *.gz *.iso *.img -type f)
391 md5=$(md5sum $i | cut -d ' ' -f1)
394 curl -T $i.md5 $PPA_REPO
398 name: 'builder-compass-build-iso'
406 # log info to console
407 echo "Starting the build of $INSTALLER. This could take some time..."
408 echo "--------------------------------------------------------"
411 # create the cache directory if it doesn't exist
412 [[ -d $CACHE_DIRECTORY ]] || mkdir -p $CACHE_DIRECTORY
413 [[ -d $BUILD_DIRECTORY ]] || mkdir -p $BUILD_DIRECTORY
415 # set OPNFV_ARTIFACT_VERSION
416 export OPNFV_ARTIFACT_VERSION=$(date -u +"%Y-%m-%d_%H-%M-%S")
421 cp $PPA_CACHE/*.tar.gz $PPA_CACHE/*.iso $PPA_CACHE/*.img $CACHE_DIRECTORY/ -f
425 ./build.sh --iso-dir $BUILD_DIRECTORY/ --iso-name compass.iso -c $CACHE_DIRECTORY
427 # list the build artifacts
428 ls -al $BUILD_DIRECTORY
430 # save information regarding artifact into file
432 echo "OPNFV_ARTIFACT_VERSION=$OPNFV_ARTIFACT_VERSION"
433 echo "OPNFV_GIT_URL=$(git config --get remote.origin.url)"
434 echo "OPNFV_GIT_SHA1=$(git rev-parse HEAD)"
435 echo "OPNFV_ARTIFACT_URL=$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
436 echo "OPNFV_ARTIFACT_MD5SUM=$(md5sum $BUILD_DIRECTORY/compass.iso | cut -d' ' -f1)"
437 echo "OPNFV_BUILD_URL=$BUILD_URL"
438 ) > $BUILD_DIRECTORY/opnfv.properties
440 echo "--------------------------------------------------------"
444 name: 'builder-compass-deploy-virtual-flavor'
450 # log info to console
451 echo "Starting the deployment on virtual environment using $INSTALLER. This could take some time..."
452 echo "--------------------------------------------------------"
455 export ISO_URL=file://$BUILD_DIRECTORY/compass.iso
458 ./deploy.sh $FLAVOR_CONF
459 if [ $? -ne 0 ]; then
460 echo "depolyment failed!"
465 echo "--------------------------------------------------------"
468 ssh_options="-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no"
469 sshpass -p root scp 2>/dev/null $ssh_options root@${installer_ip}:/var/ansible/run/openstack_juno-opnfv2/ansible.log ./ &> /dev/null
474 name: 'builder-compass-deploy-bare'
480 # log info to console
481 echo "Starting the deployment on baremetal environment using $INSTALLER. This could take some time..."
482 echo "--------------------------------------------------------"
485 export CONFDIR=$WORKSPACE/deploy/conf/hardware_environment/huawei_us_lab/pod1
486 export ISO_URL=file://$BUILD_DIRECTORY/compass.iso
487 export EXTERNAL_NIC=eth0
488 export INSTALL_NIC=eth1
492 ./deploy.sh --dha $CONFDIR/dha.yml --network $CONFDIR/network.yml
493 if [ $? -ne 0 ]; then
494 echo "depolyment failed!"
499 echo "--------------------------------------------------------"
502 ssh_options="-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no"
503 sshpass -p root scp 2>/dev/null $ssh_options root@${installer_ip}:/var/ansible/run/openstack_juno-opnfv2/ansible.log ./ &> /dev/null
508 name: 'builder-compass-upload-artifact'
516 # log info to console
517 echo "Uploading the $INSTALLER artifact. This could take some time..."
518 echo "--------------------------------------------------------"
521 # source the opnfv.properties to get ARTIFACT_VERSION
522 source $BUILD_DIRECTORY/opnfv.properties
524 # upload artifact and additional files to google storage
525 gsutil cp $BUILD_DIRECTORY/compass.iso gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso > gsutil.iso.log 2>&1
526 gsutil cp $BUILD_DIRECTORY/opnfv.properties gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.properties > gsutil.properties.log 2>&1
527 gsutil cp $BUILD_DIRECTORY/opnfv.properties gs://$GS_URL/latest.properties > gsutil.latest.log 2>&1
530 echo "--------------------------------------------------------"
532 echo "Artifact is available as http://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
535 name: 'builder-compass-download-artifact'
543 # log info to console
544 echo "Downloading the $INSTALLER artifact. This could take some time..."
545 echo "--------------------------------------------------------"
548 # get the latest.properties file in order to get info regarding latest artifact
549 [[ -d $BUILD_DIRECTORY ]] || mkdir -p $BUILD_DIRECTORY
550 curl -s -o $BUILD_DIRECTORY/latest.properties http://$GS_URL/latest.properties
552 # check if we got the file
553 [[ -f $BUILD_DIRECTORY/latest.properties ]] || exit 1
555 # source the file so we get OPNFV vars
556 source $BUILD_DIRECTORY/latest.properties
559 curl -s -o $BUILD_DIRECTORY/compass.iso http://$OPNFV_ARTIFACT_URL > gsutil.iso.log 2>&1
562 ls -al $BUILD_DIRECTORY/compass.iso
565 echo "--------------------------------------------------------"
569 name: 'builder-compass-workspace-cleanup'
577 # delete everything that is in $WORKSPACE
578 /bin/rm -rf $WORKSPACE
581 name: 'builder-compass-ci-preclean-workspace'
590 sudo rm $WORKSPACE -rf
591 git clone $GIT_BASE $WORKSPACE