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}'
170 gs-pathname: '{gs-pathname}'
177 default: https://gerrit.opnfv.org/gerrit/$PROJECT
178 description: "Used for overriding the GIT URL coming from parameters macro."
181 - gerrit-trigger-scm:
182 credentials-id: '{ssh-credentials}'
183 refspec: '$GERRIT_REFSPEC'
184 choosing-strategy: 'gerrit'
189 - patchset-created-event:
190 exclude-drafts: 'false'
191 exclude-trivial-rebase: 'false'
192 exclude-no-code-change: 'true'
193 - draft-published-event
194 - comment-added-contains-event:
195 comment-contains-value: 'recheck'
196 - comment-added-contains-event:
197 comment-contains-value: 'reverify'
199 - project-compare-type: 'ANT'
200 project-pattern: 'apex'
202 - branch-compare-type: 'ANT'
203 branch-pattern: '**/{branch}'
216 use-build-blocker: true
219 - 'apex-daily.*{stream1}'
220 - 'apex-deploy.*{stream1}'
221 - 'apex-build.*{stream1}'
222 - 'apex-runner.*{stream1}'
223 - 'apex-verify-{stream1}'
231 - project: 'apex-deploy-virtual-os-nosdn-nofeature-ha-{stream1}'
232 predefined-parameters: |
233 BUILD_DIRECTORY=apex-verify-{stream1}
239 # - project: 'functest-apex-{verify-slave}-suite-{stream1}'
240 # predefined-parameters: |
241 # DEPLOY_SCENARIO=os-nosdn-nofeature-ha
242 # FUNCTEST_SUITE_NAME=vping_userdata
246 - project: 'apex-deploy-virtual-os-odl_l2-nofeature-ha-{stream1}'
247 predefined-parameters: |
248 BUILD_DIRECTORY=apex-verify-{stream1}
253 - 'apex-workspace-cleanup'
256 name: 'apex-runner-{platform}-{scenario}-{stream}'
258 # runner jobs for deploying manually
266 gs-pathname: '{gs-pathname}'
273 default: https://gerrit.opnfv.org/gerrit/$PROJECT
274 description: "Used for overriding the GIT URL coming from parameters macro."
277 - gerrit-trigger-scm:
278 credentials-id: '{ssh-credentials}'
280 choosing-strategy: 'default'
284 use-build-blocker: true
286 - 'apex-daily.*{stream}'
287 - 'apex-verify.*{stream}'
291 - project: 'apex-deploy-{platform}-{scenario}-{stream}'
292 predefined-parameters:
297 - project: 'yardstick-apex-{slave}-daily-{stream}'
298 predefined-parameters:
299 DEPLOY_SCENARIO={scenario}
302 build-step-failure-threshold: 'never'
303 failure-threshold: 'never'
304 unstable-threshold: 'FAILURE'
306 - project: 'functest-apex-{slave}-daily-{stream}'
307 predefined-parameters:
308 DEPLOY_SCENARIO={scenario}
311 build-step-failure-threshold: 'never'
312 failure-threshold: 'never'
313 unstable-threshold: 'FAILURE'
316 name: 'apex-build-{stream}'
318 # Job template for builds
320 # Required Variables:
321 # stream: branch with - in place of / (eg. stable)
322 # branch: branch (eg. stable)
323 node: '{daily-slave}'
333 gs-pathname: '{gs-pathname}'
338 default: https://gerrit.opnfv.org/gerrit/$PROJECT
339 description: "Used for overriding the GIT URL coming from parameters macro."
343 credentials-id: '{ssh-credentials}'
349 use-build-blocker: true
352 - 'apex-deploy.*{stream}'
360 - project: 'apex-deploy-virtual-os-nosdn-nofeature-ha-{stream}'
361 predefined-parameters: |
362 BUILD_DIRECTORY=apex-build-{stream}/build
367 - 'apex-upload-artifact'
370 name: 'apex-deploy-virtual-{scenario}-{stream}'
372 # Job template for virtual deployment
374 # Required Variables:
375 # stream: branch with - in place of / (eg. stable)
376 # branch: branch (eg. stable)
385 credentials-id: '{ssh-credentials}'
393 gs-pathname: '{gs-pathname}'
395 name: DEPLOY_SCENARIO
396 default: '{scenario}'
397 description: "Scenario to deploy with."
401 description: "Use yes in lower case to invoke clean. Indicates if the deploy environment should be cleaned before deployment"
405 use-build-blocker: true
408 - 'apex-deploy.*{stream}'
414 - 'apex-deploy-virtual'
415 - 'apex-workspace-cleanup'
418 name: 'apex-deploy-baremetal-{scenario}-{stream}'
420 # Job template for baremetal deployment
422 # Required Variables:
423 # stream: branch with - in place of / (eg. stable)
424 # branch: branch (eg. stable)
431 credentials-id: '{ssh-credentials}'
439 gs-pathname: '{gs-pathname}'
441 name: DEPLOY_SCENARIO
442 default: '{scenario}'
443 description: "Scenario to deploy with."
447 use-build-blocker: true
449 - 'apex-verify.*{stream}'
450 - 'apex-deploy.*{stream}'
451 - 'apex-build.*{stream}'
455 - 'apex-deploy-baremetal'
456 - 'apex-workspace-cleanup'
460 name: 'apex-daily-{stream2}'
462 # Job template for daily build
464 # Required Variables:
465 # stream: branch with - in place of / (eg. stable)
466 # branch: branch (eg. stable)
473 credentials-id: '{ssh-credentials}'
481 gs-pathname: '{gs-pathname}'
485 use-build-blocker: true
487 - 'apex-verify.*{stream2}'
488 - 'apex-deploy.*{stream2}'
489 - 'apex-build.*{stream2}'
490 - 'apex-runner.*{stream2}'
497 - project: 'apex-build-{stream2}'
499 current-parameters: true
502 - project: 'apex-deploy-baremetal-os-odl_l2-nofeature-ha-{stream2}'
503 predefined-parameters: |
504 BUILD_DIRECTORY=apex-build-{stream2}/build_output
509 - project: 'functest-apex-{slave}-daily-{stream2}'
510 predefined-parameters:
511 DEPLOY_SCENARIO=os-odl_l2-nofeature-ha
514 build-step-failure-threshold: 'never'
515 failure-threshold: 'never'
516 unstable-threshold: 'FAILURE'
518 - project: 'yardstick-apex-{slave}-daily-{stream2}'
519 predefined-parameters:
520 DEPLOY_SCENARIO=os-odl_l2-nofeature-ha
523 build-step-failure-threshold: 'never'
524 failure-threshold: 'never'
525 unstable-threshold: 'FAILURE'
527 - project: 'apex-deploy-baremetal-os-onos-nofeature-ha-{stream2}'
528 predefined-parameters:
529 BUILD_DIRECTORY=apex-build-{stream2}/build_output
533 - project: 'functest-apex-{slave}-daily-{stream2}'
534 predefined-parameters:
535 DEPLOY_SCENARIO=os-onos-nofeature-ha
538 build-step-failure-threshold: 'never'
539 failure-threshold: 'never'
540 unstable-threshold: 'FAILURE'
542 - project: 'yardstick-apex-{slave}-daily-{stream2}'
543 predefined-parameters:
544 DEPLOY_SCENARIO=os-onos-nofeature-ha
547 build-step-failure-threshold: 'never'
548 failure-threshold: 'never'
549 unstable-threshold: 'FAILURE'
551 - project: 'apex-deploy-baremetal-os-odl_l3-nofeature-ha-{stream2}'
552 predefined-parameters:
553 BUILD_DIRECTORY=apex-build-{stream2}/build_output
557 - project: 'functest-apex-{slave}-daily-{stream2}'
558 predefined-parameters:
559 DEPLOY_SCENARIO=os-odl_l3-nofeature-ha
562 build-step-failure-threshold: 'never'
563 failure-threshold: 'never'
564 unstable-threshold: 'FAILURE'
566 - project: 'yardstick-apex-{slave}-daily-{stream2}'
567 predefined-parameters:
568 DEPLOY_SCENARIO=os-odl_l3-nofeature-ha
571 build-step-failure-threshold: 'never'
572 failure-threshold: 'never'
573 unstable-threshold: 'FAILURE'
575 - project: 'apex-deploy-baremetal-os-odl_l2-bgpvpn-ha-{stream2}'
576 predefined-parameters:
577 BUILD_DIRECTORY=apex-build-{stream2}/build_output
581 - project: 'functest-apex-{slave}-daily-{stream2}'
582 predefined-parameters:
583 DEPLOY_SCENARIO=os-odl_l2-bgpvpn-ha
586 build-step-failure-threshold: 'never'
587 failure-threshold: 'never'
588 unstable-threshold: 'FAILURE'
590 - project: 'yardstick-apex-{slave}-daily-{stream2}'
591 predefined-parameters:
592 DEPLOY_SCENARIO=os-odl_l2-bgpvpn-ha
595 build-step-failure-threshold: 'never'
596 failure-threshold: 'never'
597 unstable-threshold: 'FAILURE'
601 name: 'apex-daily-{stream1}'
603 # Job template for daily build
605 # Required Variables:
606 # stream: branch with - in place of / (eg. stable)
607 # branch: branch (eg. stable)
608 node: '{daily-slave}'
614 credentials-id: '{ssh-credentials}'
622 gs-pathname: '{gs-pathname}'
626 use-build-blocker: true
629 - 'apex-verify.*{stream1}'
630 - 'apex-deploy.*{stream1}'
631 - 'apex-build.*{stream1}'
632 - 'apex-runner.*{stream1}'
639 - project: 'apex-build-{stream1}'
641 current-parameters: true
645 - project: 'apex-deploy-virtual-nosdn-nofeature-ha-{stream1}'
646 predefined-parameters: |
647 BUILD_DIRECTORY=apex-build-{stream1}/build
653 - project: 'functest-apex-{slave}-daily-{stream1}'
654 predefined-parameters:
655 DEPLOY_SCENARIO=os-nosdn-nofeature-ha
659 build-step-failure-threshold: 'never'
660 failure-threshold: 'never'
661 unstable-threshold: 'FAILURE'
663 - project: 'yardstick-apex-{slave}-daily-{stream1}'
664 predefined-parameters:
665 DEPLOY_SCENARIO=os-nosdn-nofeature-ha
669 build-step-failure-threshold: 'never'
670 failure-threshold: 'never'
671 unstable-threshold: 'FAILURE'
674 name: 'apex-gs-clean-{stream}'
676 # Job template for clean
678 # Required Variables:
679 # stream: branch with - in place of / (eg. stable)
688 gs-pathname: '{gs-pathname}'
694 - 'apex-gs-clean-{stream}'
697 ########################
699 ########################
706 description: "RPM Artifact name that will be appended to GS_URL to deploy a specific artifact"
708 name: ARTIFACT_VERSION
710 description: "Artifact version type"
712 name: BUILD_DIRECTORY
713 default: $WORKSPACE/build
714 description: "Directory where the build artifact will be located upon the completion of the build."
716 name: CACHE_DIRECTORY
717 default: $HOME/opnfv/cache{gs-pathname}
718 description: "Directory where the cache to be used during the build is located."
721 default: https://gerrit.opnfv.org/gerrit/$PROJECT
722 description: "Used for overriding the GIT URL coming from Global Jenkins configuration in case if the stuff is done on none-LF HW."
725 default: artifacts.opnfv.org/$PROJECT{gs-pathname}
726 description: "URL to Google Storage."
728 ########################
730 ########################
739 # log info to console
740 echo "Starting the build of Apex using OpenStack Master packages. This will take some time..."
741 echo "---------------------------------------------------------------------------------------"
743 # create the cache directory if it doesn't exist
744 [[ -d $CACHE_DIRECTORY ]] || mkdir -p $CACHE_DIRECTORY
745 # set OPNFV_ARTIFACT_VERSION
746 if echo $BUILD_TAG | grep "apex-verify" 1> /dev/null; then
747 if echo $GERRIT_BRANCH | grep "brahmaputra" 1> /dev/null; then
748 export OPNFV_ARTIFACT_VERSION=brahmaputra-dev${BUILD_NUMBER}
749 export BUILD_ARGS="-v $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY $BUILD_DIRECTORY"
751 export OPNFV_ARTIFACT_VERSION=dev${BUILD_NUMBER}
752 export BUILD_ARGS="-r $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY"
754 elif [ "$ARTIFACT_VERSION" == "daily" ]; then
755 if echo $GERRIT_BRANCH | grep "brahmaputra" 1> /dev/null; then
756 export OPNFV_ARTIFACT_VERSION=brahmaputra-$(date -u +"%Y-%m-%d")
757 export BUILD_ARGS="-v $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY $BUILD_DIRECTORY"
759 export OPNFV_ARTIFACT_VERSION=$(date -u +"%Y-%m-%d")
760 export BUILD_ARGS="-r $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY --iso"
763 export OPNFV_ARTIFACT_VERSION=${ARTIFACT_VERSION}
764 if echo $GERRIT_BRANCH | grep "brahmaputra" 1> /dev/null; then
765 export BUILD_ARGS="-v $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY $BUILD_DIRECTORY"
767 export BUILD_ARGS="-r $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY --iso"
770 # clean for stable but doesn't matter for master
771 if echo $GERRIT_BRANCH | grep "brahmaputra" 1> /dev/null; then
776 ./build.sh $BUILD_ARGS
777 RPM_VERSION=$(grep Version: $BUILD_DIRECTORY/opnfv-apex.spec | awk '{ print $2 }')-$(echo $OPNFV_ARTIFACT_VERSION | tr -d '_-')
778 # list the contents of BUILD_OUTPUT directory
779 ls -al $BUILD_DIRECTORY
780 # save information regarding artifact into file
782 echo "OPNFV_ARTIFACT_VERSION=$OPNFV_ARTIFACT_VERSION"
783 echo "OPNFV_GIT_URL=$(git config --get remote.origin.url)"
784 echo "OPNFV_GIT_SHA1=$(git rev-parse HEAD)"
785 echo "OPNFV_ARTIFACT_URL=$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
786 echo "OPNFV_ARTIFACT_MD5SUM=$(md5sum $BUILD_DIRECTORY/release/OPNFV-CentOS-7-x86_64-$OPNFV_ARTIFACT_VERSION.iso | cut -d' ' -f1)"
787 echo "OPNFV_SRPM_URL=$GS_URL/opnfv-apex-$RPM_VERSION.src.rpm"
788 echo "OPNFV_RPM_URL=$GS_URL/opnfv-apex-$RPM_VERSION.noarch.rpm"
789 echo "OPNFV_RPM_MD5SUM=$(md5sum $BUILD_DIRECTORY/noarch/opnfv-apex-$RPM_VERSION.noarch.rpm | cut -d' ' -f1)"
790 echo "OPNFV_BUILD_URL=$BUILD_URL"
791 ) > $WORKSPACE/opnfv.properties
792 echo "--------------------------------------------------------"
796 name: 'apex-workspace-cleanup'
804 # delete everything that is in $WORKSPACE
805 sudo /bin/rm -rf $WORKSPACE
808 name: 'apex-upload-artifact'
816 # log info to console
817 echo "Uploading the Apex artifact. This could take some time..."
818 echo "--------------------------------------------------------"
821 # source the opnfv.properties to get ARTIFACT_VERSION
822 source $WORKSPACE/opnfv.properties
824 # upload artifact and additional files to google storage
825 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
826 RPM_INSTALL_PATH=$BUILD_DIRECTORY/noarch
827 RPM_LIST=$RPM_INSTALL_PATH/$(basename $OPNFV_RPM_URL)
828 VERSION_EXTENSION=$(echo $(basename $OPNFV_RPM_URL) | sed 's/opnfv-apex-//')
829 for pkg in common undercloud opendaylight-sfc onos; do
830 RPM_LIST+=" ${RPM_INSTALL_PATH}/opnfv-apex-${pkg}-${VERSION_EXTENSION}"
832 SRPM_INSTALL_PATH=$BUILD_DIRECTORY
833 SRPM_LIST=$SRPM_INSTALL_PATH/$(basename $OPNFV_SRPM_URL)
834 for pkg in common undercloud opendaylight-sfc onos; do
835 SRPM_LIST+=" ${SRPM_INSTALL_PATH}/opnfv-apex-${pkg}-${VERSION_EXTENSION}"
837 for artifact in $RPM_LIST $SRPM_LIST; do
838 gsutil cp $artifact gs://$GS_URL/$(basename $artifact) > gsutil.iso.log 2>&1
840 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.properties > gsutil.properties.log 2>&1
841 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/latest.properties > gsutil.latest.log 2>&1
844 echo "--------------------------------------------------------"
846 echo "ISO Artifact is available as http://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
847 echo "RPM Artifact is available as http://$GS_URL/$(basename $OPNFV_RPM_URL)"
850 name: 'apex-gs-cleanup'
858 # log info to console
859 echo "Cleaning Google Storage"
860 echo "-----------------------"
863 thirty_days_ago=$(date -d "30 days ago" +"%Y%m%d")
865 for i in $(gsutil ls gs://$GS_URL/*201?*); do
866 filedate=$(date -d "$(echo $i | grep -Eo 201[0-9]-?[0-9][0-9]-?[0-9][0-9])" +"%Y%m%d")
867 if [ $filedate -lt $thirty_days_ago ]; then
868 # gsutil indicates what it is removing so no need for output here
874 name: 'apex-deploy-virtual'
882 # log info to console
883 echo "Starting the Apex virtual deployment."
884 echo "--------------------------------------------------------"
887 if [[ $BUILD_DIRECTORY == *verify-master* ]]; then
888 cd $WORKSPACE/../${BUILD_DIRECTORY/build_output/}
890 echo "WORKSPACE modified to $WORKSPACE"
892 elif [[ ! "$ARTIFACT_NAME" == "latest" ]]; then
893 # if artifact name is passed the pull a
894 # specific artifact from artifacts.opnfv.org
895 RPM_INSTALL_PATH=$GS_URL
896 RPM_LIST=$RPM_INSTALL_PATH/$ARTIFACT_NAME
898 if [[ $BUILD_DIRECTORY == *verify* ]]; then
899 BUILD_DIRECTORY=$WORKSPACE/../$BUILD_DIRECTORY
900 echo "BUILD DIRECTORY modified to $BUILD_DIRECTORY"
901 elif [[ $BUILD_DIRECTORY == *apex-build* ]]; then
902 BUILD_DIRECTORY=$WORKSPACE/../$BUILD_DIRECTORY
903 echo "BUILD DIRECTORY modified to $BUILD_DIRECTORY"
906 if [[ -f ${BUILD_DIRECTORY}/../opnfv.properties ]]; then
907 # if opnfv.properties exists then use the
908 # local build. Source the file so we get local OPNFV vars
909 source ${BUILD_DIRECTORY}/../opnfv.properties
910 RPM_INSTALL_PATH=${BUILD_DIRECTORY}/noarch
911 RPM_LIST=$RPM_INSTALL_PATH/$(basename $OPNFV_RPM_URL)
913 if [[ $BUILD_DIRECTORY == *verify* ]]; then
914 echo "BUILD_DIRECTORY is from a verify job, so will not use latest from URL"
915 echo "Check that the slave has opnfv.properties in $BUILD_DIRECTORY"
917 elif [[ $BUILD_DIRECTORY == *apex-build* ]]; then
918 echo "BUILD_DIRECTORY is from a daily job, so will not use latest from URL"
919 echo "Check that the slave has opnfv.properties in $BUILD_DIRECTORY"
922 # no opnfv.properties means use the latest from artifacts.opnfv.org
923 # get the latest.properties to get the link to the latest artifact
924 curl -s -o $WORKSPACE/opnfv.properties http://$GS_URL/latest.properties
925 [[ -f opnfv.properties ]] || exit 1
926 # source the file so we get OPNFV vars
927 source opnfv.properties
928 RPM_INSTALL_PATH=$(echo $OPNFV_RPM_URL | sed 's/'"$(basename $OPNFV_RPM_URL)"'//')
929 RPM_LIST=$RPM_INSTALL_PATH/$(basename $OPNFV_RPM_URL)
933 if [ -z "$DEPLOY_SCENARIO" ]; then
934 echo "Deploy scenario not set!"
938 # use local build for verify
939 if [[ $BUILD_DIRECTORY == *verify-master* ]]; then
940 if [ ! -e "${WORKSPACE}/build/lib" ]; then ln -s ${WORKSPACE}/lib ${WORKSPACE}/build/lib; fi
941 DEPLOY_CMD="CONFIG=${WORKSPACE}/build RESOURCES=${WORKSPACE}/build/images/ ./deploy.sh -c ${WORKSPACE}/build -r ${WORKSPACE}/build/images/"
942 DEPLOY_FILE="${WORKSPACE}/config/deploy/${DEPLOY_SCENARIO}.yaml"
943 NETWORK_FILE="${WORKSPACE}/config/network/network_settings.yaml"
944 # Make sure python34 is installed
945 if ! rpm -q python34 > /dev/null; then
946 sudo yum install -y epel-release
947 if ! sudo yum install -y python34; then
948 echo "Failed to install python34"
952 if ! rpm -q python34-PyYAML > /dev/null; then
953 sudo yum install -y epel-release
954 if ! sudo yum install -y python34-PyYAML; then
955 echo "Failed to install python34-PyYAML"
959 if ! rpm -q python34-setuptools > /dev/null; then
960 if ! sudo yum install -y python34-setuptools; then
961 echo "Failed to install python34-setuptools"
965 if [ -z ${PYTHONPATH:-} ]; then
966 export PYTHONPATH=${WORKSPACE}/lib/python
968 export PYTHONPATH=$PYTHONPATH:${WORKSPACE}/lib/python
971 VERSION_EXTENSION=$(echo $(basename $RPM_LIST) | sed 's/opnfv-apex-//')
972 for pkg in common undercloud opendaylight-sfc onos; do
973 RPM_LIST+=" ${RPM_INSTALL_PATH}/opnfv-apex-${pkg}-${VERSION_EXTENSION}"
976 # update / install the new rpm
977 if rpm -q opnfv-apex > /dev/null; then
978 INSTALLED_RPMS=$(rpm -qa | grep apex)
979 for x in $INSTALLED_RPMS; do
980 INSTALLED_RPM_VER=$(echo $x | sed 's/opnfv-apex-//').rpm
981 # Does each RPM's version match the version required for deployment
982 if [ "$INSTALLED_RPM_VER" == "$VERSION_EXTENSION" ]; then
983 echo "RPM $x is already installed"
985 echo "RPM $x does not match $VERSION_EXTENSION"
986 echo "Will upgrade/downgrade RPMs..."
987 # Try to upgrade/downgrade RPMS
988 if sudo yum update -y $RPM_LIST | grep "does not update installed package"; then
989 if ! sudo yum downgrade -y $RPM_LIST; then
990 sudo yum remove -y opnfv-apex-undercloud opnfv-apex-common opnfv-apex-opendaylight-sfc opnfv-apex-onos
991 sudo yum downgrade -y $RPM_INSTALL_PATH
998 sudo yum install -y $RPM_LIST;
1000 DEPLOY_CMD=opnfv-deploy
1001 DEPLOY_FILE="/etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml"
1002 NETWORK_FILE="/etc/opnfv-apex/network_settings.yaml"
1003 export RESOURCES="/var/opt/opnfv/images"
1004 export CONFIG="/var/opt/opnfv"
1007 if [ "$OPNFV_CLEAN" == 'yes' ]; then
1008 if [[ $BUILD_DIRECTORY == *verify-master* ]]; then
1009 sudo CONFIG=../lib ./clean.sh
1014 # initiate virtual deployment
1015 echo "Deploy Scenario set to ${DEPLOY_SCENARIO}"
1016 if [ -e $DEPLOY_FILE ]; then
1017 sudo $DEPLOY_CMD -v -d ${DEPLOY_FILE} -n $NETWORK_FILE --debug
1019 echo "File does not exist /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml"
1023 echo "--------------------------------------------------------"
1027 name: 'apex-deploy-baremetal'
1035 # log info to console
1036 echo "Starting the Apex baremetal deployment."
1037 echo "--------------------------------------------------------"
1040 if [[ ! "$ARTIFACT_NAME" == "latest" ]]; then
1041 # if artifact name is passed the pull a
1042 # specific artifact from artifacts.opnfv.org
1043 RPM_INSTALL_PATH=$GS_URL/$ARTIFACT_NAME
1045 if [[ $BUILD_DIRECTORY == *apex-build* ]]; then
1046 BUILD_DIRECTORY=$WORKSPACE/../$BUILD_DIRECTORY
1047 echo "BUILD DIRECTORY modified to $BUILD_DIRECTORY"
1049 if [[ -f ${BUILD_DIRECTORY}/../opnfv.properties ]]; then
1050 # if opnfv.properties exists then use the
1051 # local build. Source the file so we get local OPNFV vars
1052 source ${BUILD_DIRECTORY}/../opnfv.properties
1053 RPM_INSTALL_PATH=${BUILD_DIRECTORY}/$(basename $OPNFV_RPM_URL)
1055 # no opnfv.properties means use the latest from artifacts.opnfv.org
1056 # get the latest.properties to get the link to the latest artifact
1057 curl -s -o $WORKSPACE/opnfv.properties http://$GS_URL/latest.properties
1058 [[ -f opnfv.properties ]] || exit 1
1059 # source the file so we get OPNFV vars
1060 source opnfv.properties
1061 RPM_INSTALL_PATH=$OPNFV_RPM_URL
1065 if [ ! -e "$RPM_INSTALL_PATH" ]; then
1066 RPM_INSTALL_PATH=http://${OPNFV_RPM_URL}
1069 RPM_LIST=$RPM_INSTALL_PATH
1070 for pkg in common undercloud; do
1071 RPM_LIST+=" ${RPM_INSTALL_PATH/opnfv-apex/opnfv-apex-${pkg}}"
1074 # update / install the new rpm
1075 if rpm -q opnfv-apex > /dev/null; then
1076 if [ $(basename $OPNFV_RPM_URL) == $(rpm -q opnfv-apex).rpm ]; then
1077 echo "RPM is already installed"
1078 elif sudo yum update -y $RPM_LIST | grep "does not update installed package"; then
1079 if ! sudo yum downgrade -y $RPM_LIST; then
1080 sudo yum remove -y opnfv-undercloud opnfv-common
1081 sudo yum downgrade -y $RPM_INSTALL_PATH
1085 sudo yum install -y $RPM_LIST;
1088 # cleanup environment before we start
1090 # initiate baremetal deployment
1091 if [ -e /etc/opnfv-apex/network_settings.yaml ]; then
1092 if [ -n "$DEPLOY_SCENARIO" ]; then
1093 echo "Deploy Scenario set to ${DEPLOY_SCENARIO}"
1094 if [ -e /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml ]; then
1095 sudo opnfv-deploy -i /root/inventory/pod_settings.yaml \
1096 -d /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml \
1097 -n /root/network/network_settings.yaml --debug
1099 echo "File does not exist /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml"
1103 echo "Deploy scenario not set!"
1107 echo "File /etc/opnfv-apex/network_settings.yaml does not exist!"
1112 echo "--------------------------------------------------------"
1115 #######################
1117 ########################
1121 - timed: '0 3 * * *'
1123 name: 'apex-brahmaputra'
1125 - timed: '0 3 * * *'
1127 name: 'apex-gs-clean-{stream}'
1129 - timed: '0 2 * * *'