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'
83 - patchset-created-event:
84 exclude-drafts: 'false'
85 exclude-trivial-rebase: 'false'
86 exclude-no-code-change: 'false'
87 - draft-published-event
88 - comment-added-contains-event:
89 comment-contains-value: 'recheck'
90 - comment-added-contains-event:
91 comment-contains-value: 'reverify'
93 - project-compare-type: 'ANT'
94 project-pattern: '{project}'
96 - branch-compare-type: 'ANT'
97 branch-pattern: '**/master'
103 - 'builder-compass-build-iso'
104 - 'builder-compass-deploy-virtual-flavor'
107 artifacts: 'ansible.log'
112 name: 'compass-merge'
114 # builder-merge job to run JJB update
116 # This job's purpose is to update all the JJB
118 project-type: freestyle
133 artifactDaysToKeep: -1
142 installer: '{installer}'
145 - gerrit-trigger-scm:
146 credentials-id: '{ssh-credentials}'
148 choosing-strategy: 'default'
153 - change-merged-event
154 - comment-added-contains-event:
155 comment-contains-value: 'remerge'
157 - project-compare-type: 'ANT'
158 project-pattern: '{project}'
160 - branch-compare-type: 'ANT'
161 branch-pattern: '**/master'
164 - 'builder-compass-merge'
167 name: 'compass-daily-{stream}'
169 project-type: freestyle
185 installer: '{installer}'
189 credentials-id: '{ssh-credentials}'
199 artifactDaysToKeep: -1
200 artifactNumToKeep: -1
204 - project: 'compass-build-iso'
208 - project: 'compass-deploy-virtual-cluster'
212 # - project: 'compass-deploy-virtual-cluster-odl'
216 - project: 'compass-deploy-virtual-cluster-onos'
221 name: 'compass-build-iso'
223 project-type: freestyle
238 artifactDaysToKeep: -1
239 artifactNumToKeep: -1
245 installer: '{installer}'
249 credentials-id: '{ssh-credentials}'
254 - 'builder-compass-build-iso'
255 - 'builder-compass-upload-artifact'
256 - 'builder-compass-workspace-cleanup'
259 name: 'compass-build-ppa'
261 description: "build ppa(using docker) in huawei lab"
263 project-type: freestyle
278 artifactDaysToKeep: -1
279 artifactNumToKeep: -1
285 installer: '{installer}'
289 credentials-id: '{ssh-credentials}'
294 - timed: 'H 16 * * *'
297 - 'builder-compass-make-ppa'
300 name: 'compass-deploy-virtual-{flavor}'
302 project-type: freestyle
320 installer: '{installer}'
330 artifactDaysToKeep: -1
331 artifactNumToKeep: -1
335 - 'builder-compass-ci-preclean-workspace'
336 - 'builder-compass-download-artifact'
337 - 'builder-compass-deploy-virtual-flavor'
340 artifacts: 'ansible.log'
346 name: 'compass-deploy-bare-huawei-us'
348 project-type: freestyle
352 node: 'huawei-us-deploy-bare-1'
366 installer: '{installer}'
371 artifactDaysToKeep: -1
372 artifactNumToKeep: -1
375 - 'builder-compass-ci-preclean-workspace'
376 - 'builder-compass-download-artifact'
377 - 'builder-compass-deploy-bare'
381 artifacts: 'ansible.log'
386 ########################
388 ########################
390 name: compass-parameter
394 default: '{installer}'
395 description: "Installer to use."
397 name: BUILD_DIRECTORY
398 default: $WORKSPACE/build_output
399 description: "Directory where the build artifact will be located upon the completion of the build."
401 name: CACHE_DIRECTORY
402 default: $HOME/opnfv/cache/$PROJECT
403 description: "Directory where the cache to be used during the build is located."
406 default: https://gerrit.opnfv.org/gerrit/$PROJECT
407 description: "Used for overriding the GIT URL coming from Global Jenkins configuration in case if the stuff is done on none-LF HW."
410 default: artifacts.opnfv.org/$PROJECT/
411 description: "URL to Google Storage."
414 default: build.opnfv.org/artifacts/$PROJECT/
415 description: "URL to Google Storage proxy"
418 default: "192.168.200.2"
421 default: "http://205.177.226.235:9999"
424 default: "$WORKSPACE/work/repo/"
426 ########################
428 ########################
430 name: 'builder-compass-merge'
437 name: 'builder-compass-make-ppa'
450 for i in $(find *.gz *.iso *.img -type f)
452 md5=$(md5sum $i | cut -d ' ' -f1)
455 curl -T $i.md5 $PPA_REPO
459 name: 'builder-compass-build-iso'
467 # log info to console
468 echo "Starting the build of $INSTALLER. This could take some time..."
469 echo "--------------------------------------------------------"
472 # create the cache directory if it doesn't exist
473 [[ -d $CACHE_DIRECTORY ]] || mkdir -p $CACHE_DIRECTORY
474 [[ -d $BUILD_DIRECTORY ]] || mkdir -p $BUILD_DIRECTORY
476 # set OPNFV_ARTIFACT_VERSION
477 export OPNFV_ARTIFACT_VERSION=$(date -u +"%Y-%m-%d_%H-%M-%S")
482 cp $PPA_CACHE/*.tar.gz $PPA_CACHE/*.iso $PPA_CACHE/*.img $CACHE_DIRECTORY/ -f
486 ./build.sh --iso-dir $BUILD_DIRECTORY/ --iso-name compass.iso -c $CACHE_DIRECTORY
488 # list the build artifacts
489 ls -al $BUILD_DIRECTORY
491 # save information regarding artifact into file
493 echo "OPNFV_ARTIFACT_VERSION=$OPNFV_ARTIFACT_VERSION"
494 echo "OPNFV_GIT_URL=$(git config --get remote.origin.url)"
495 echo "OPNFV_GIT_SHA1=$(git rev-parse HEAD)"
496 echo "OPNFV_ARTIFACT_URL=$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
497 echo "OPNFV_ARTIFACT_MD5SUM=$(md5sum $BUILD_DIRECTORY/compass.iso | cut -d' ' -f1)"
498 echo "OPNFV_BUILD_URL=$BUILD_URL"
499 ) > $BUILD_DIRECTORY/opnfv.properties
501 echo "--------------------------------------------------------"
505 name: 'builder-compass-deploy-virtual-flavor'
511 # log info to console
512 echo "Starting the deployment on virtual environment using $INSTALLER. This could take some time..."
513 echo "--------------------------------------------------------"
516 export ISO_URL=file://$BUILD_DIRECTORY/compass.iso
519 ./deploy.sh $FLAVOR_CONF
520 if [ $? -ne 0 ]; then
521 echo "depolyment failed!"
526 echo "--------------------------------------------------------"
529 ssh_options="-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no"
530 sshpass -p root scp 2>/dev/null $ssh_options root@${installer_ip}:/var/ansible/run/openstack_juno-opnfv2/ansible.log ./ &> /dev/null
535 name: 'builder-compass-deploy-bare'
541 # log info to console
542 echo "Starting the deployment on baremetal environment using $INSTALLER. This could take some time..."
543 echo "--------------------------------------------------------"
546 export CONFDIR=$WORKSPACE/deploy/conf/hardware_environment/huawei_us_lab/pod1
547 export ISO_URL=file://$BUILD_DIRECTORY/compass.iso
548 export EXTERNAL_NIC=eth0
549 export INSTALL_NIC=eth1
553 ./deploy.sh --dha $CONFDIR/dha.yml --network $CONFDIR/network.yml
554 if [ $? -ne 0 ]; then
555 echo "depolyment failed!"
560 echo "--------------------------------------------------------"
563 ssh_options="-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no"
564 sshpass -p root scp 2>/dev/null $ssh_options root@${installer_ip}:/var/ansible/run/openstack_juno-opnfv2/ansible.log ./ &> /dev/null
569 name: 'builder-compass-upload-artifact'
577 # log info to console
578 echo "Uploading the $INSTALLER artifact. This could take some time..."
579 echo "--------------------------------------------------------"
582 # source the opnfv.properties to get ARTIFACT_VERSION
583 source $BUILD_DIRECTORY/opnfv.properties
585 # upload artifact and additional files to google storage
586 gsutil cp $BUILD_DIRECTORY/compass.iso gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso > gsutil.iso.log 2>&1
587 gsutil cp $BUILD_DIRECTORY/opnfv.properties gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.properties > gsutil.properties.log 2>&1
588 gsutil cp $BUILD_DIRECTORY/opnfv.properties gs://$GS_URL/latest.properties > gsutil.latest.log 2>&1
592 echo "--------------------------------------------------------"
594 echo "Artifact is available as http://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
597 name: 'builder-compass-download-artifact'
605 # log info to console
606 echo "Downloading the $INSTALLER artifact. This could take some time..."
607 echo "--------------------------------------------------------"
610 # get the latest.properties file in order to get info regarding latest artifact
611 [[ -d $BUILD_DIRECTORY ]] || mkdir -p $BUILD_DIRECTORY
612 curl -s -o $BUILD_DIRECTORY/latest.properties http://$GS_URL/latest.properties
614 # check if we got the file
615 [[ -f $BUILD_DIRECTORY/latest.properties ]] || exit 1
617 # source the file so we get OPNFV vars
618 source $BUILD_DIRECTORY/latest.properties
621 curl -s -o $BUILD_DIRECTORY/compass.iso http://$OPNFV_ARTIFACT_URL > gsutil.iso.log 2>&1
624 ls -al $BUILD_DIRECTORY/compass.iso
627 echo "--------------------------------------------------------"
631 name: 'builder-compass-workspace-cleanup'
639 # delete everything that is in $WORKSPACE
640 /bin/rm -rf $WORKSPACE
643 name: 'builder-compass-ci-preclean-workspace'
652 sudo rm $WORKSPACE -rf
653 git clone $GIT_BASE $WORKSPACE