4 - 'apex-verify-{stream1}'
5 - 'apex-verify-{stream2}'
6 - 'apex-runner-{platform}-{scenario}-{stream}'
7 - 'apex-build-{stream}'
8 - 'apex-deploy-virtual-{scenario}-{stream}'
9 - 'apex-deploy-baremetal-{scenario}-{stream}'
10 - 'apex-daily-{stream1}'
11 - 'apex-daily-{stream2}'
13 # stream: branch with - in place of / (eg. stable-arno)
14 # branch: branch (eg. stable/arno)
19 block-stream: 'brahmaputra'
21 verify-slave: 'apex-verify-master'
22 daily-slave: 'apex-daily-master'
24 branch: 'stable/brahmaputra'
25 gs-pathname: '/brahmaputra'
26 block-stream: 'master'
28 verify-slave: 'apex-verify-brahmaputra'
29 daily-slave: 'apex-daily-brahmaputra'
36 block-stream: 'brahmaputra'
38 verify-slave: 'apex-verify-master'
39 daily-slave: 'apex-daily-master'
43 branch: 'stable/brahmaputra'
44 gs-pathname: '/brahmaputra'
45 block-stream: 'master'
47 verify-slave: 'apex-verify-brahmaputra'
48 daily-slave: 'apex-daily-brahmaputra'
54 - 'os-nosdn-nofeature-ha'
55 - 'os-odl_l2-nofeature-ha'
56 - 'os-odl_l2-bgpvpn-ha'
57 - 'os-odl_l2-sfc-noha'
58 - 'os-odl_l3-nofeature-ha'
59 - 'os-onos-nofeature-ha'
60 - 'os-opencontrail-nofeature-ha'
68 name: 'apex-verify-{stream2}'
74 gs-pathname: '{gs-pathname}'
81 default: https://gerrit.opnfv.org/gerrit/$PROJECT
82 description: "Used for overriding the GIT URL coming from parameters macro."
86 credentials-id: '{ssh-credentials}'
87 refspec: '$GERRIT_REFSPEC'
88 choosing-strategy: 'gerrit'
93 - patchset-created-event:
94 exclude-drafts: 'false'
95 exclude-trivial-rebase: 'false'
96 exclude-no-code-change: 'true'
97 - draft-published-event
98 - comment-added-contains-event:
99 comment-contains-value: 'recheck'
100 - comment-added-contains-event:
101 comment-contains-value: 'reverify'
103 - project-compare-type: 'ANT'
104 project-pattern: 'apex'
106 - branch-compare-type: 'ANT'
107 branch-pattern: '**/{branch}'
120 use-build-blocker: true
122 - 'apex-daily.*{stream2}'
123 - 'apex-deploy.*{stream2}'
124 - 'apex-build.*{stream2}'
125 - 'apex-runner.*{stream2}'
126 - 'apex-verify-{stream2}'
131 - project: 'apex-deploy-virtual-os-odl_l2-nofeature-ha-{stream2}'
132 predefined-parameters: |
133 BUILD_DIRECTORY=apex-verify-{stream2}/build_output
138 - project: 'apex-deploy-virtual-os-onos-nofeature-ha-{stream2}'
139 predefined-parameters: |
140 BUILD_DIRECTORY=apex-verify-{stream2}/build_output
145 - project: 'apex-deploy-virtual-os-odl_l3-nofeature-ha-{stream2}'
146 predefined-parameters: |
147 BUILD_DIRECTORY=apex-verify-{stream2}/build_output
152 - project: 'apex-deploy-virtual-os-odl_l2-sfc-noha-{stream2}'
153 predefined-parameters: |
154 BUILD_DIRECTORY=apex-verify-{stream2}/build_output
158 - 'apex-workspace-cleanup'
162 name: 'apex-verify-{stream1}'
164 node: '{verify-slave}'
168 gs-pathname: '{gs-pathname}'
175 default: https://gerrit.opnfv.org/gerrit/$PROJECT
176 description: "Used for overriding the GIT URL coming from parameters macro."
179 - gerrit-trigger-scm:
180 credentials-id: '{ssh-credentials}'
181 refspec: '$GERRIT_REFSPEC'
182 choosing-strategy: 'gerrit'
187 - patchset-created-event:
188 exclude-drafts: 'false'
189 exclude-trivial-rebase: 'false'
190 exclude-no-code-change: 'true'
191 - draft-published-event
192 - comment-added-contains-event:
193 comment-contains-value: 'recheck'
194 - comment-added-contains-event:
195 comment-contains-value: 'reverify'
197 - project-compare-type: 'ANT'
198 project-pattern: 'apex'
200 - branch-compare-type: 'ANT'
201 branch-pattern: '**/{branch}'
214 use-build-blocker: true
216 - 'apex-daily.*{stream1}'
217 - 'apex-deploy.*{stream1}'
218 - 'apex-build.*{stream1}'
219 - 'apex-runner.*{stream1}'
220 - 'apex-verify-{stream1}'
225 - project: 'apex-deploy-virtual-os-nosdn-nofeature-ha-{stream1}'
226 predefined-parameters: |
227 BUILD_DIRECTORY=apex-verify-{stream1}
233 - project: 'functest-apex-{slave}-suite-{stream1}'
234 predefined-parameters: |
235 DEPLOY_SCENARIO=os-nosdn-nofeature-ha
236 FUNCTEST_SUITE_NAME=vping_userdata
240 - project: 'apex-deploy-virtual-os-odl_l2-nofeature-ha-{stream1}'
241 predefined-parameters: |
242 BUILD_DIRECTORY=apex-verify-{stream1}
247 - 'apex-workspace-cleanup'
250 name: 'apex-runner-{platform}-{scenario}-{stream}'
252 # runner jobs for deploying manually
260 gs-pathname: '{gs-pathname}'
267 default: https://gerrit.opnfv.org/gerrit/$PROJECT
268 description: "Used for overriding the GIT URL coming from parameters macro."
271 - gerrit-trigger-scm:
272 credentials-id: '{ssh-credentials}'
274 choosing-strategy: 'default'
278 use-build-blocker: true
280 - 'apex-daily.*{stream}'
281 - 'apex-verify.*{stream}'
285 - project: 'apex-deploy-{platform}-{scenario}-{stream}'
286 predefined-parameters:
291 - project: 'yardstick-apex-{slave}-daily-{stream}'
292 predefined-parameters:
293 DEPLOY_SCENARIO={scenario}
296 build-step-failure-threshold: 'never'
297 failure-threshold: 'never'
298 unstable-threshold: 'FAILURE'
300 - project: 'functest-apex-{slave}-daily-{stream}'
301 predefined-parameters:
302 DEPLOY_SCENARIO={scenario}
305 build-step-failure-threshold: 'never'
306 failure-threshold: 'never'
307 unstable-threshold: 'FAILURE'
310 name: 'apex-build-{stream}'
312 # Job template for builds
314 # Required Variables:
315 # stream: branch with - in place of / (eg. stable)
316 # branch: branch (eg. stable)
325 gs-pathname: '{gs-pathname}'
330 default: https://gerrit.opnfv.org/gerrit/$PROJECT
331 description: "Used for overriding the GIT URL coming from parameters macro."
335 credentials-id: '{ssh-credentials}'
341 use-build-blocker: true
343 - 'apex-deploy.*{stream}'
348 - project: 'apex-deploy-virtual-os-nosdn-nofeature-ha-{stream}'
349 predefined-parameters: |
350 BUILD_DIRECTORY=apex-build-{stream}/build
354 - 'apex-upload-artifact'
357 name: 'apex-deploy-virtual-{scenario}-{stream}'
359 # Job template for virtual deployment
361 # Required Variables:
362 # stream: branch with - in place of / (eg. stable)
363 # branch: branch (eg. stable)
370 credentials-id: '{ssh-credentials}'
378 gs-pathname: '{gs-pathname}'
380 name: DEPLOY_SCENARIO
381 default: '{scenario}'
382 description: "Scenario to deploy with."
386 description: "Use yes in lower case to invoke clean. Indicates if the deploy environment should be cleaned before deployment"
390 use-build-blocker: true
392 - 'apex-deploy.*{stream}'
395 - 'apex-deploy-virtual'
396 - 'apex-workspace-cleanup'
399 name: 'apex-deploy-baremetal-{scenario}-{stream}'
401 # Job template for baremetal deployment
403 # Required Variables:
404 # stream: branch with - in place of / (eg. stable)
405 # branch: branch (eg. stable)
412 credentials-id: '{ssh-credentials}'
420 gs-pathname: '{gs-pathname}'
422 name: DEPLOY_SCENARIO
423 default: '{scenario}'
424 description: "Scenario to deploy with."
428 use-build-blocker: true
430 - 'apex-verify.*{stream}'
431 - 'apex-deploy.*{stream}'
432 - 'apex-build.*{stream}'
436 - 'apex-deploy-baremetal'
437 - 'apex-workspace-cleanup'
441 name: 'apex-daily-{stream2}'
443 # Job template for daily build
445 # Required Variables:
446 # stream: branch with - in place of / (eg. stable)
447 # branch: branch (eg. stable)
454 credentials-id: '{ssh-credentials}'
462 gs-pathname: '{gs-pathname}'
466 use-build-blocker: true
468 - 'apex-verify.*{stream2}'
469 - 'apex-deploy.*{stream2}'
470 - 'apex-build.*{stream2}'
471 - 'apex-runner.*{stream2}'
478 - project: 'apex-build-{stream2}'
480 current-parameters: true
483 - project: 'apex-deploy-baremetal-os-odl_l2-nofeature-ha-{stream2}'
484 predefined-parameters: |
485 BUILD_DIRECTORY=apex-build-{stream2}/build_output
490 - project: 'functest-apex-{slave}-daily-{stream2}'
491 predefined-parameters:
492 DEPLOY_SCENARIO=os-odl_l2-nofeature-ha
495 build-step-failure-threshold: 'never'
496 failure-threshold: 'never'
497 unstable-threshold: 'FAILURE'
499 - project: 'yardstick-apex-{slave}-daily-{stream2}'
500 predefined-parameters:
501 DEPLOY_SCENARIO=os-odl_l2-nofeature-ha
504 build-step-failure-threshold: 'never'
505 failure-threshold: 'never'
506 unstable-threshold: 'FAILURE'
508 - project: 'apex-deploy-baremetal-os-onos-nofeature-ha-{stream2}'
509 predefined-parameters:
510 BUILD_DIRECTORY=apex-build-{stream2}/build_output
514 - project: 'functest-apex-{slave}-daily-{stream2}'
515 predefined-parameters:
516 DEPLOY_SCENARIO=os-onos-nofeature-ha
519 build-step-failure-threshold: 'never'
520 failure-threshold: 'never'
521 unstable-threshold: 'FAILURE'
523 - project: 'yardstick-apex-{slave}-daily-{stream2}'
524 predefined-parameters:
525 DEPLOY_SCENARIO=os-onos-nofeature-ha
528 build-step-failure-threshold: 'never'
529 failure-threshold: 'never'
530 unstable-threshold: 'FAILURE'
532 - project: 'apex-deploy-baremetal-os-odl_l3-nofeature-ha-{stream2}'
533 predefined-parameters:
534 BUILD_DIRECTORY=apex-build-{stream2}/build_output
538 - project: 'functest-apex-{slave}-daily-{stream2}'
539 predefined-parameters:
540 DEPLOY_SCENARIO=os-odl_l3-nofeature-ha
543 build-step-failure-threshold: 'never'
544 failure-threshold: 'never'
545 unstable-threshold: 'FAILURE'
547 - project: 'yardstick-apex-{slave}-daily-{stream2}'
548 predefined-parameters:
549 DEPLOY_SCENARIO=os-odl_l3-nofeature-ha
552 build-step-failure-threshold: 'never'
553 failure-threshold: 'never'
554 unstable-threshold: 'FAILURE'
556 - project: 'apex-deploy-baremetal-os-odl_l2-bgpvpn-ha-{stream2}'
557 predefined-parameters:
558 BUILD_DIRECTORY=apex-build-{stream2}/build_output
562 - project: 'functest-apex-{slave}-daily-{stream2}'
563 predefined-parameters:
564 DEPLOY_SCENARIO=os-odl_l2-bgpvpn-ha
567 build-step-failure-threshold: 'never'
568 failure-threshold: 'never'
569 unstable-threshold: 'FAILURE'
571 - project: 'yardstick-apex-{slave}-daily-{stream2}'
572 predefined-parameters:
573 DEPLOY_SCENARIO=os-odl_l2-bgpvpn-ha
576 build-step-failure-threshold: 'never'
577 failure-threshold: 'never'
578 unstable-threshold: 'FAILURE'
582 name: 'apex-daily-{stream1}'
584 # Job template for daily build
586 # Required Variables:
587 # stream: branch with - in place of / (eg. stable)
588 # branch: branch (eg. stable)
589 node: '{daily-slave}'
595 credentials-id: '{ssh-credentials}'
603 gs-pathname: '{gs-pathname}'
607 use-build-blocker: true
609 - 'apex-verify.*{stream1}'
610 - 'apex-deploy.*{stream1}'
611 - 'apex-build.*{stream1}'
612 - 'apex-runner.*{stream1}'
619 - project: 'apex-build-{stream1}'
621 current-parameters: true
624 - project: 'apex-deploy-virtual-nosdn-nofeature-ha-{stream1}'
625 predefined-parameters: |
626 BUILD_DIRECTORY=apex-build-{stream1}/build
632 - project: 'functest-apex-{slave}-daily-{stream1}'
633 predefined-parameters:
634 DEPLOY_SCENARIO=os-nosdn-nofeature-ha
638 build-step-failure-threshold: 'never'
639 failure-threshold: 'never'
640 unstable-threshold: 'FAILURE'
642 - project: 'yardstick-apex-{slave}-daily-{stream1}'
643 predefined-parameters:
644 DEPLOY_SCENARIO=os-nosdn-nofeature-ha
648 build-step-failure-threshold: 'never'
649 failure-threshold: 'never'
650 unstable-threshold: 'FAILURE'
653 name: 'apex-gs-clean-{stream}'
655 # Job template for clean
657 # Required Variables:
658 # stream: branch with - in place of / (eg. stable)
667 gs-pathname: '{gs-pathname}'
673 - 'apex-gs-clean-{stream}'
676 ########################
678 ########################
685 description: "RPM Artifact name that will be appended to GS_URL to deploy a specific artifact"
687 name: ARTIFACT_VERSION
689 description: "Artifact version type"
691 name: BUILD_DIRECTORY
692 default: $WORKSPACE/build
693 description: "Directory where the build artifact will be located upon the completion of the build."
695 name: CACHE_DIRECTORY
696 default: $HOME/opnfv/cache{gs-pathname}
697 description: "Directory where the cache to be used during the build is located."
700 default: https://gerrit.opnfv.org/gerrit/$PROJECT
701 description: "Used for overriding the GIT URL coming from Global Jenkins configuration in case if the stuff is done on none-LF HW."
704 default: artifacts.opnfv.org/$PROJECT{gs-pathname}
705 description: "URL to Google Storage."
707 ########################
709 ########################
718 # log info to console
719 echo "Starting the build of Apex using OpenStack Master packages. This will take some time..."
720 echo "---------------------------------------------------------------------------------------"
722 # create the cache directory if it doesn't exist
723 [[ -d $CACHE_DIRECTORY ]] || mkdir -p $CACHE_DIRECTORY
724 # set OPNFV_ARTIFACT_VERSION
725 if echo $BUILD_TAG | grep "apex-verify" 1> /dev/null; then
726 if echo $GERRIT_BRANCH | grep "brahmaputra" 1> /dev/null; then
727 export OPNFV_ARTIFACT_VERSION=brahmaputra-dev${BUILD_NUMBER}
728 export BUILD_ARGS="-v $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY $BUILD_DIRECTORY"
730 export OPNFV_ARTIFACT_VERSION=dev${BUILD_NUMBER}
731 export BUILD_ARGS="-r $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY"
733 elif [ "$ARTIFACT_VERSION" == "daily" ]; then
734 if echo $GERRIT_BRANCH | grep "brahmaputra" 1> /dev/null; then
735 export OPNFV_ARTIFACT_VERSION=brahmaputra-$(date -u +"%Y-%m-%d")
736 export BUILD_ARGS="-v $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY $BUILD_DIRECTORY"
738 export OPNFV_ARTIFACT_VERSION=$(date -u +"%Y-%m-%d")
739 export BUILD_ARGS="-r $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY --iso"
742 export OPNFV_ARTIFACT_VERSION=${ARTIFACT_VERSION}
743 if echo $GERRIT_BRANCH | grep "brahmaputra" 1> /dev/null; then
744 export BUILD_ARGS="-v $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY $BUILD_DIRECTORY"
746 export BUILD_ARGS="-r $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY --iso"
749 # clean for stable but doesn't matter for master
750 if echo $GERRIT_BRANCH | grep "brahmaputra" 1> /dev/null; then
755 ./build.sh $BUILD_ARGS
756 RPM_VERSION=$(grep Version: $BUILD_DIRECTORY/opnfv-apex.spec | awk '{ print $2 }')-$(echo $OPNFV_ARTIFACT_VERSION | tr -d '_-')
757 # list the contents of BUILD_OUTPUT directory
758 ls -al $BUILD_DIRECTORY
759 # save information regarding artifact into file
761 echo "OPNFV_ARTIFACT_VERSION=$OPNFV_ARTIFACT_VERSION"
762 echo "OPNFV_GIT_URL=$(git config --get remote.origin.url)"
763 echo "OPNFV_GIT_SHA1=$(git rev-parse HEAD)"
764 echo "OPNFV_ARTIFACT_URL=$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
765 echo "OPNFV_ARTIFACT_MD5SUM=$(md5sum $BUILD_DIRECTORY/release/OPNFV-CentOS-7-x86_64-$OPNFV_ARTIFACT_VERSION.iso | cut -d' ' -f1)"
766 echo "OPNFV_SRPM_URL=$GS_URL/opnfv-apex-$RPM_VERSION.src.rpm"
767 echo "OPNFV_RPM_URL=$GS_URL/opnfv-apex-$RPM_VERSION.noarch.rpm"
768 echo "OPNFV_RPM_MD5SUM=$(md5sum $BUILD_DIRECTORY/noarch/opnfv-apex-$RPM_VERSION.noarch.rpm | cut -d' ' -f1)"
769 echo "OPNFV_BUILD_URL=$BUILD_URL"
770 ) > $WORKSPACE/opnfv.properties
771 echo "--------------------------------------------------------"
775 name: 'apex-workspace-cleanup'
783 # delete everything that is in $WORKSPACE
784 sudo /bin/rm -rf $WORKSPACE
787 name: 'apex-upload-artifact'
795 # log info to console
796 echo "Uploading the Apex artifact. This could take some time..."
797 echo "--------------------------------------------------------"
800 # source the opnfv.properties to get ARTIFACT_VERSION
801 source $WORKSPACE/opnfv.properties
803 # upload artifact and additional files to google storage
804 gsutil cp $BUILD_DIRECTORY/release/OPNFV-CentOS-7-x86_64-$OPNFV_ARTIFACT_VERSION.iso gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso > gsutil.iso.log 2>&1
805 RPM_INSTALL_PATH=$BUILD_DIRECTORY/noarch
806 RPM_LIST=$RPM_INSTALL_PATH/$(basename $OPNFV_RPM_URL)
807 VERSION_EXTENSION=$(echo $(basename $OPNFV_RPM_URL) | sed 's/opnfv-apex-//')
808 for pkg in common undercloud opendaylight-sfc onos; do
809 RPM_LIST+=" ${RPM_INSTALL_PATH}/opnfv-apex-${pkg}-${VERSION_EXTENSION}"
811 SRPM_INSTALL_PATH=$BUILD_DIRECTORY
812 SRPM_LIST=$SRPM_INSTALL_PATH/$(basename $OPNFV_SRPM_URL)
813 for pkg in common undercloud opendaylight-sfc onos; do
814 SRPM_LIST+=" ${SRPM_INSTALL_PATH}/opnfv-apex-${pkg}-${VERSION_EXTENSION}"
816 for artifact in $RPM_LIST $SRPM_LIST; do
817 gsutil cp $artifact gs://$GS_URL/$(basename $artifact) > gsutil.iso.log 2>&1
819 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.properties > gsutil.properties.log 2>&1
820 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/latest.properties > gsutil.latest.log 2>&1
823 echo "--------------------------------------------------------"
825 echo "ISO Artifact is available as http://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
826 echo "RPM Artifact is available as http://$GS_URL/$(basename $OPNFV_RPM_URL)"
829 name: 'apex-gs-cleanup'
837 # log info to console
838 echo "Cleaning Google Storage"
839 echo "-----------------------"
842 thirty_days_ago=$(date -d "30 days ago" +"%Y%m%d")
844 for i in $(gsutil ls gs://$GS_URL/*201?*); do
845 filedate=$(date -d "$(echo $i | grep -Eo 201[0-9]-?[0-9][0-9]-?[0-9][0-9])" +"%Y%m%d")
846 if [ $filedate -lt $thirty_days_ago ]; then
847 # gsutil indicates what it is removing so no need for output here
853 name: 'apex-deploy-virtual'
861 # log info to console
862 echo "Starting the Apex virtual deployment."
863 echo "--------------------------------------------------------"
866 if [[ $BUILD_DIRECTORY == *verify-master* ]]; then
867 cd $WORKSPACE/../${BUILD_DIRECTORY/build_output/}
869 echo "WORKSPACE modified to $WORKSPACE"
871 elif [[ ! "$ARTIFACT_NAME" == "latest" ]]; then
872 # if artifact name is passed the pull a
873 # specific artifact from artifacts.opnfv.org
874 RPM_INSTALL_PATH=$GS_URL
875 RPM_LIST=$RPM_INSTALL_PATH/$ARTIFACT_NAME
877 if [[ $BUILD_DIRECTORY == *verify* ]]; then
878 BUILD_DIRECTORY=$WORKSPACE/../$BUILD_DIRECTORY
879 echo "BUILD DIRECTORY modified to $BUILD_DIRECTORY"
880 elif [[ $BUILD_DIRECTORY == *apex-build* ]]; then
881 BUILD_DIRECTORY=$WORKSPACE/../$BUILD_DIRECTORY
882 echo "BUILD DIRECTORY modified to $BUILD_DIRECTORY"
885 if [[ -f ${BUILD_DIRECTORY}/../opnfv.properties ]]; then
886 # if opnfv.properties exists then use the
887 # local build. Source the file so we get local OPNFV vars
888 source ${BUILD_DIRECTORY}/../opnfv.properties
889 RPM_INSTALL_PATH=${BUILD_DIRECTORY}/noarch
890 RPM_LIST=$RPM_INSTALL_PATH/$(basename $OPNFV_RPM_URL)
892 if [[ $BUILD_DIRECTORY == *verify* ]]; then
893 echo "BUILD_DIRECTORY is from a verify job, so will not use latest from URL"
894 echo "Check that the slave has opnfv.properties in $BUILD_DIRECTORY"
896 elif [[ $BUILD_DIRECTORY == *apex-build* ]]; then
897 echo "BUILD_DIRECTORY is from a daily job, so will not use latest from URL"
898 echo "Check that the slave has opnfv.properties in $BUILD_DIRECTORY"
901 # no opnfv.properties means use the latest from artifacts.opnfv.org
902 # get the latest.properties to get the link to the latest artifact
903 curl -s -o $WORKSPACE/opnfv.properties http://$GS_URL/latest.properties
904 [[ -f opnfv.properties ]] || exit 1
905 # source the file so we get OPNFV vars
906 source opnfv.properties
907 RPM_INSTALL_PATH=$(echo $OPNFV_RPM_URL | sed 's/'"$(basename $OPNFV_RPM_URL)"'//')
908 RPM_LIST=$RPM_INSTALL_PATH/$(basename $OPNFV_RPM_URL)
912 if [ -z "$DEPLOY_SCENARIO" ]; then
913 echo "Deploy scenario not set!"
917 # use local build for verify
918 if [[ $BUILD_DIRECTORY == *verify-master* ]]; then
919 if [ ! -e "${WORKSPACE}/build/lib" ]; then ln -s ${WORKSPACE}/lib ${WORKSPACE}/build/lib; fi
920 DEPLOY_CMD="CONFIG=${WORKSPACE}/build RESOURCES=${WORKSPACE}/build/images/ ./deploy.sh -c ${WORKSPACE}/build -r ${WORKSPACE}/build/images/"
921 DEPLOY_FILE="${WORKSPACE}/config/deploy/${DEPLOY_SCENARIO}.yaml"
922 NETWORK_FILE="${WORKSPACE}/config/network/network_settings.yaml"
923 # Make sure python34 is installed
924 if ! rpm -q python34 > /dev/null; then
925 sudo yum install -y epel-release
926 if ! sudo yum install -y python34; then
927 echo "Failed to install python34"
931 if ! rpm -q python34-PyYAML > /dev/null; then
932 sudo yum install -y epel-release
933 if ! sudo yum install -y python34-PyYAML; then
934 echo "Failed to install python34-PyYAML"
938 if ! rpm -q python34-setuptools > /dev/null; then
939 if ! sudo yum install -y python34-setuptools; then
940 echo "Failed to install python34-setuptools"
944 if [ -z ${PYTHONPATH:-} ]; then
945 export PYTHONPATH=${WORKSPACE}/lib/python
947 export PYTHONPATH=$PYTHONPATH:${WORKSPACE}/lib/python
950 VERSION_EXTENSION=$(echo $(basename $RPM_LIST) | sed 's/opnfv-apex-//')
951 for pkg in common undercloud opendaylight-sfc onos; do
952 RPM_LIST+=" ${RPM_INSTALL_PATH}/opnfv-apex-${pkg}-${VERSION_EXTENSION}"
955 # update / install the new rpm
956 if rpm -q opnfv-apex > /dev/null; then
957 INSTALLED_RPMS=$(rpm -qa | grep apex)
958 for x in $INSTALLED_RPMS; do
959 INSTALLED_RPM_VER=$(echo $x | sed 's/opnfv-apex-//').rpm
960 # Does each RPM's version match the version required for deployment
961 if [ "$INSTALLED_RPM_VER" == "$VERSION_EXTENSION" ]; then
962 echo "RPM $x is already installed"
964 echo "RPM $x does not match $VERSION_EXTENSION"
965 echo "Will upgrade/downgrade RPMs..."
966 # Try to upgrade/downgrade RPMS
967 if sudo yum update -y $RPM_LIST | grep "does not update installed package"; then
968 if ! sudo yum downgrade -y $RPM_LIST; then
969 sudo yum remove -y opnfv-apex-undercloud opnfv-apex-common opnfv-apex-opendaylight-sfc opnfv-apex-onos
970 sudo yum downgrade -y $RPM_INSTALL_PATH
977 sudo yum install -y $RPM_LIST;
979 DEPLOY_CMD=opnfv-deploy
980 DEPLOY_FILE="/etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml"
981 NETWORK_FILE="/etc/opnfv-apex/network_settings.yaml"
982 export RESOURCES="/var/opt/opnfv/images"
983 export CONFIG="/var/opt/opnfv"
986 if [ "$OPNFV_CLEAN" == 'yes' ]; then
987 if [[ $BUILD_DIRECTORY == *verify-master* ]]; then
988 sudo CONFIG=../lib ./clean.sh
993 # initiate virtual deployment
994 echo "Deploy Scenario set to ${DEPLOY_SCENARIO}"
995 if [ -e $DEPLOY_FILE ]; then
996 sudo $DEPLOY_CMD -v -d ${DEPLOY_FILE} -n $NETWORK_FILE --debug
998 echo "File does not exist /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml"
1002 echo "--------------------------------------------------------"
1006 name: 'apex-deploy-baremetal'
1014 # log info to console
1015 echo "Starting the Apex baremetal deployment."
1016 echo "--------------------------------------------------------"
1019 if [[ ! "$ARTIFACT_NAME" == "latest" ]]; then
1020 # if artifact name is passed the pull a
1021 # specific artifact from artifacts.opnfv.org
1022 RPM_INSTALL_PATH=$GS_URL/$ARTIFACT_NAME
1024 if [[ $BUILD_DIRECTORY == *apex-build* ]]; then
1025 BUILD_DIRECTORY=$WORKSPACE/../$BUILD_DIRECTORY
1026 echo "BUILD DIRECTORY modified to $BUILD_DIRECTORY"
1028 if [[ -f ${BUILD_DIRECTORY}/../opnfv.properties ]]; then
1029 # if opnfv.properties exists then use the
1030 # local build. Source the file so we get local OPNFV vars
1031 source ${BUILD_DIRECTORY}/../opnfv.properties
1032 RPM_INSTALL_PATH=${BUILD_DIRECTORY}/$(basename $OPNFV_RPM_URL)
1034 # no opnfv.properties means use the latest from artifacts.opnfv.org
1035 # get the latest.properties to get the link to the latest artifact
1036 curl -s -o $WORKSPACE/opnfv.properties http://$GS_URL/latest.properties
1037 [[ -f opnfv.properties ]] || exit 1
1038 # source the file so we get OPNFV vars
1039 source opnfv.properties
1040 RPM_INSTALL_PATH=$OPNFV_RPM_URL
1044 if [ ! -e "$RPM_INSTALL_PATH" ]; then
1045 RPM_INSTALL_PATH=http://${OPNFV_RPM_URL}
1048 RPM_LIST=$RPM_INSTALL_PATH
1049 for pkg in common undercloud; do
1050 RPM_LIST+=" ${RPM_INSTALL_PATH/opnfv-apex/opnfv-apex-${pkg}}"
1053 # update / install the new rpm
1054 if rpm -q opnfv-apex > /dev/null; then
1055 if [ $(basename $OPNFV_RPM_URL) == $(rpm -q opnfv-apex).rpm ]; then
1056 echo "RPM is already installed"
1057 elif sudo yum update -y $RPM_LIST | grep "does not update installed package"; then
1058 if ! sudo yum downgrade -y $RPM_LIST; then
1059 sudo yum remove -y opnfv-undercloud opnfv-common
1060 sudo yum downgrade -y $RPM_INSTALL_PATH
1064 sudo yum install -y $RPM_LIST;
1067 # cleanup environment before we start
1069 # initiate baremetal deployment
1070 if [ -e /etc/opnfv-apex/network_settings.yaml ]; then
1071 if [ -n "$DEPLOY_SCENARIO" ]; then
1072 echo "Deploy Scenario set to ${DEPLOY_SCENARIO}"
1073 if [ -e /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml ]; then
1074 sudo opnfv-deploy -i /root/inventory/pod_settings.yaml \
1075 -d /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml \
1076 -n /root/network/network_settings.yaml --debug
1078 echo "File does not exist /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml"
1082 echo "Deploy scenario not set!"
1086 echo "File /etc/opnfv-apex/network_settings.yaml does not exist!"
1091 echo "--------------------------------------------------------"
1094 #######################
1096 ########################
1100 - timed: '0 3 * * *'
1102 name: 'apex-brahmaputra'
1104 - timed: '0 3 * * *'
1106 name: 'apex-gs-clean-{stream}'
1108 - timed: '0 2 * * *'