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-{verify-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)
317 node: '{daily-slave}'
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
355 - 'apex-upload-artifact'
358 name: 'apex-deploy-virtual-{scenario}-{stream}'
360 # Job template for virtual deployment
362 # Required Variables:
363 # stream: branch with - in place of / (eg. stable)
364 # branch: branch (eg. stable)
371 credentials-id: '{ssh-credentials}'
379 gs-pathname: '{gs-pathname}'
381 name: DEPLOY_SCENARIO
382 default: '{scenario}'
383 description: "Scenario to deploy with."
387 description: "Use yes in lower case to invoke clean. Indicates if the deploy environment should be cleaned before deployment"
391 use-build-blocker: true
393 - 'apex-deploy.*{stream}'
396 - 'apex-deploy-virtual'
397 - 'apex-workspace-cleanup'
400 name: 'apex-deploy-baremetal-{scenario}-{stream}'
402 # Job template for baremetal deployment
404 # Required Variables:
405 # stream: branch with - in place of / (eg. stable)
406 # branch: branch (eg. stable)
413 credentials-id: '{ssh-credentials}'
421 gs-pathname: '{gs-pathname}'
423 name: DEPLOY_SCENARIO
424 default: '{scenario}'
425 description: "Scenario to deploy with."
429 use-build-blocker: true
431 - 'apex-verify.*{stream}'
432 - 'apex-deploy.*{stream}'
433 - 'apex-build.*{stream}'
437 - 'apex-deploy-baremetal'
438 - 'apex-workspace-cleanup'
442 name: 'apex-daily-{stream2}'
444 # Job template for daily build
446 # Required Variables:
447 # stream: branch with - in place of / (eg. stable)
448 # branch: branch (eg. stable)
455 credentials-id: '{ssh-credentials}'
463 gs-pathname: '{gs-pathname}'
467 use-build-blocker: true
469 - 'apex-verify.*{stream2}'
470 - 'apex-deploy.*{stream2}'
471 - 'apex-build.*{stream2}'
472 - 'apex-runner.*{stream2}'
479 - project: 'apex-build-{stream2}'
481 current-parameters: true
484 - project: 'apex-deploy-baremetal-os-odl_l2-nofeature-ha-{stream2}'
485 predefined-parameters: |
486 BUILD_DIRECTORY=apex-build-{stream2}/build_output
491 - project: 'functest-apex-{slave}-daily-{stream2}'
492 predefined-parameters:
493 DEPLOY_SCENARIO=os-odl_l2-nofeature-ha
496 build-step-failure-threshold: 'never'
497 failure-threshold: 'never'
498 unstable-threshold: 'FAILURE'
500 - project: 'yardstick-apex-{slave}-daily-{stream2}'
501 predefined-parameters:
502 DEPLOY_SCENARIO=os-odl_l2-nofeature-ha
505 build-step-failure-threshold: 'never'
506 failure-threshold: 'never'
507 unstable-threshold: 'FAILURE'
509 - project: 'apex-deploy-baremetal-os-onos-nofeature-ha-{stream2}'
510 predefined-parameters:
511 BUILD_DIRECTORY=apex-build-{stream2}/build_output
515 - project: 'functest-apex-{slave}-daily-{stream2}'
516 predefined-parameters:
517 DEPLOY_SCENARIO=os-onos-nofeature-ha
520 build-step-failure-threshold: 'never'
521 failure-threshold: 'never'
522 unstable-threshold: 'FAILURE'
524 - project: 'yardstick-apex-{slave}-daily-{stream2}'
525 predefined-parameters:
526 DEPLOY_SCENARIO=os-onos-nofeature-ha
529 build-step-failure-threshold: 'never'
530 failure-threshold: 'never'
531 unstable-threshold: 'FAILURE'
533 - project: 'apex-deploy-baremetal-os-odl_l3-nofeature-ha-{stream2}'
534 predefined-parameters:
535 BUILD_DIRECTORY=apex-build-{stream2}/build_output
539 - project: 'functest-apex-{slave}-daily-{stream2}'
540 predefined-parameters:
541 DEPLOY_SCENARIO=os-odl_l3-nofeature-ha
544 build-step-failure-threshold: 'never'
545 failure-threshold: 'never'
546 unstable-threshold: 'FAILURE'
548 - project: 'yardstick-apex-{slave}-daily-{stream2}'
549 predefined-parameters:
550 DEPLOY_SCENARIO=os-odl_l3-nofeature-ha
553 build-step-failure-threshold: 'never'
554 failure-threshold: 'never'
555 unstable-threshold: 'FAILURE'
557 - project: 'apex-deploy-baremetal-os-odl_l2-bgpvpn-ha-{stream2}'
558 predefined-parameters:
559 BUILD_DIRECTORY=apex-build-{stream2}/build_output
563 - project: 'functest-apex-{slave}-daily-{stream2}'
564 predefined-parameters:
565 DEPLOY_SCENARIO=os-odl_l2-bgpvpn-ha
568 build-step-failure-threshold: 'never'
569 failure-threshold: 'never'
570 unstable-threshold: 'FAILURE'
572 - project: 'yardstick-apex-{slave}-daily-{stream2}'
573 predefined-parameters:
574 DEPLOY_SCENARIO=os-odl_l2-bgpvpn-ha
577 build-step-failure-threshold: 'never'
578 failure-threshold: 'never'
579 unstable-threshold: 'FAILURE'
583 name: 'apex-daily-{stream1}'
585 # Job template for daily build
587 # Required Variables:
588 # stream: branch with - in place of / (eg. stable)
589 # branch: branch (eg. stable)
590 node: '{daily-slave}'
596 credentials-id: '{ssh-credentials}'
604 gs-pathname: '{gs-pathname}'
608 use-build-blocker: true
610 - 'apex-verify.*{stream1}'
611 - 'apex-deploy.*{stream1}'
612 - 'apex-build.*{stream1}'
613 - 'apex-runner.*{stream1}'
620 - project: 'apex-build-{stream1}'
622 current-parameters: true
626 - project: 'apex-deploy-virtual-nosdn-nofeature-ha-{stream1}'
627 predefined-parameters: |
628 BUILD_DIRECTORY=apex-build-{stream1}/build
634 - project: 'functest-apex-{slave}-daily-{stream1}'
635 predefined-parameters:
636 DEPLOY_SCENARIO=os-nosdn-nofeature-ha
640 build-step-failure-threshold: 'never'
641 failure-threshold: 'never'
642 unstable-threshold: 'FAILURE'
644 - project: 'yardstick-apex-{slave}-daily-{stream1}'
645 predefined-parameters:
646 DEPLOY_SCENARIO=os-nosdn-nofeature-ha
650 build-step-failure-threshold: 'never'
651 failure-threshold: 'never'
652 unstable-threshold: 'FAILURE'
655 name: 'apex-gs-clean-{stream}'
657 # Job template for clean
659 # Required Variables:
660 # stream: branch with - in place of / (eg. stable)
669 gs-pathname: '{gs-pathname}'
675 - 'apex-gs-clean-{stream}'
678 ########################
680 ########################
687 description: "RPM Artifact name that will be appended to GS_URL to deploy a specific artifact"
689 name: ARTIFACT_VERSION
691 description: "Artifact version type"
693 name: BUILD_DIRECTORY
694 default: $WORKSPACE/build
695 description: "Directory where the build artifact will be located upon the completion of the build."
697 name: CACHE_DIRECTORY
698 default: $HOME/opnfv/cache{gs-pathname}
699 description: "Directory where the cache to be used during the build is located."
702 default: https://gerrit.opnfv.org/gerrit/$PROJECT
703 description: "Used for overriding the GIT URL coming from Global Jenkins configuration in case if the stuff is done on none-LF HW."
706 default: artifacts.opnfv.org/$PROJECT{gs-pathname}
707 description: "URL to Google Storage."
709 ########################
711 ########################
720 # log info to console
721 echo "Starting the build of Apex using OpenStack Master packages. This will take some time..."
722 echo "---------------------------------------------------------------------------------------"
724 # create the cache directory if it doesn't exist
725 [[ -d $CACHE_DIRECTORY ]] || mkdir -p $CACHE_DIRECTORY
726 # set OPNFV_ARTIFACT_VERSION
727 if echo $BUILD_TAG | grep "apex-verify" 1> /dev/null; then
728 if echo $GERRIT_BRANCH | grep "brahmaputra" 1> /dev/null; then
729 export OPNFV_ARTIFACT_VERSION=brahmaputra-dev${BUILD_NUMBER}
730 export BUILD_ARGS="-v $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY $BUILD_DIRECTORY"
732 export OPNFV_ARTIFACT_VERSION=dev${BUILD_NUMBER}
733 export BUILD_ARGS="-r $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY"
735 elif [ "$ARTIFACT_VERSION" == "daily" ]; then
736 if echo $GERRIT_BRANCH | grep "brahmaputra" 1> /dev/null; then
737 export OPNFV_ARTIFACT_VERSION=brahmaputra-$(date -u +"%Y-%m-%d")
738 export BUILD_ARGS="-v $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY $BUILD_DIRECTORY"
740 export OPNFV_ARTIFACT_VERSION=$(date -u +"%Y-%m-%d")
741 export BUILD_ARGS="-r $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY --iso"
744 export OPNFV_ARTIFACT_VERSION=${ARTIFACT_VERSION}
745 if echo $GERRIT_BRANCH | grep "brahmaputra" 1> /dev/null; then
746 export BUILD_ARGS="-v $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY $BUILD_DIRECTORY"
748 export BUILD_ARGS="-r $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY --iso"
751 # clean for stable but doesn't matter for master
752 if echo $GERRIT_BRANCH | grep "brahmaputra" 1> /dev/null; then
757 ./build.sh $BUILD_ARGS
758 RPM_VERSION=$(grep Version: $BUILD_DIRECTORY/opnfv-apex.spec | awk '{ print $2 }')-$(echo $OPNFV_ARTIFACT_VERSION | tr -d '_-')
759 # list the contents of BUILD_OUTPUT directory
760 ls -al $BUILD_DIRECTORY
761 # save information regarding artifact into file
763 echo "OPNFV_ARTIFACT_VERSION=$OPNFV_ARTIFACT_VERSION"
764 echo "OPNFV_GIT_URL=$(git config --get remote.origin.url)"
765 echo "OPNFV_GIT_SHA1=$(git rev-parse HEAD)"
766 echo "OPNFV_ARTIFACT_URL=$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
767 echo "OPNFV_ARTIFACT_MD5SUM=$(md5sum $BUILD_DIRECTORY/release/OPNFV-CentOS-7-x86_64-$OPNFV_ARTIFACT_VERSION.iso | cut -d' ' -f1)"
768 echo "OPNFV_SRPM_URL=$GS_URL/opnfv-apex-$RPM_VERSION.src.rpm"
769 echo "OPNFV_RPM_URL=$GS_URL/opnfv-apex-$RPM_VERSION.noarch.rpm"
770 echo "OPNFV_RPM_MD5SUM=$(md5sum $BUILD_DIRECTORY/noarch/opnfv-apex-$RPM_VERSION.noarch.rpm | cut -d' ' -f1)"
771 echo "OPNFV_BUILD_URL=$BUILD_URL"
772 ) > $WORKSPACE/opnfv.properties
773 echo "--------------------------------------------------------"
777 name: 'apex-workspace-cleanup'
785 # delete everything that is in $WORKSPACE
786 sudo /bin/rm -rf $WORKSPACE
789 name: 'apex-upload-artifact'
797 # log info to console
798 echo "Uploading the Apex artifact. This could take some time..."
799 echo "--------------------------------------------------------"
802 # source the opnfv.properties to get ARTIFACT_VERSION
803 source $WORKSPACE/opnfv.properties
805 # upload artifact and additional files to google storage
806 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
807 RPM_INSTALL_PATH=$BUILD_DIRECTORY/noarch
808 RPM_LIST=$RPM_INSTALL_PATH/$(basename $OPNFV_RPM_URL)
809 VERSION_EXTENSION=$(echo $(basename $OPNFV_RPM_URL) | sed 's/opnfv-apex-//')
810 for pkg in common undercloud opendaylight-sfc onos; do
811 RPM_LIST+=" ${RPM_INSTALL_PATH}/opnfv-apex-${pkg}-${VERSION_EXTENSION}"
813 SRPM_INSTALL_PATH=$BUILD_DIRECTORY
814 SRPM_LIST=$SRPM_INSTALL_PATH/$(basename $OPNFV_SRPM_URL)
815 for pkg in common undercloud opendaylight-sfc onos; do
816 SRPM_LIST+=" ${SRPM_INSTALL_PATH}/opnfv-apex-${pkg}-${VERSION_EXTENSION}"
818 for artifact in $RPM_LIST $SRPM_LIST; do
819 gsutil cp $artifact gs://$GS_URL/$(basename $artifact) > gsutil.iso.log 2>&1
821 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.properties > gsutil.properties.log 2>&1
822 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/latest.properties > gsutil.latest.log 2>&1
825 echo "--------------------------------------------------------"
827 echo "ISO Artifact is available as http://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
828 echo "RPM Artifact is available as http://$GS_URL/$(basename $OPNFV_RPM_URL)"
831 name: 'apex-gs-cleanup'
839 # log info to console
840 echo "Cleaning Google Storage"
841 echo "-----------------------"
844 thirty_days_ago=$(date -d "30 days ago" +"%Y%m%d")
846 for i in $(gsutil ls gs://$GS_URL/*201?*); do
847 filedate=$(date -d "$(echo $i | grep -Eo 201[0-9]-?[0-9][0-9]-?[0-9][0-9])" +"%Y%m%d")
848 if [ $filedate -lt $thirty_days_ago ]; then
849 # gsutil indicates what it is removing so no need for output here
855 name: 'apex-deploy-virtual'
863 # log info to console
864 echo "Starting the Apex virtual deployment."
865 echo "--------------------------------------------------------"
868 if [[ $BUILD_DIRECTORY == *verify-master* ]]; then
869 cd $WORKSPACE/../${BUILD_DIRECTORY/build_output/}
871 echo "WORKSPACE modified to $WORKSPACE"
873 elif [[ ! "$ARTIFACT_NAME" == "latest" ]]; then
874 # if artifact name is passed the pull a
875 # specific artifact from artifacts.opnfv.org
876 RPM_INSTALL_PATH=$GS_URL
877 RPM_LIST=$RPM_INSTALL_PATH/$ARTIFACT_NAME
879 if [[ $BUILD_DIRECTORY == *verify* ]]; then
880 BUILD_DIRECTORY=$WORKSPACE/../$BUILD_DIRECTORY
881 echo "BUILD DIRECTORY modified to $BUILD_DIRECTORY"
882 elif [[ $BUILD_DIRECTORY == *apex-build* ]]; then
883 BUILD_DIRECTORY=$WORKSPACE/../$BUILD_DIRECTORY
884 echo "BUILD DIRECTORY modified to $BUILD_DIRECTORY"
887 if [[ -f ${BUILD_DIRECTORY}/../opnfv.properties ]]; then
888 # if opnfv.properties exists then use the
889 # local build. Source the file so we get local OPNFV vars
890 source ${BUILD_DIRECTORY}/../opnfv.properties
891 RPM_INSTALL_PATH=${BUILD_DIRECTORY}/noarch
892 RPM_LIST=$RPM_INSTALL_PATH/$(basename $OPNFV_RPM_URL)
894 if [[ $BUILD_DIRECTORY == *verify* ]]; then
895 echo "BUILD_DIRECTORY is from a verify job, so will not use latest from URL"
896 echo "Check that the slave has opnfv.properties in $BUILD_DIRECTORY"
898 elif [[ $BUILD_DIRECTORY == *apex-build* ]]; then
899 echo "BUILD_DIRECTORY is from a daily job, so will not use latest from URL"
900 echo "Check that the slave has opnfv.properties in $BUILD_DIRECTORY"
903 # no opnfv.properties means use the latest from artifacts.opnfv.org
904 # get the latest.properties to get the link to the latest artifact
905 curl -s -o $WORKSPACE/opnfv.properties http://$GS_URL/latest.properties
906 [[ -f opnfv.properties ]] || exit 1
907 # source the file so we get OPNFV vars
908 source opnfv.properties
909 RPM_INSTALL_PATH=$(echo $OPNFV_RPM_URL | sed 's/'"$(basename $OPNFV_RPM_URL)"'//')
910 RPM_LIST=$RPM_INSTALL_PATH/$(basename $OPNFV_RPM_URL)
914 if [ -z "$DEPLOY_SCENARIO" ]; then
915 echo "Deploy scenario not set!"
919 # use local build for verify
920 if [[ $BUILD_DIRECTORY == *verify-master* ]]; then
921 if [ ! -e "${WORKSPACE}/build/lib" ]; then ln -s ${WORKSPACE}/lib ${WORKSPACE}/build/lib; fi
922 DEPLOY_CMD="CONFIG=${WORKSPACE}/build RESOURCES=${WORKSPACE}/build/images/ ./deploy.sh -c ${WORKSPACE}/build -r ${WORKSPACE}/build/images/"
923 DEPLOY_FILE="${WORKSPACE}/config/deploy/${DEPLOY_SCENARIO}.yaml"
924 NETWORK_FILE="${WORKSPACE}/config/network/network_settings.yaml"
925 # Make sure python34 is installed
926 if ! rpm -q python34 > /dev/null; then
927 sudo yum install -y epel-release
928 if ! sudo yum install -y python34; then
929 echo "Failed to install python34"
933 if ! rpm -q python34-PyYAML > /dev/null; then
934 sudo yum install -y epel-release
935 if ! sudo yum install -y python34-PyYAML; then
936 echo "Failed to install python34-PyYAML"
940 if ! rpm -q python34-setuptools > /dev/null; then
941 if ! sudo yum install -y python34-setuptools; then
942 echo "Failed to install python34-setuptools"
946 if [ -z ${PYTHONPATH:-} ]; then
947 export PYTHONPATH=${WORKSPACE}/lib/python
949 export PYTHONPATH=$PYTHONPATH:${WORKSPACE}/lib/python
952 VERSION_EXTENSION=$(echo $(basename $RPM_LIST) | sed 's/opnfv-apex-//')
953 for pkg in common undercloud opendaylight-sfc onos; do
954 RPM_LIST+=" ${RPM_INSTALL_PATH}/opnfv-apex-${pkg}-${VERSION_EXTENSION}"
957 # update / install the new rpm
958 if rpm -q opnfv-apex > /dev/null; then
959 INSTALLED_RPMS=$(rpm -qa | grep apex)
960 for x in $INSTALLED_RPMS; do
961 INSTALLED_RPM_VER=$(echo $x | sed 's/opnfv-apex-//').rpm
962 # Does each RPM's version match the version required for deployment
963 if [ "$INSTALLED_RPM_VER" == "$VERSION_EXTENSION" ]; then
964 echo "RPM $x is already installed"
966 echo "RPM $x does not match $VERSION_EXTENSION"
967 echo "Will upgrade/downgrade RPMs..."
968 # Try to upgrade/downgrade RPMS
969 if sudo yum update -y $RPM_LIST | grep "does not update installed package"; then
970 if ! sudo yum downgrade -y $RPM_LIST; then
971 sudo yum remove -y opnfv-apex-undercloud opnfv-apex-common opnfv-apex-opendaylight-sfc opnfv-apex-onos
972 sudo yum downgrade -y $RPM_INSTALL_PATH
979 sudo yum install -y $RPM_LIST;
981 DEPLOY_CMD=opnfv-deploy
982 DEPLOY_FILE="/etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml"
983 NETWORK_FILE="/etc/opnfv-apex/network_settings.yaml"
984 export RESOURCES="/var/opt/opnfv/images"
985 export CONFIG="/var/opt/opnfv"
988 if [ "$OPNFV_CLEAN" == 'yes' ]; then
989 if [[ $BUILD_DIRECTORY == *verify-master* ]]; then
990 sudo CONFIG=../lib ./clean.sh
995 # initiate virtual deployment
996 echo "Deploy Scenario set to ${DEPLOY_SCENARIO}"
997 if [ -e $DEPLOY_FILE ]; then
998 sudo $DEPLOY_CMD -v -d ${DEPLOY_FILE} -n $NETWORK_FILE --debug
1000 echo "File does not exist /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml"
1004 echo "--------------------------------------------------------"
1008 name: 'apex-deploy-baremetal'
1016 # log info to console
1017 echo "Starting the Apex baremetal deployment."
1018 echo "--------------------------------------------------------"
1021 if [[ ! "$ARTIFACT_NAME" == "latest" ]]; then
1022 # if artifact name is passed the pull a
1023 # specific artifact from artifacts.opnfv.org
1024 RPM_INSTALL_PATH=$GS_URL/$ARTIFACT_NAME
1026 if [[ $BUILD_DIRECTORY == *apex-build* ]]; then
1027 BUILD_DIRECTORY=$WORKSPACE/../$BUILD_DIRECTORY
1028 echo "BUILD DIRECTORY modified to $BUILD_DIRECTORY"
1030 if [[ -f ${BUILD_DIRECTORY}/../opnfv.properties ]]; then
1031 # if opnfv.properties exists then use the
1032 # local build. Source the file so we get local OPNFV vars
1033 source ${BUILD_DIRECTORY}/../opnfv.properties
1034 RPM_INSTALL_PATH=${BUILD_DIRECTORY}/$(basename $OPNFV_RPM_URL)
1036 # no opnfv.properties means use the latest from artifacts.opnfv.org
1037 # get the latest.properties to get the link to the latest artifact
1038 curl -s -o $WORKSPACE/opnfv.properties http://$GS_URL/latest.properties
1039 [[ -f opnfv.properties ]] || exit 1
1040 # source the file so we get OPNFV vars
1041 source opnfv.properties
1042 RPM_INSTALL_PATH=$OPNFV_RPM_URL
1046 if [ ! -e "$RPM_INSTALL_PATH" ]; then
1047 RPM_INSTALL_PATH=http://${OPNFV_RPM_URL}
1050 RPM_LIST=$RPM_INSTALL_PATH
1051 for pkg in common undercloud; do
1052 RPM_LIST+=" ${RPM_INSTALL_PATH/opnfv-apex/opnfv-apex-${pkg}}"
1055 # update / install the new rpm
1056 if rpm -q opnfv-apex > /dev/null; then
1057 if [ $(basename $OPNFV_RPM_URL) == $(rpm -q opnfv-apex).rpm ]; then
1058 echo "RPM is already installed"
1059 elif sudo yum update -y $RPM_LIST | grep "does not update installed package"; then
1060 if ! sudo yum downgrade -y $RPM_LIST; then
1061 sudo yum remove -y opnfv-undercloud opnfv-common
1062 sudo yum downgrade -y $RPM_INSTALL_PATH
1066 sudo yum install -y $RPM_LIST;
1069 # cleanup environment before we start
1071 # initiate baremetal deployment
1072 if [ -e /etc/opnfv-apex/network_settings.yaml ]; then
1073 if [ -n "$DEPLOY_SCENARIO" ]; then
1074 echo "Deploy Scenario set to ${DEPLOY_SCENARIO}"
1075 if [ -e /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml ]; then
1076 sudo opnfv-deploy -i /root/inventory/pod_settings.yaml \
1077 -d /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml \
1078 -n /root/network/network_settings.yaml --debug
1080 echo "File does not exist /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml"
1084 echo "Deploy scenario not set!"
1088 echo "File /etc/opnfv-apex/network_settings.yaml does not exist!"
1093 echo "--------------------------------------------------------"
1096 #######################
1098 ########################
1102 - timed: '0 3 * * *'
1104 name: 'apex-brahmaputra'
1106 - timed: '0 3 * * *'
1108 name: 'apex-gs-clean-{stream}'
1110 - timed: '0 2 * * *'