4 - 'apex-verify-{stream}'
5 - 'apex-runner-{platform}-{scenario}-{stream}'
6 - 'apex-build-{stream}'
7 - 'apex-deploy-virtual-{scenario}-{stream}'
8 - 'apex-deploy-baremetal-{scenario}-{stream}'
9 - 'apex-daily-{stream}'
11 # stream: branch with - in place of / (eg. stable-arno)
12 # branch: branch (eg. stable/arno)
17 block-stream: 'brahmaputra'
20 branch: 'stable/brahmaputra'
21 gs-pathname: '/brahmaputra'
22 block-stream: 'master'
29 - 'os-odl_l2-nofeature-ha'
30 - 'os-odl_l2-sfc-noha'
31 - 'os-odl_l3-nofeature-ha'
32 - 'os-onos-nofeature-ha'
33 - 'os-opencontrail-nofeature-ha'
40 name: 'apex-verify-{stream}'
46 gs-pathname: '{gs-pathname}'
53 default: https://gerrit.opnfv.org/gerrit/$PROJECT
54 description: "Used for overriding the GIT URL coming from parameters macro."
58 credentials-id: '{ssh-credentials}'
59 refspec: '$GERRIT_REFSPEC'
60 choosing-strategy: 'gerrit'
65 - patchset-created-event:
66 exclude-drafts: 'false'
67 exclude-trivial-rebase: 'false'
68 exclude-no-code-change: 'true'
69 - draft-published-event
70 - comment-added-contains-event:
71 comment-contains-value: 'recheck'
72 - comment-added-contains-event:
73 comment-contains-value: 'reverify'
75 - project-compare-type: 'ANT'
76 project-pattern: 'apex'
78 - branch-compare-type: 'ANT'
79 branch-pattern: '**/{branch}'
92 use-build-blocker: true
98 - 'apex-verify-{block-stream}'
103 - project: 'apex-deploy-virtual-os-odl_l2-nofeature-ha-{stream}'
104 predefined-parameters: |
105 BUILD_DIRECTORY=apex-verify-{stream}/build_output
110 - project: 'apex-deploy-virtual-os-onos-nofeature-ha-{stream}'
111 predefined-parameters: |
112 BUILD_DIRECTORY=apex-verify-{stream}/build_output
117 - project: 'apex-deploy-virtual-os-odl_l3-nofeature-ha-{stream}'
118 predefined-parameters: |
119 BUILD_DIRECTORY=apex-verify-{stream}/build_output
124 - project: 'apex-deploy-virtual-os-odl_l2-sfc-noha-{stream}'
125 predefined-parameters: |
126 BUILD_DIRECTORY=apex-verify-{stream}/build_output
130 - 'apex-workspace-cleanup'
133 name: 'apex-runner-{platform}-{scenario}-{stream}'
135 # runner jobs for deploying manually
143 gs-pathname: '{gs-pathname}'
150 default: https://gerrit.opnfv.org/gerrit/$PROJECT
151 description: "Used for overriding the GIT URL coming from parameters macro."
154 - gerrit-trigger-scm:
155 credentials-id: '{ssh-credentials}'
157 choosing-strategy: 'default'
161 use-build-blocker: true
168 - project: 'apex-deploy-{platform}-{scenario}-{stream}'
169 predefined-parameters:
174 - project: 'yardstick-apex-opnfv-jump-1-daily-{stream}'
175 predefined-parameters:
176 DEPLOY_SCENARIO={scenario}
179 build-step-failure-threshold: 'never'
180 failure-threshold: 'never'
181 unstable-threshold: 'FAILURE'
183 - project: 'functest-apex-opnfv-jump-1-daily-{stream}'
184 predefined-parameters:
185 DEPLOY_SCENARIO={scenario}
188 build-step-failure-threshold: 'never'
189 failure-threshold: 'never'
190 unstable-threshold: 'FAILURE'
193 name: 'apex-build-{stream}'
195 # Job template for builds
197 # Required Variables:
198 # stream: branch with - in place of / (eg. stable)
199 # branch: branch (eg. stable)
208 gs-pathname: '{gs-pathname}'
213 default: https://gerrit.opnfv.org/gerrit/$PROJECT
214 description: "Used for overriding the GIT URL coming from parameters macro."
218 credentials-id: '{ssh-credentials}'
224 use-build-blocker: true
231 - project: 'apex-deploy-virtual-os-odl_l2-nofeature-ha-{stream}'
232 predefined-parameters: |
233 BUILD_DIRECTORY=apex-build-{stream}/build_output
237 - 'apex-upload-artifact'
240 name: 'apex-deploy-virtual-{scenario}-{stream}'
242 # Job template for virtual deployment
244 # Required Variables:
245 # stream: branch with - in place of / (eg. stable)
246 # branch: branch (eg. stable)
253 credentials-id: '{ssh-credentials}'
261 gs-pathname: '{gs-pathname}'
263 name: DEPLOY_SCENARIO
264 default: '{scenario}'
265 description: "Scenario to deploy with."
269 description: "Use yes in lower case to invoke clean. Indicates if the deploy environment should be cleaned before deployment"
273 use-build-blocker: true
278 - 'apex-deploy-virtual'
279 - 'apex-workspace-cleanup'
282 name: 'apex-deploy-baremetal-{scenario}-{stream}'
284 # Job template for baremetal deployment
286 # Required Variables:
287 # stream: branch with - in place of / (eg. stable)
288 # branch: branch (eg. stable)
295 credentials-id: '{ssh-credentials}'
303 gs-pathname: '{gs-pathname}'
305 name: DEPLOY_SCENARIO
306 default: '{scenario}'
307 description: "Scenario to deploy with."
311 use-build-blocker: true
319 - 'apex-deploy-baremetal'
320 - 'apex-workspace-cleanup'
323 name: 'apex-daily-{stream}'
325 # Job template for daily build
327 # Required Variables:
328 # stream: branch with - in place of / (eg. stable)
329 # branch: branch (eg. stable)
336 credentials-id: '{ssh-credentials}'
344 gs-pathname: '{gs-pathname}'
348 use-build-blocker: true
360 - project: 'apex-build-{stream}'
362 current-parameters: true
365 - project: 'apex-deploy-baremetal-os-odl_l2-nofeature-ha-{stream}'
366 predefined-parameters: |
367 BUILD_DIRECTORY=apex-build-{stream}/build_output
372 - project: 'functest-apex-opnfv-jump-1-daily-{stream}'
373 predefined-parameters:
374 DEPLOY_SCENARIO=os-odl_l2-nofeature-ha
377 build-step-failure-threshold: 'never'
378 failure-threshold: 'never'
379 unstable-threshold: 'FAILURE'
381 - project: 'yardstick-apex-opnfv-jump-1-daily-{stream}'
382 predefined-parameters:
383 DEPLOY_SCENARIO=os-odl_l2-nofeature-ha
386 build-step-failure-threshold: 'never'
387 failure-threshold: 'never'
388 unstable-threshold: 'FAILURE'
390 - project: 'apex-deploy-baremetal-os-onos-nofeature-ha-{stream}'
391 predefined-parameters:
392 BUILD_DIRECTORY=apex-build-{stream}/build_output
396 - project: 'functest-apex-opnfv-jump-1-daily-{stream}'
397 predefined-parameters:
398 DEPLOY_SCENARIO=os-onos-nofeature-ha
401 build-step-failure-threshold: 'never'
402 failure-threshold: 'never'
403 unstable-threshold: 'FAILURE'
405 - project: 'yardstick-apex-opnfv-jump-1-daily-{stream}'
406 predefined-parameters:
407 DEPLOY_SCENARIO=os-onos-nofeature-ha
410 build-step-failure-threshold: 'never'
411 failure-threshold: 'never'
412 unstable-threshold: 'FAILURE'
414 - project: 'apex-deploy-baremetal-os-odl_l3-nofeature-ha-{stream}'
415 predefined-parameters:
416 BUILD_DIRECTORY=apex-build-{stream}/build_output
420 - project: 'functest-apex-opnfv-jump-1-daily-{stream}'
421 predefined-parameters:
422 DEPLOY_SCENARIO=os-odl_l3-nofeature-ha
425 build-step-failure-threshold: 'never'
426 failure-threshold: 'never'
427 unstable-threshold: 'FAILURE'
429 - project: 'yardstick-apex-opnfv-jump-1-daily-{stream}'
430 predefined-parameters:
431 DEPLOY_SCENARIO=os-odl_l3-nofeature-ha
434 build-step-failure-threshold: 'never'
435 failure-threshold: 'never'
436 unstable-threshold: 'FAILURE'
438 ########################
440 ########################
447 description: "RPM Artifact name that will be appended to GS_URL to deploy a specific artifact"
449 name: ARTIFACT_VERSION
451 description: "Artifact version type"
453 name: BUILD_DIRECTORY
454 default: $WORKSPACE/build_output
455 description: "Directory where the build artifact will be located upon the completion of the build."
457 name: CACHE_DIRECTORY
458 default: $HOME/opnfv/cache{gs-pathname}
459 description: "Directory where the cache to be used during the build is located."
462 default: https://gerrit.opnfv.org/gerrit/$PROJECT
463 description: "Used for overriding the GIT URL coming from Global Jenkins configuration in case if the stuff is done on none-LF HW."
466 default: artifacts.opnfv.org/$PROJECT{gs-pathname}
467 description: "URL to Google Storage."
469 ########################
471 ########################
480 # log info to console
481 echo "Starting the build of Apex using OpenStack Master packages. This will take some time..."
482 echo "---------------------------------------------------------------------------------------"
484 # create the cache directory if it doesn't exist
485 [[ -d $CACHE_DIRECTORY ]] || mkdir -p $CACHE_DIRECTORY
486 # set OPNFV_ARTIFACT_VERSION
487 if echo $BUILD_TAG | grep "apex-verify" 1> /dev/null; then
488 if echo $GERRIT_BRANCH | grep "brahmaputra" 1> /dev/null; then
489 export OPNFV_ARTIFACT_VERSION=brahmaputra-dev${BUILD_NUMBER}
490 export BUILD_ARGS="-v $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY $BUILD_DIRECTORY"
492 export OPNFV_ARTIFACT_VERSION=dev${BUILD_NUMBER}
493 export BUILD_ARGS="-r $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY"
495 elif [ "$ARTIFACT_VERSION" == "daily" ]; then
496 if echo $GERRIT_BRANCH | grep "brahmaputra" 1> /dev/null; then
497 export OPNFV_ARTIFACT_VERSION=brahmaputra-$(date -u +"%Y-%m-%d")
498 export BUILD_ARGS="-v $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY $BUILD_DIRECTORY"
500 export OPNFV_ARTIFACT_VERSION=$(date -u +"%Y-%m-%d")
501 export BUILD_ARGS="-r $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY --iso"
504 export OPNFV_ARTIFACT_VERSION=${ARTIFACT_VERSION}
506 # clean for stable but doesn't matter for master
507 sudo opnfv-clean || echo ""
510 ./build.sh $BUILD_ARGS
511 RPM_VERSION=$(grep Version $BUILD_DIRECTORY/../build/opnfv-apex.spec | awk '{ print $2 }')-$(echo $OPNFV_ARTIFACT_VERSION | tr -d '_-')
512 # list the contents of BUILD_OUTPUT directory
513 ls -al $BUILD_DIRECTORY
514 # save information regarding artifact into file
516 echo "OPNFV_ARTIFACT_VERSION=$OPNFV_ARTIFACT_VERSION"
517 echo "OPNFV_GIT_URL=$(git config --get remote.origin.url)"
518 echo "OPNFV_GIT_SHA1=$(git rev-parse HEAD)"
519 echo "OPNFV_ARTIFACT_URL=$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
520 echo "OPNFV_ARTIFACT_MD5SUM=$(md5sum $BUILD_DIRECTORY/OPNFV-CentOS-7-x86_64-$OPNFV_ARTIFACT_VERSION.iso | cut -d' ' -f1)"
521 echo "OPNFV_SRPM_URL=$GS_URL/opnfv-apex-$RPM_VERSION.src.rpm"
522 echo "OPNFV_RPM_URL=$GS_URL/opnfv-apex-$RPM_VERSION.noarch.rpm"
523 echo "OPNFV_RPM_MD5SUM=$(md5sum $BUILD_DIRECTORY/opnfv-apex-$RPM_VERSION.noarch.rpm | cut -d' ' -f1)"
524 echo "OPNFV_BUILD_URL=$BUILD_URL"
525 ) > $WORKSPACE/opnfv.properties
526 echo "--------------------------------------------------------"
530 name: 'apex-workspace-cleanup'
538 # delete everything that is in $WORKSPACE
539 /bin/rm -rf $WORKSPACE
542 name: 'apex-upload-artifact'
550 # log info to console
551 echo "Uploading the Apex artifact. This could take some time..."
552 echo "--------------------------------------------------------"
555 # source the opnfv.properties to get ARTIFACT_VERSION
556 source $WORKSPACE/opnfv.properties
558 # upload artifact and additional files to google storage
559 gsutil cp $BUILD_DIRECTORY/OPNFV-CentOS-7-x86_64-$OPNFV_ARTIFACT_VERSION.iso gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso > gsutil.iso.log 2>&1
560 RPM_INSTALL_PATH=$BUILD_DIRECTORY/$(basename $OPNFV_RPM_URL)
561 RPM_LIST=$RPM_INSTALL_PATH
562 for pkg in common undercloud opendaylight-sfc; do
563 RPM_LIST+=" ${RPM_INSTALL_PATH/opnfv-apex/opnfv-apex-${pkg}}"
565 SRPM_INSTALL_PATH=$BUILD_DIRECTORY/$(basename $OPNFV_SRPM_URL)
566 SRPM_LIST=$SRPM_INSTALL_PATH
567 for pkg in common undercloud opendaylight-sfc; do
568 SRPM_LIST+=" ${SRPM_INSTALL_PATH/opnfv-apex/opnfv-apex-${pkg}}"
570 for artifact in $RPM_LIST $SRPM_LIST; do
571 gsutil cp $artifact gs://$GS_URL/$(basename $artifact) > gsutil.iso.log 2>&1
573 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.properties > gsutil.properties.log 2>&1
574 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/latest.properties > gsutil.latest.log 2>&1
577 echo "--------------------------------------------------------"
579 echo "ISO Artifact is available as http://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
580 echo "RPM Artifact is available as http://$GS_URL/$(basename $OPNFV_RPM_URL)"
583 name: 'apex-deploy-virtual'
591 # log info to console
592 echo "Starting the Apex virtual deployment."
593 echo "--------------------------------------------------------"
596 if [[ $BUILD_DIRECTORY == *verify-master* ]]; then
597 cd $WORKSPACE/../${BUILD_DIRECTORY/build_output/}
599 echo "WORKSPACE modified to $WORKSPACE"
601 elif [[ ! "$ARTIFACT_NAME" == "latest" ]]; then
602 # if artifact name is passed the pull a
603 # specific artifact from artifacts.opnfv.org
604 RPM_INSTALL_PATH=$GS_URL/$ARTIFACT_NAME
606 if [[ $BUILD_DIRECTORY == *verify* ]]; then
607 BUILD_DIRECTORY=$WORKSPACE/../$BUILD_DIRECTORY
608 echo "BUILD DIRECTORY modified to $BUILD_DIRECTORY"
609 elif [[ $BUILD_DIRECTORY == *apex-build* ]]; then
610 BUILD_DIRECTORY=$WORKSPACE/../$BUILD_DIRECTORY
611 echo "BUILD DIRECTORY modified to $BUILD_DIRECTORY"
614 if [[ -f ${BUILD_DIRECTORY}/../opnfv.properties ]]; then
615 # if opnfv.properties exists then use the
616 # local build. Source the file so we get local OPNFV vars
617 source ${BUILD_DIRECTORY}/../opnfv.properties
618 RPM_INSTALL_PATH=${BUILD_DIRECTORY}/$(basename $OPNFV_RPM_URL)
620 if [[ $BUILD_DIRECTORY == *verify* ]]; then
621 echo "BUILD_DIRECTORY is from a verify job, so will not use latest from URL"
622 echo "Check that the slave has opnfv.properties in $BUILD_DIRECTORY"
624 elif [[ $BUILD_DIRECTORY == *apex-build* ]]; then
625 echo "BUILD_DIRECTORY is from a daily job, so will not use latest from URL"
626 echo "Check that the slave has opnfv.properties in $BUILD_DIRECTORY"
629 # no opnfv.properties means use the latest from artifacts.opnfv.org
630 # get the latest.properties to get the link to the latest artifact
631 curl -s -o $WORKSPACE/opnfv.properties http://$GS_URL/latest.properties
632 [[ -f opnfv.properties ]] || exit 1
633 # source the file so we get OPNFV vars
634 source opnfv.properties
635 RPM_INSTALL_PATH=$OPNFV_RPM_URL
639 if [ -z "$DEPLOY_SCENARIO" ]; then
640 echo "Deploy scenario not set!"
644 # use local build for verify
645 if [[ $BUILD_DIRECTORY == *verify-master* ]]; then
646 if [ ! -e "${WORKSPACE}/build/lib" ]; then ln -s ${WORKSPACE}/lib ${WORKSPACE}/build/lib; fi
647 DEPLOY_CMD="./deploy.sh -c ${WORKSPACE}/build -r ${WORKSPACE}/build/images/"
648 DEPLOY_FILE="${WORKSPACE}/config/deploy/${DEPLOY_SCENARIO}.yaml"
649 NETWORK_FILE="${WORKSPACE}/config/network/network_settings.yaml"
651 RPM_LIST=$RPM_INSTALL_PATH
652 for pkg in common undercloud opendaylight-sfc; do
653 RPM_LIST+=" ${RPM_INSTALL_PATH/opnfv-apex/opnfv-apex-${pkg}}"
656 # update / install the new rpm
657 if rpm -q opnfv-apex > /dev/null; then
658 if [ $(basename $OPNFV_RPM_URL) == $(rpm -q opnfv-apex).rpm ]; then
659 echo "RPM is already installed"
660 elif sudo yum update -y $RPM_LIST | grep "does not update installed package"; then
661 if ! sudo yum downgrade -y $RPM_LIST; then
662 sudo yum remove -y opnfv-undercloud opnfv-common
663 sudo yum downgrade -y $RPM_INSTALL_PATH
667 sudo yum install -y $RPM_LIST;
669 DEPLOY_CMD=opnfv-deploy
670 DEPLOY_FILE="/etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml"
671 NETWORK_FILE="/etc/opnfv-apex/network_settings.yaml"
674 if [ "$OPNFV_CLEAN" == 'yes' ]; then
675 if [[ $BUILD_DIRECTORY == *verify-master* ]]; then
681 # initiate virtual deployment
682 echo "Deploy Scenario set to ${DEPLOY_SCENARIO}"
683 if [ -e $DEPLOY_FILE ]; then
684 sudo $DEPLOY_CMD -v -d ${DEPLOY_FILE} -n $NETWORK_FILE --debug
686 echo "File does not exist /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml"
690 echo "--------------------------------------------------------"
694 name: 'apex-deploy-baremetal'
702 # log info to console
703 echo "Starting the Apex baremetal deployment."
704 echo "--------------------------------------------------------"
707 if [[ ! "$ARTIFACT_NAME" == "latest" ]]; then
708 # if artifact name is passed the pull a
709 # specific artifact from artifacts.opnfv.org
710 RPM_INSTALL_PATH=$GS_URL/$ARTIFACT_NAME
712 if [[ $BUILD_DIRECTORY == *apex-build* ]]; then
713 BUILD_DIRECTORY=$WORKSPACE/../$BUILD_DIRECTORY
714 echo "BUILD DIRECTORY modified to $BUILD_DIRECTORY"
716 if [[ -f ${BUILD_DIRECTORY}/../opnfv.properties ]]; then
717 # if opnfv.properties exists then use the
718 # local build. Source the file so we get local OPNFV vars
719 source ${BUILD_DIRECTORY}/../opnfv.properties
720 RPM_INSTALL_PATH=${BUILD_DIRECTORY}/$(basename $OPNFV_RPM_URL)
722 # no opnfv.properties means use the latest from artifacts.opnfv.org
723 # get the latest.properties to get the link to the latest artifact
724 curl -s -o $WORKSPACE/opnfv.properties http://$GS_URL/latest.properties
725 [[ -f opnfv.properties ]] || exit 1
726 # source the file so we get OPNFV vars
727 source opnfv.properties
728 RPM_INSTALL_PATH=$OPNFV_RPM_URL
732 if [ ! -e "$RPM_INSTALL_PATH" ]; then
733 RPM_INSTALL_PATH=http://${OPNFV_RPM_URL}
736 RPM_LIST=$RPM_INSTALL_PATH
737 for pkg in common undercloud; do
738 RPM_LIST+=" ${RPM_INSTALL_PATH/opnfv-apex/opnfv-apex-${pkg}}"
741 # update / install the new rpm
742 if rpm -q opnfv-apex > /dev/null; then
743 if [ $(basename $OPNFV_RPM_URL) == $(rpm -q opnfv-apex).rpm ]; then
744 echo "RPM is already installed"
745 elif sudo yum update -y $RPM_LIST | grep "does not update installed package"; then
746 if ! sudo yum downgrade -y $RPM_LIST; then
747 sudo yum remove -y opnfv-undercloud opnfv-common
748 sudo yum downgrade -y $RPM_INSTALL_PATH
752 sudo yum install -y $RPM_LIST;
755 # cleanup environment before we start
757 # initiate baremetal deployment
758 if [ -e /etc/opnfv-apex/network_settings.yaml ]; then
759 if [ -n "$DEPLOY_SCENARIO" ]; then
760 echo "Deploy Scenario set to ${DEPLOY_SCENARIO}"
761 if [ -e /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml ]; then
762 sudo opnfv-deploy -i /root/inventory/pod_settings.yaml \
763 -d /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml \
764 -n /root/network/network_settings.yaml --debug
766 echo "File does not exist /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml"
770 echo "Deploy scenario not set!"
774 echo "File /etc/opnfv-apex/network_settings.yaml does not exist!"
779 echo "--------------------------------------------------------"
782 #######################
784 ########################
788 - timed: '0 3 * 12 *'
790 name: 'apex-brahmaputra'