8 - 'compass-verify-{stream}'
9 - 'compass-daily-{stream}'
10 - 'compass-build-iso-{stream}'
11 - 'compass-build-ppa-{stream}'
12 - 'compass-deploy-virtual-{flavor}-{stream}'
13 - 'compass-deploy-bare-huawei-us-{stream}'
15 # only master branch is enabled at the moment to keep no of jobs sane
21 # branch: 'stable/{stream}'
22 # gs-pathname: '/{stream}'
26 conf: 'virtual_cluster_odl'
27 node: 'huawei-deploy-vm'
29 conf: 'virtual_cluster_onos'
30 node: 'huawei-deploy-vm'
32 conf: 'virtual_cluster'
33 node: 'huawei-deploy-vm'
35 project: 'compass4nfv'
37 ########################
39 ########################
41 name: 'compass-verify-{stream}'
45 node: 'huawei-deploy-vm'
61 installer: '{installer}'
62 gs-pathname: '{gs-pathname}'
65 default: 'virtual_cluster'
69 credentials-id: '{ssh-credentials}'
70 refspec: '$GERRIT_REFSPEC'
71 choosing-strategy: 'gerrit'
76 - patchset-created-event:
77 exclude-drafts: 'false'
78 exclude-trivial-rebase: 'false'
79 exclude-no-code-change: 'false'
80 - draft-published-event
81 - comment-added-contains-event:
82 comment-contains-value: 'recheck'
83 - comment-added-contains-event:
84 comment-contains-value: 'reverify'
86 - project-compare-type: 'ANT'
87 project-pattern: '{project}'
89 - branch-compare-type: 'ANT'
90 branch-pattern: '**/{branch}'
93 pattern: 'docs/**|.gitignore'
96 - 'builder-compass-build-iso'
97 - 'builder-compass-deploy-virtual-flavor'
100 artifacts: 'ansible.log'
105 name: 'compass-daily-{stream}'
121 installer: '{installer}'
122 gs-pathname: '{gs-pathname}'
126 credentials-id: '{ssh-credentials}'
131 - timed: 'H 16 * * *'
135 - project: 'compass-build-iso-{stream}'
139 - project: 'compass-deploy-virtual-cluster-{stream}'
143 - project: 'compass-deploy-virtual-cluster-odl-{stream}'
147 - project: 'compass-deploy-virtual-cluster-onos-{stream}'
151 - project: 'compass-deploy-bare-huawei-us-{stream}'
157 name: 'compass-build-iso-{stream}'
173 installer: '{installer}'
174 gs-pathname: '{gs-pathname}'
178 credentials-id: '{ssh-credentials}'
183 - 'builder-compass-build-iso'
184 - 'builder-compass-upload-artifact'
185 - 'builder-compass-workspace-cleanup'
188 name: 'compass-build-ppa-{stream}'
190 description: "build ppa(using docker) in huawei lab"
206 installer: '{installer}'
207 gs-pathname: '{gs-pathname}'
211 credentials-id: '{ssh-credentials}'
216 - timed: 'H 16 * * *'
219 - 'builder-compass-make-ppa'
222 name: 'compass-deploy-virtual-{flavor}-{stream}'
240 installer: '{installer}'
241 gs-pathname: '{gs-pathname}'
248 - 'builder-compass-ci-preclean-workspace'
249 - 'builder-compass-download-artifact'
250 - 'builder-compass-deploy-virtual-flavor'
253 artifacts: 'ansible.log'
258 name: 'compass-deploy-bare-huawei-us-{stream}'
262 node: 'huawei-us-deploy-bare-1'
276 installer: '{installer}'
277 gs-pathname: '{gs-pathname}'
280 - 'builder-compass-ci-preclean-workspace'
281 - 'builder-compass-download-artifact'
282 - 'builder-compass-deploy-bare'
286 artifacts: 'ansible.log'
290 ########################
292 ########################
294 name: compass-parameter
298 default: '{installer}'
299 description: "Installer to use."
301 name: BUILD_DIRECTORY
302 default: $WORKSPACE/build_output
303 description: "Directory where the build artifact will be located upon the completion of the build."
305 name: CACHE_DIRECTORY
306 default: $HOME/opnfv/cache/$PROJECT
307 description: "Directory where the cache to be used during the build is located."
310 default: https://gerrit.opnfv.org/gerrit/$PROJECT
311 description: "Used for overriding the GIT URL coming from Global Jenkins configuration in case if the stuff is done on none-LF HW."
314 default: artifacts.opnfv.org/$PROJECT{gs-pathname}
315 description: "URL to Google Storage."
318 default: build.opnfv.org/artifacts/$PROJECT/
319 description: "URL to Google Storage proxy"
322 default: "192.168.200.2"
325 default: "http://205.177.226.235:9999"
328 default: "$WORKSPACE/work/repo/"
330 name: COMPASS_OPENSTACK_VERSION
335 name: COMPASS_OS_VERSION
340 ########################
342 ########################
344 name: 'builder-compass-make-ppa'
357 for i in $(find *.gz *.iso *.img -type f)
359 md5=$(md5sum $i | cut -d ' ' -f1)
362 curl -T $i.md5 $PPA_REPO
366 name: 'builder-compass-build-iso'
374 # log info to console
375 echo "Starting the build of $INSTALLER. This could take some time..."
376 echo "--------------------------------------------------------"
379 # create the cache directory if it doesn't exist
380 [[ -d $CACHE_DIRECTORY ]] || mkdir -p $CACHE_DIRECTORY
381 [[ -d $BUILD_DIRECTORY ]] || mkdir -p $BUILD_DIRECTORY
383 # set OPNFV_ARTIFACT_VERSION
384 export OPNFV_ARTIFACT_VERSION=$(date -u +"%Y-%m-%d_%H-%M-%S")
389 cp $PPA_CACHE/*.tar.gz $PPA_CACHE/*.iso $PPA_CACHE/*.img $CACHE_DIRECTORY/ -f
393 ./build.sh --iso-dir $BUILD_DIRECTORY/ --iso-name compass.iso -c $CACHE_DIRECTORY
395 # list the build artifacts
396 ls -al $BUILD_DIRECTORY
398 # save information regarding artifact into file
400 echo "OPNFV_ARTIFACT_VERSION=$OPNFV_ARTIFACT_VERSION"
401 echo "OPNFV_GIT_URL=$(git config --get remote.origin.url)"
402 echo "OPNFV_GIT_SHA1=$(git rev-parse HEAD)"
403 echo "OPNFV_ARTIFACT_URL=$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
404 echo "OPNFV_ARTIFACT_MD5SUM=$(md5sum $BUILD_DIRECTORY/compass.iso | cut -d' ' -f1)"
405 echo "OPNFV_BUILD_URL=$BUILD_URL"
406 ) > $BUILD_DIRECTORY/opnfv.properties
408 echo "--------------------------------------------------------"
412 name: 'builder-compass-deploy-virtual-flavor'
418 # log info to console
419 echo "Starting the deployment on virtual environment using $INSTALLER. This could take some time..."
420 echo "--------------------------------------------------------"
423 export ISO_URL=file://$BUILD_DIRECTORY/compass.iso
424 sudo brctl addbr vnic_ci
425 sudo ifconfig vnic_ci up
426 export EXTERNAL_NIC=vnic_ci
429 export OS_VERSION=${COMPASS_OS_VERSION}
430 export OPENSTACK_VERSION=${COMPASS_OPENSTACK_VERSION}
431 ./deploy.sh $FLAVOR_CONF
432 if [ $? -ne 0 ]; then
433 echo "depolyment failed!"
438 echo "--------------------------------------------------------"
441 ssh_options="-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no"
442 sshpass -p root scp 2>/dev/null $ssh_options root@${installer_ip}:/var/ansible/run/openstack_${COMPASS_OPENSTACK_VERSION}-opnfv2/ansible.log ./ &> /dev/null
447 name: 'builder-compass-deploy-bare'
453 # log info to console
454 echo "Starting the deployment on baremetal environment using $INSTALLER. This could take some time..."
455 echo "--------------------------------------------------------"
458 export CONFDIR=$WORKSPACE/deploy/conf/hardware_environment/huawei_us_lab/pod1
459 export ISO_URL=file://$BUILD_DIRECTORY/compass.iso
460 export EXTERNAL_NIC=eth0
461 export INSTALL_NIC=eth1
465 export OS_VERSION=${COMPASS_OS_VERSION}
466 export OPENSTACK_VERSION=${COMPASS_OPENSTACK_VERSION}
467 ./deploy.sh --dha $CONFDIR/dha.yml --network $CONFDIR/network.yml
468 if [ $? -ne 0 ]; then
469 echo "depolyment failed!"
474 echo "--------------------------------------------------------"
477 ssh_options="-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no"
478 sshpass -p root scp 2>/dev/null $ssh_options root@${installer_ip}:/var/ansible/run/openstack_${COMPASS_OPENSTACK_VERSION}-opnfv2/ansible.log ./ &> /dev/null
483 name: 'builder-compass-upload-artifact'
491 # log info to console
492 echo "Uploading the $INSTALLER artifact. This could take some time..."
493 echo "--------------------------------------------------------"
496 # source the opnfv.properties to get ARTIFACT_VERSION
497 source $BUILD_DIRECTORY/opnfv.properties
499 # upload artifact and additional files to google storage
500 gsutil cp $BUILD_DIRECTORY/compass.iso gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso > gsutil.iso.log 2>&1
501 gsutil cp $BUILD_DIRECTORY/opnfv.properties gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.properties > gsutil.properties.log 2>&1
502 gsutil cp $BUILD_DIRECTORY/opnfv.properties gs://$GS_URL/latest.properties > gsutil.latest.log 2>&1
505 echo "--------------------------------------------------------"
507 echo "Artifact is available as http://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
510 name: 'builder-compass-download-artifact'
518 # log info to console
519 echo "Downloading the $INSTALLER artifact. This could take some time..."
520 echo "--------------------------------------------------------"
523 # get the latest.properties file in order to get info regarding latest artifact
524 [[ -d $BUILD_DIRECTORY ]] || mkdir -p $BUILD_DIRECTORY
525 curl -s -o $BUILD_DIRECTORY/latest.properties http://$GS_URL/latest.properties
527 # check if we got the file
528 [[ -f $BUILD_DIRECTORY/latest.properties ]] || exit 1
530 # source the file so we get OPNFV vars
531 source $BUILD_DIRECTORY/latest.properties
534 curl -s -o $BUILD_DIRECTORY/compass.iso http://$OPNFV_ARTIFACT_URL > gsutil.iso.log 2>&1
537 ls -al $BUILD_DIRECTORY/compass.iso
540 echo "--------------------------------------------------------"
544 name: 'builder-compass-workspace-cleanup'
552 # delete everything that is in $WORKSPACE
553 /bin/rm -rf $WORKSPACE
556 name: 'builder-compass-ci-preclean-workspace'
565 sudo rm $WORKSPACE -rf
566 git clone $GIT_BASE $WORKSPACE