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
217 - 'apex-daily.*{stream1}'
218 - 'apex-deploy.*{stream1}'
219 - 'apex-build.*{stream1}'
220 - 'apex-runner.*{stream1}'
221 - 'apex-verify-{stream1}'
226 - project: 'apex-deploy-virtual-os-nosdn-nofeature-ha-{stream1}'
227 predefined-parameters: |
228 BUILD_DIRECTORY=apex-verify-{stream1}
234 # - project: 'functest-apex-{verify-slave}-suite-{stream1}'
235 # predefined-parameters: |
236 # DEPLOY_SCENARIO=os-nosdn-nofeature-ha
237 # FUNCTEST_SUITE_NAME=vping_userdata
241 - project: 'apex-deploy-virtual-os-odl_l2-nofeature-ha-{stream1}'
242 predefined-parameters: |
243 BUILD_DIRECTORY=apex-verify-{stream1}
248 - 'apex-workspace-cleanup'
251 name: 'apex-runner-{platform}-{scenario}-{stream}'
253 # runner jobs for deploying manually
261 gs-pathname: '{gs-pathname}'
268 default: https://gerrit.opnfv.org/gerrit/$PROJECT
269 description: "Used for overriding the GIT URL coming from parameters macro."
272 - gerrit-trigger-scm:
273 credentials-id: '{ssh-credentials}'
275 choosing-strategy: 'default'
279 use-build-blocker: true
281 - 'apex-daily.*{stream}'
282 - 'apex-verify.*{stream}'
286 - project: 'apex-deploy-{platform}-{scenario}-{stream}'
287 predefined-parameters:
292 - project: 'yardstick-apex-{slave}-daily-{stream}'
293 predefined-parameters:
294 DEPLOY_SCENARIO={scenario}
297 build-step-failure-threshold: 'never'
298 failure-threshold: 'never'
299 unstable-threshold: 'FAILURE'
301 - project: 'functest-apex-{slave}-daily-{stream}'
302 predefined-parameters:
303 DEPLOY_SCENARIO={scenario}
306 build-step-failure-threshold: 'never'
307 failure-threshold: 'never'
308 unstable-threshold: 'FAILURE'
311 name: 'apex-build-{stream}'
313 # Job template for builds
315 # Required Variables:
316 # stream: branch with - in place of / (eg. stable)
317 # branch: branch (eg. stable)
318 node: '{daily-slave}'
326 gs-pathname: '{gs-pathname}'
331 default: https://gerrit.opnfv.org/gerrit/$PROJECT
332 description: "Used for overriding the GIT URL coming from parameters macro."
336 credentials-id: '{ssh-credentials}'
342 use-build-blocker: true
345 - 'apex-deploy.*{stream}'
350 - project: 'apex-deploy-virtual-os-nosdn-nofeature-ha-{stream}'
351 predefined-parameters: |
352 BUILD_DIRECTORY=apex-build-{stream}/build
357 - 'apex-upload-artifact'
360 name: 'apex-deploy-virtual-{scenario}-{stream}'
362 # Job template for virtual deployment
364 # Required Variables:
365 # stream: branch with - in place of / (eg. stable)
366 # branch: branch (eg. stable)
373 credentials-id: '{ssh-credentials}'
381 gs-pathname: '{gs-pathname}'
383 name: DEPLOY_SCENARIO
384 default: '{scenario}'
385 description: "Scenario to deploy with."
389 description: "Use yes in lower case to invoke clean. Indicates if the deploy environment should be cleaned before deployment"
393 use-build-blocker: true
396 - 'apex-deploy.*{stream}'
399 - 'apex-deploy-virtual'
400 - 'apex-workspace-cleanup'
403 name: 'apex-deploy-baremetal-{scenario}-{stream}'
405 # Job template for baremetal deployment
407 # Required Variables:
408 # stream: branch with - in place of / (eg. stable)
409 # branch: branch (eg. stable)
416 credentials-id: '{ssh-credentials}'
424 gs-pathname: '{gs-pathname}'
426 name: DEPLOY_SCENARIO
427 default: '{scenario}'
428 description: "Scenario to deploy with."
432 use-build-blocker: true
434 - 'apex-verify.*{stream}'
435 - 'apex-deploy.*{stream}'
436 - 'apex-build.*{stream}'
440 - 'apex-deploy-baremetal'
441 - 'apex-workspace-cleanup'
445 name: 'apex-daily-{stream2}'
447 # Job template for daily build
449 # Required Variables:
450 # stream: branch with - in place of / (eg. stable)
451 # branch: branch (eg. stable)
458 credentials-id: '{ssh-credentials}'
466 gs-pathname: '{gs-pathname}'
470 use-build-blocker: true
472 - 'apex-verify.*{stream2}'
473 - 'apex-deploy.*{stream2}'
474 - 'apex-build.*{stream2}'
475 - 'apex-runner.*{stream2}'
482 - project: 'apex-build-{stream2}'
484 current-parameters: true
487 - project: 'apex-deploy-baremetal-os-odl_l2-nofeature-ha-{stream2}'
488 predefined-parameters: |
489 BUILD_DIRECTORY=apex-build-{stream2}/build_output
494 - project: 'functest-apex-{slave}-daily-{stream2}'
495 predefined-parameters:
496 DEPLOY_SCENARIO=os-odl_l2-nofeature-ha
499 build-step-failure-threshold: 'never'
500 failure-threshold: 'never'
501 unstable-threshold: 'FAILURE'
503 - project: 'yardstick-apex-{slave}-daily-{stream2}'
504 predefined-parameters:
505 DEPLOY_SCENARIO=os-odl_l2-nofeature-ha
508 build-step-failure-threshold: 'never'
509 failure-threshold: 'never'
510 unstable-threshold: 'FAILURE'
512 - project: 'apex-deploy-baremetal-os-onos-nofeature-ha-{stream2}'
513 predefined-parameters:
514 BUILD_DIRECTORY=apex-build-{stream2}/build_output
518 - project: 'functest-apex-{slave}-daily-{stream2}'
519 predefined-parameters:
520 DEPLOY_SCENARIO=os-onos-nofeature-ha
523 build-step-failure-threshold: 'never'
524 failure-threshold: 'never'
525 unstable-threshold: 'FAILURE'
527 - project: 'yardstick-apex-{slave}-daily-{stream2}'
528 predefined-parameters:
529 DEPLOY_SCENARIO=os-onos-nofeature-ha
532 build-step-failure-threshold: 'never'
533 failure-threshold: 'never'
534 unstable-threshold: 'FAILURE'
536 - project: 'apex-deploy-baremetal-os-odl_l3-nofeature-ha-{stream2}'
537 predefined-parameters:
538 BUILD_DIRECTORY=apex-build-{stream2}/build_output
542 - project: 'functest-apex-{slave}-daily-{stream2}'
543 predefined-parameters:
544 DEPLOY_SCENARIO=os-odl_l3-nofeature-ha
547 build-step-failure-threshold: 'never'
548 failure-threshold: 'never'
549 unstable-threshold: 'FAILURE'
551 - project: 'yardstick-apex-{slave}-daily-{stream2}'
552 predefined-parameters:
553 DEPLOY_SCENARIO=os-odl_l3-nofeature-ha
556 build-step-failure-threshold: 'never'
557 failure-threshold: 'never'
558 unstable-threshold: 'FAILURE'
560 - project: 'apex-deploy-baremetal-os-odl_l2-bgpvpn-ha-{stream2}'
561 predefined-parameters:
562 BUILD_DIRECTORY=apex-build-{stream2}/build_output
566 - project: 'functest-apex-{slave}-daily-{stream2}'
567 predefined-parameters:
568 DEPLOY_SCENARIO=os-odl_l2-bgpvpn-ha
571 build-step-failure-threshold: 'never'
572 failure-threshold: 'never'
573 unstable-threshold: 'FAILURE'
575 - project: 'yardstick-apex-{slave}-daily-{stream2}'
576 predefined-parameters:
577 DEPLOY_SCENARIO=os-odl_l2-bgpvpn-ha
580 build-step-failure-threshold: 'never'
581 failure-threshold: 'never'
582 unstable-threshold: 'FAILURE'
586 name: 'apex-daily-{stream1}'
588 # Job template for daily build
590 # Required Variables:
591 # stream: branch with - in place of / (eg. stable)
592 # branch: branch (eg. stable)
593 node: '{daily-slave}'
599 credentials-id: '{ssh-credentials}'
607 gs-pathname: '{gs-pathname}'
611 use-build-blocker: true
614 - 'apex-verify.*{stream1}'
615 - 'apex-deploy.*{stream1}'
616 - 'apex-build.*{stream1}'
617 - 'apex-runner.*{stream1}'
624 - project: 'apex-build-{stream1}'
626 current-parameters: true
630 - project: 'apex-deploy-virtual-nosdn-nofeature-ha-{stream1}'
631 predefined-parameters: |
632 BUILD_DIRECTORY=apex-build-{stream1}/build
638 - project: 'functest-apex-{slave}-daily-{stream1}'
639 predefined-parameters:
640 DEPLOY_SCENARIO=os-nosdn-nofeature-ha
644 build-step-failure-threshold: 'never'
645 failure-threshold: 'never'
646 unstable-threshold: 'FAILURE'
648 - project: 'yardstick-apex-{slave}-daily-{stream1}'
649 predefined-parameters:
650 DEPLOY_SCENARIO=os-nosdn-nofeature-ha
654 build-step-failure-threshold: 'never'
655 failure-threshold: 'never'
656 unstable-threshold: 'FAILURE'
659 name: 'apex-gs-clean-{stream}'
661 # Job template for clean
663 # Required Variables:
664 # stream: branch with - in place of / (eg. stable)
673 gs-pathname: '{gs-pathname}'
679 - 'apex-gs-clean-{stream}'
682 ########################
684 ########################
691 description: "RPM Artifact name that will be appended to GS_URL to deploy a specific artifact"
693 name: ARTIFACT_VERSION
695 description: "Artifact version type"
697 name: BUILD_DIRECTORY
698 default: $WORKSPACE/build
699 description: "Directory where the build artifact will be located upon the completion of the build."
701 name: CACHE_DIRECTORY
702 default: $HOME/opnfv/cache{gs-pathname}
703 description: "Directory where the cache to be used during the build is located."
706 default: https://gerrit.opnfv.org/gerrit/$PROJECT
707 description: "Used for overriding the GIT URL coming from Global Jenkins configuration in case if the stuff is done on none-LF HW."
710 default: artifacts.opnfv.org/$PROJECT{gs-pathname}
711 description: "URL to Google Storage."
713 ########################
715 ########################
724 # log info to console
725 echo "Starting the build of Apex using OpenStack Master packages. This will take some time..."
726 echo "---------------------------------------------------------------------------------------"
728 # create the cache directory if it doesn't exist
729 [[ -d $CACHE_DIRECTORY ]] || mkdir -p $CACHE_DIRECTORY
730 # set OPNFV_ARTIFACT_VERSION
731 if echo $BUILD_TAG | grep "apex-verify" 1> /dev/null; then
732 if echo $GERRIT_BRANCH | grep "brahmaputra" 1> /dev/null; then
733 export OPNFV_ARTIFACT_VERSION=brahmaputra-dev${BUILD_NUMBER}
734 export BUILD_ARGS="-v $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY $BUILD_DIRECTORY"
736 export OPNFV_ARTIFACT_VERSION=dev${BUILD_NUMBER}
737 export BUILD_ARGS="-r $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY"
739 elif [ "$ARTIFACT_VERSION" == "daily" ]; then
740 if echo $GERRIT_BRANCH | grep "brahmaputra" 1> /dev/null; then
741 export OPNFV_ARTIFACT_VERSION=brahmaputra-$(date -u +"%Y-%m-%d")
742 export BUILD_ARGS="-v $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY $BUILD_DIRECTORY"
744 export OPNFV_ARTIFACT_VERSION=$(date -u +"%Y-%m-%d")
745 export BUILD_ARGS="-r $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY --iso"
748 export OPNFV_ARTIFACT_VERSION=${ARTIFACT_VERSION}
749 if echo $GERRIT_BRANCH | grep "brahmaputra" 1> /dev/null; then
750 export BUILD_ARGS="-v $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY $BUILD_DIRECTORY"
752 export BUILD_ARGS="-r $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY --iso"
755 # clean for stable but doesn't matter for master
756 if echo $GERRIT_BRANCH | grep "brahmaputra" 1> /dev/null; then
761 ./build.sh $BUILD_ARGS
762 RPM_VERSION=$(grep Version: $BUILD_DIRECTORY/opnfv-apex.spec | awk '{ print $2 }')-$(echo $OPNFV_ARTIFACT_VERSION | tr -d '_-')
763 # list the contents of BUILD_OUTPUT directory
764 ls -al $BUILD_DIRECTORY
765 # save information regarding artifact into file
767 echo "OPNFV_ARTIFACT_VERSION=$OPNFV_ARTIFACT_VERSION"
768 echo "OPNFV_GIT_URL=$(git config --get remote.origin.url)"
769 echo "OPNFV_GIT_SHA1=$(git rev-parse HEAD)"
770 echo "OPNFV_ARTIFACT_URL=$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
771 echo "OPNFV_ARTIFACT_MD5SUM=$(md5sum $BUILD_DIRECTORY/release/OPNFV-CentOS-7-x86_64-$OPNFV_ARTIFACT_VERSION.iso | cut -d' ' -f1)"
772 echo "OPNFV_SRPM_URL=$GS_URL/opnfv-apex-$RPM_VERSION.src.rpm"
773 echo "OPNFV_RPM_URL=$GS_URL/opnfv-apex-$RPM_VERSION.noarch.rpm"
774 echo "OPNFV_RPM_MD5SUM=$(md5sum $BUILD_DIRECTORY/noarch/opnfv-apex-$RPM_VERSION.noarch.rpm | cut -d' ' -f1)"
775 echo "OPNFV_BUILD_URL=$BUILD_URL"
776 ) > $WORKSPACE/opnfv.properties
777 echo "--------------------------------------------------------"
781 name: 'apex-workspace-cleanup'
789 # delete everything that is in $WORKSPACE
790 sudo /bin/rm -rf $WORKSPACE
793 name: 'apex-upload-artifact'
801 # log info to console
802 echo "Uploading the Apex artifact. This could take some time..."
803 echo "--------------------------------------------------------"
806 # source the opnfv.properties to get ARTIFACT_VERSION
807 source $WORKSPACE/opnfv.properties
809 # upload artifact and additional files to google storage
810 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
811 RPM_INSTALL_PATH=$BUILD_DIRECTORY/noarch
812 RPM_LIST=$RPM_INSTALL_PATH/$(basename $OPNFV_RPM_URL)
813 VERSION_EXTENSION=$(echo $(basename $OPNFV_RPM_URL) | sed 's/opnfv-apex-//')
814 for pkg in common undercloud opendaylight-sfc onos; do
815 RPM_LIST+=" ${RPM_INSTALL_PATH}/opnfv-apex-${pkg}-${VERSION_EXTENSION}"
817 SRPM_INSTALL_PATH=$BUILD_DIRECTORY
818 SRPM_LIST=$SRPM_INSTALL_PATH/$(basename $OPNFV_SRPM_URL)
819 for pkg in common undercloud opendaylight-sfc onos; do
820 SRPM_LIST+=" ${SRPM_INSTALL_PATH}/opnfv-apex-${pkg}-${VERSION_EXTENSION}"
822 for artifact in $RPM_LIST $SRPM_LIST; do
823 gsutil cp $artifact gs://$GS_URL/$(basename $artifact) > gsutil.iso.log 2>&1
825 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.properties > gsutil.properties.log 2>&1
826 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/latest.properties > gsutil.latest.log 2>&1
829 echo "--------------------------------------------------------"
831 echo "ISO Artifact is available as http://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
832 echo "RPM Artifact is available as http://$GS_URL/$(basename $OPNFV_RPM_URL)"
835 name: 'apex-gs-cleanup'
843 # log info to console
844 echo "Cleaning Google Storage"
845 echo "-----------------------"
848 thirty_days_ago=$(date -d "30 days ago" +"%Y%m%d")
850 for i in $(gsutil ls gs://$GS_URL/*201?*); do
851 filedate=$(date -d "$(echo $i | grep -Eo 201[0-9]-?[0-9][0-9]-?[0-9][0-9])" +"%Y%m%d")
852 if [ $filedate -lt $thirty_days_ago ]; then
853 # gsutil indicates what it is removing so no need for output here
859 name: 'apex-deploy-virtual'
867 # log info to console
868 echo "Starting the Apex virtual deployment."
869 echo "--------------------------------------------------------"
872 if [[ $BUILD_DIRECTORY == *verify-master* ]]; then
873 cd $WORKSPACE/../${BUILD_DIRECTORY/build_output/}
875 echo "WORKSPACE modified to $WORKSPACE"
877 elif [[ ! "$ARTIFACT_NAME" == "latest" ]]; then
878 # if artifact name is passed the pull a
879 # specific artifact from artifacts.opnfv.org
880 RPM_INSTALL_PATH=$GS_URL
881 RPM_LIST=$RPM_INSTALL_PATH/$ARTIFACT_NAME
883 if [[ $BUILD_DIRECTORY == *verify* ]]; then
884 BUILD_DIRECTORY=$WORKSPACE/../$BUILD_DIRECTORY
885 echo "BUILD DIRECTORY modified to $BUILD_DIRECTORY"
886 elif [[ $BUILD_DIRECTORY == *apex-build* ]]; then
887 BUILD_DIRECTORY=$WORKSPACE/../$BUILD_DIRECTORY
888 echo "BUILD DIRECTORY modified to $BUILD_DIRECTORY"
891 if [[ -f ${BUILD_DIRECTORY}/../opnfv.properties ]]; then
892 # if opnfv.properties exists then use the
893 # local build. Source the file so we get local OPNFV vars
894 source ${BUILD_DIRECTORY}/../opnfv.properties
895 RPM_INSTALL_PATH=${BUILD_DIRECTORY}/noarch
896 RPM_LIST=$RPM_INSTALL_PATH/$(basename $OPNFV_RPM_URL)
898 if [[ $BUILD_DIRECTORY == *verify* ]]; then
899 echo "BUILD_DIRECTORY is from a verify job, so will not use latest from URL"
900 echo "Check that the slave has opnfv.properties in $BUILD_DIRECTORY"
902 elif [[ $BUILD_DIRECTORY == *apex-build* ]]; then
903 echo "BUILD_DIRECTORY is from a daily job, so will not use latest from URL"
904 echo "Check that the slave has opnfv.properties in $BUILD_DIRECTORY"
907 # no opnfv.properties means use the latest from artifacts.opnfv.org
908 # get the latest.properties to get the link to the latest artifact
909 curl -s -o $WORKSPACE/opnfv.properties http://$GS_URL/latest.properties
910 [[ -f opnfv.properties ]] || exit 1
911 # source the file so we get OPNFV vars
912 source opnfv.properties
913 RPM_INSTALL_PATH=$(echo $OPNFV_RPM_URL | sed 's/'"$(basename $OPNFV_RPM_URL)"'//')
914 RPM_LIST=$RPM_INSTALL_PATH/$(basename $OPNFV_RPM_URL)
918 if [ -z "$DEPLOY_SCENARIO" ]; then
919 echo "Deploy scenario not set!"
923 # use local build for verify
924 if [[ $BUILD_DIRECTORY == *verify-master* ]]; then
925 if [ ! -e "${WORKSPACE}/build/lib" ]; then ln -s ${WORKSPACE}/lib ${WORKSPACE}/build/lib; fi
926 DEPLOY_CMD="CONFIG=${WORKSPACE}/build RESOURCES=${WORKSPACE}/build/images/ ./deploy.sh -c ${WORKSPACE}/build -r ${WORKSPACE}/build/images/"
927 DEPLOY_FILE="${WORKSPACE}/config/deploy/${DEPLOY_SCENARIO}.yaml"
928 NETWORK_FILE="${WORKSPACE}/config/network/network_settings.yaml"
929 # Make sure python34 is installed
930 if ! rpm -q python34 > /dev/null; then
931 sudo yum install -y epel-release
932 if ! sudo yum install -y python34; then
933 echo "Failed to install python34"
937 if ! rpm -q python34-PyYAML > /dev/null; then
938 sudo yum install -y epel-release
939 if ! sudo yum install -y python34-PyYAML; then
940 echo "Failed to install python34-PyYAML"
944 if ! rpm -q python34-setuptools > /dev/null; then
945 if ! sudo yum install -y python34-setuptools; then
946 echo "Failed to install python34-setuptools"
950 if [ -z ${PYTHONPATH:-} ]; then
951 export PYTHONPATH=${WORKSPACE}/lib/python
953 export PYTHONPATH=$PYTHONPATH:${WORKSPACE}/lib/python
956 VERSION_EXTENSION=$(echo $(basename $RPM_LIST) | sed 's/opnfv-apex-//')
957 for pkg in common undercloud opendaylight-sfc onos; do
958 RPM_LIST+=" ${RPM_INSTALL_PATH}/opnfv-apex-${pkg}-${VERSION_EXTENSION}"
961 # update / install the new rpm
962 if rpm -q opnfv-apex > /dev/null; then
963 INSTALLED_RPMS=$(rpm -qa | grep apex)
964 for x in $INSTALLED_RPMS; do
965 INSTALLED_RPM_VER=$(echo $x | sed 's/opnfv-apex-//').rpm
966 # Does each RPM's version match the version required for deployment
967 if [ "$INSTALLED_RPM_VER" == "$VERSION_EXTENSION" ]; then
968 echo "RPM $x is already installed"
970 echo "RPM $x does not match $VERSION_EXTENSION"
971 echo "Will upgrade/downgrade RPMs..."
972 # Try to upgrade/downgrade RPMS
973 if sudo yum update -y $RPM_LIST | grep "does not update installed package"; then
974 if ! sudo yum downgrade -y $RPM_LIST; then
975 sudo yum remove -y opnfv-apex-undercloud opnfv-apex-common opnfv-apex-opendaylight-sfc opnfv-apex-onos
976 sudo yum downgrade -y $RPM_INSTALL_PATH
983 sudo yum install -y $RPM_LIST;
985 DEPLOY_CMD=opnfv-deploy
986 DEPLOY_FILE="/etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml"
987 NETWORK_FILE="/etc/opnfv-apex/network_settings.yaml"
988 export RESOURCES="/var/opt/opnfv/images"
989 export CONFIG="/var/opt/opnfv"
992 if [ "$OPNFV_CLEAN" == 'yes' ]; then
993 if [[ $BUILD_DIRECTORY == *verify-master* ]]; then
994 sudo CONFIG=../lib ./clean.sh
999 # initiate virtual deployment
1000 echo "Deploy Scenario set to ${DEPLOY_SCENARIO}"
1001 if [ -e $DEPLOY_FILE ]; then
1002 sudo $DEPLOY_CMD -v -d ${DEPLOY_FILE} -n $NETWORK_FILE --debug
1004 echo "File does not exist /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml"
1008 echo "--------------------------------------------------------"
1012 name: 'apex-deploy-baremetal'
1020 # log info to console
1021 echo "Starting the Apex baremetal deployment."
1022 echo "--------------------------------------------------------"
1025 if [[ ! "$ARTIFACT_NAME" == "latest" ]]; then
1026 # if artifact name is passed the pull a
1027 # specific artifact from artifacts.opnfv.org
1028 RPM_INSTALL_PATH=$GS_URL/$ARTIFACT_NAME
1030 if [[ $BUILD_DIRECTORY == *apex-build* ]]; then
1031 BUILD_DIRECTORY=$WORKSPACE/../$BUILD_DIRECTORY
1032 echo "BUILD DIRECTORY modified to $BUILD_DIRECTORY"
1034 if [[ -f ${BUILD_DIRECTORY}/../opnfv.properties ]]; then
1035 # if opnfv.properties exists then use the
1036 # local build. Source the file so we get local OPNFV vars
1037 source ${BUILD_DIRECTORY}/../opnfv.properties
1038 RPM_INSTALL_PATH=${BUILD_DIRECTORY}/$(basename $OPNFV_RPM_URL)
1040 # no opnfv.properties means use the latest from artifacts.opnfv.org
1041 # get the latest.properties to get the link to the latest artifact
1042 curl -s -o $WORKSPACE/opnfv.properties http://$GS_URL/latest.properties
1043 [[ -f opnfv.properties ]] || exit 1
1044 # source the file so we get OPNFV vars
1045 source opnfv.properties
1046 RPM_INSTALL_PATH=$OPNFV_RPM_URL
1050 if [ ! -e "$RPM_INSTALL_PATH" ]; then
1051 RPM_INSTALL_PATH=http://${OPNFV_RPM_URL}
1054 RPM_LIST=$RPM_INSTALL_PATH
1055 for pkg in common undercloud; do
1056 RPM_LIST+=" ${RPM_INSTALL_PATH/opnfv-apex/opnfv-apex-${pkg}}"
1059 # update / install the new rpm
1060 if rpm -q opnfv-apex > /dev/null; then
1061 if [ $(basename $OPNFV_RPM_URL) == $(rpm -q opnfv-apex).rpm ]; then
1062 echo "RPM is already installed"
1063 elif sudo yum update -y $RPM_LIST | grep "does not update installed package"; then
1064 if ! sudo yum downgrade -y $RPM_LIST; then
1065 sudo yum remove -y opnfv-undercloud opnfv-common
1066 sudo yum downgrade -y $RPM_INSTALL_PATH
1070 sudo yum install -y $RPM_LIST;
1073 # cleanup environment before we start
1075 # initiate baremetal deployment
1076 if [ -e /etc/opnfv-apex/network_settings.yaml ]; then
1077 if [ -n "$DEPLOY_SCENARIO" ]; then
1078 echo "Deploy Scenario set to ${DEPLOY_SCENARIO}"
1079 if [ -e /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml ]; then
1080 sudo opnfv-deploy -i /root/inventory/pod_settings.yaml \
1081 -d /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml \
1082 -n /root/network/network_settings.yaml --debug
1084 echo "File does not exist /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml"
1088 echo "Deploy scenario not set!"
1092 echo "File /etc/opnfv-apex/network_settings.yaml does not exist!"
1097 echo "--------------------------------------------------------"
1100 #######################
1102 ########################
1106 - timed: '0 3 * * *'
1108 name: 'apex-brahmaputra'
1110 - timed: '0 3 * * *'
1112 name: 'apex-gs-clean-{stream}'
1114 - timed: '0 2 * * *'