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'
22 branch: 'stable/brahmaputra'
23 gs-pathname: '/brahmaputra'
24 block-stream: 'master'
32 block-stream: 'brahmaputra'
37 branch: 'stable/brahmaputra'
38 gs-pathname: '/brahmaputra'
39 block-stream: 'master'
46 - 'os-nosdn-nofeature-ha'
47 - 'os-odl_l2-nofeature-ha'
48 - 'os-odl_l2-bgpvpn-ha'
49 - 'os-odl_l2-sfc-noha'
50 - 'os-odl_l3-nofeature-ha'
51 - 'os-onos-nofeature-ha'
52 - 'os-opencontrail-nofeature-ha'
60 name: 'apex-verify-{stream2}'
66 gs-pathname: '{gs-pathname}'
73 default: https://gerrit.opnfv.org/gerrit/$PROJECT
74 description: "Used for overriding the GIT URL coming from parameters macro."
78 credentials-id: '{ssh-credentials}'
79 refspec: '$GERRIT_REFSPEC'
80 choosing-strategy: 'gerrit'
85 - patchset-created-event:
86 exclude-drafts: 'false'
87 exclude-trivial-rebase: 'false'
88 exclude-no-code-change: 'true'
89 - draft-published-event
90 - comment-added-contains-event:
91 comment-contains-value: 'recheck'
92 - comment-added-contains-event:
93 comment-contains-value: 'reverify'
95 - project-compare-type: 'ANT'
96 project-pattern: 'apex'
98 - branch-compare-type: 'ANT'
99 branch-pattern: '**/{branch}'
112 use-build-blocker: true
114 - 'apex-daily.*{stream2}'
115 - 'apex-deploy.*{stream2}'
116 - 'apex-build.*{stream2}'
117 - 'apex-runner.*{stream2}'
118 - 'apex-verify-{stream2}'
123 - project: 'apex-deploy-virtual-os-odl_l2-nofeature-ha-{stream2}'
124 predefined-parameters: |
125 BUILD_DIRECTORY=apex-verify-{stream2}/build_output
130 - project: 'apex-deploy-virtual-os-onos-nofeature-ha-{stream2}'
131 predefined-parameters: |
132 BUILD_DIRECTORY=apex-verify-{stream2}/build_output
137 - project: 'apex-deploy-virtual-os-odl_l3-nofeature-ha-{stream2}'
138 predefined-parameters: |
139 BUILD_DIRECTORY=apex-verify-{stream2}/build_output
144 - project: 'apex-deploy-virtual-os-odl_l2-sfc-noha-{stream2}'
145 predefined-parameters: |
146 BUILD_DIRECTORY=apex-verify-{stream2}/build_output
150 - 'apex-workspace-cleanup'
154 name: 'apex-verify-{stream1}'
160 gs-pathname: '{gs-pathname}'
167 default: https://gerrit.opnfv.org/gerrit/$PROJECT
168 description: "Used for overriding the GIT URL coming from parameters macro."
171 - gerrit-trigger-scm:
172 credentials-id: '{ssh-credentials}'
173 refspec: '$GERRIT_REFSPEC'
174 choosing-strategy: 'gerrit'
179 - patchset-created-event:
180 exclude-drafts: 'false'
181 exclude-trivial-rebase: 'false'
182 exclude-no-code-change: 'true'
183 - draft-published-event
184 - comment-added-contains-event:
185 comment-contains-value: 'recheck'
186 - comment-added-contains-event:
187 comment-contains-value: 'reverify'
189 - project-compare-type: 'ANT'
190 project-pattern: 'apex'
192 - branch-compare-type: 'ANT'
193 branch-pattern: '**/{branch}'
206 use-build-blocker: true
208 - 'apex-daily.*{stream1}'
209 - 'apex-deploy.*{stream1}'
210 - 'apex-build.*{stream1}'
211 - 'apex-runner.*{stream1}'
212 - 'apex-verify-{stream1}'
217 - project: 'apex-deploy-virtual-os-nosdn-nofeature-ha-{stream1}'
218 predefined-parameters: |
219 BUILD_DIRECTORY=apex-verify-{stream1}
224 # - project: 'functest-apex-{slave}-suite-{stream1}'
225 # predefined-parameters: |
226 # DEPLOY_SCENARIO=os-nosdn-nofeature-ha
227 # FUNCTEST_SUITE_NAME=vping_userdata
230 - project: 'apex-deploy-virtual-os-odl_l2-nofeature-ha-{stream1}'
231 predefined-parameters: |
232 BUILD_DIRECTORY=apex-verify-{stream1}
236 - 'apex-workspace-cleanup'
239 name: 'apex-runner-{platform}-{scenario}-{stream}'
241 # runner jobs for deploying manually
249 gs-pathname: '{gs-pathname}'
256 default: https://gerrit.opnfv.org/gerrit/$PROJECT
257 description: "Used for overriding the GIT URL coming from parameters macro."
260 - gerrit-trigger-scm:
261 credentials-id: '{ssh-credentials}'
263 choosing-strategy: 'default'
267 use-build-blocker: true
269 - 'apex-daily.*{stream}'
270 - 'apex-verify.*{stream}'
274 - project: 'apex-deploy-{platform}-{scenario}-{stream}'
275 predefined-parameters:
280 - project: 'yardstick-apex-{slave}-daily-{stream}'
281 predefined-parameters:
282 DEPLOY_SCENARIO={scenario}
285 build-step-failure-threshold: 'never'
286 failure-threshold: 'never'
287 unstable-threshold: 'FAILURE'
289 - project: 'functest-apex-{slave}-daily-{stream}'
290 predefined-parameters:
291 DEPLOY_SCENARIO={scenario}
294 build-step-failure-threshold: 'never'
295 failure-threshold: 'never'
296 unstable-threshold: 'FAILURE'
299 name: 'apex-build-{stream}'
301 # Job template for builds
303 # Required Variables:
304 # stream: branch with - in place of / (eg. stable)
305 # branch: branch (eg. stable)
314 gs-pathname: '{gs-pathname}'
319 default: https://gerrit.opnfv.org/gerrit/$PROJECT
320 description: "Used for overriding the GIT URL coming from parameters macro."
324 credentials-id: '{ssh-credentials}'
330 use-build-blocker: true
332 - 'apex-deploy.*{stream}'
337 - project: 'apex-deploy-virtual-os-nosdn-nofeature-ha-{stream}'
338 predefined-parameters: |
339 BUILD_DIRECTORY=apex-build-{stream}/build
343 - 'apex-upload-artifact'
346 name: 'apex-deploy-virtual-{scenario}-{stream}'
348 # Job template for virtual deployment
350 # Required Variables:
351 # stream: branch with - in place of / (eg. stable)
352 # branch: branch (eg. stable)
359 credentials-id: '{ssh-credentials}'
367 gs-pathname: '{gs-pathname}'
369 name: DEPLOY_SCENARIO
370 default: '{scenario}'
371 description: "Scenario to deploy with."
375 description: "Use yes in lower case to invoke clean. Indicates if the deploy environment should be cleaned before deployment"
379 use-build-blocker: true
381 - 'apex-deploy.*{stream}'
384 - 'apex-deploy-virtual'
385 - 'apex-workspace-cleanup'
388 name: 'apex-deploy-baremetal-{scenario}-{stream}'
390 # Job template for baremetal deployment
392 # Required Variables:
393 # stream: branch with - in place of / (eg. stable)
394 # branch: branch (eg. stable)
401 credentials-id: '{ssh-credentials}'
409 gs-pathname: '{gs-pathname}'
411 name: DEPLOY_SCENARIO
412 default: '{scenario}'
413 description: "Scenario to deploy with."
417 use-build-blocker: true
419 - 'apex-verify.*{stream}'
420 - 'apex-deploy.*{stream}'
421 - 'apex-build.*{stream}'
425 - 'apex-deploy-baremetal'
426 - 'apex-workspace-cleanup'
430 name: 'apex-daily-{stream2}'
432 # Job template for daily build
434 # Required Variables:
435 # stream: branch with - in place of / (eg. stable)
436 # branch: branch (eg. stable)
443 credentials-id: '{ssh-credentials}'
451 gs-pathname: '{gs-pathname}'
455 use-build-blocker: true
457 - 'apex-verify.*{stream2}'
458 - 'apex-deploy.*{stream2}'
459 - 'apex-build.*{stream2}'
460 - 'apex-runner.*{stream2}'
467 - project: 'apex-build-{stream2}'
469 current-parameters: true
472 - project: 'apex-deploy-baremetal-os-odl_l2-nofeature-ha-{stream2}'
473 predefined-parameters: |
474 BUILD_DIRECTORY=apex-build-{stream2}/build_output
479 - project: 'functest-apex-{slave}-daily-{stream2}'
480 predefined-parameters:
481 DEPLOY_SCENARIO=os-odl_l2-nofeature-ha
484 build-step-failure-threshold: 'never'
485 failure-threshold: 'never'
486 unstable-threshold: 'FAILURE'
488 - project: 'yardstick-apex-{slave}-daily-{stream2}'
489 predefined-parameters:
490 DEPLOY_SCENARIO=os-odl_l2-nofeature-ha
493 build-step-failure-threshold: 'never'
494 failure-threshold: 'never'
495 unstable-threshold: 'FAILURE'
497 - project: 'apex-deploy-baremetal-os-onos-nofeature-ha-{stream2}'
498 predefined-parameters:
499 BUILD_DIRECTORY=apex-build-{stream2}/build_output
503 - project: 'functest-apex-{slave}-daily-{stream2}'
504 predefined-parameters:
505 DEPLOY_SCENARIO=os-onos-nofeature-ha
508 build-step-failure-threshold: 'never'
509 failure-threshold: 'never'
510 unstable-threshold: 'FAILURE'
512 - project: 'yardstick-apex-{slave}-daily-{stream2}'
513 predefined-parameters:
514 DEPLOY_SCENARIO=os-onos-nofeature-ha
517 build-step-failure-threshold: 'never'
518 failure-threshold: 'never'
519 unstable-threshold: 'FAILURE'
521 - project: 'apex-deploy-baremetal-os-odl_l3-nofeature-ha-{stream2}'
522 predefined-parameters:
523 BUILD_DIRECTORY=apex-build-{stream2}/build_output
527 - project: 'functest-apex-{slave}-daily-{stream2}'
528 predefined-parameters:
529 DEPLOY_SCENARIO=os-odl_l3-nofeature-ha
532 build-step-failure-threshold: 'never'
533 failure-threshold: 'never'
534 unstable-threshold: 'FAILURE'
536 - project: 'yardstick-apex-{slave}-daily-{stream2}'
537 predefined-parameters:
538 DEPLOY_SCENARIO=os-odl_l3-nofeature-ha
541 build-step-failure-threshold: 'never'
542 failure-threshold: 'never'
543 unstable-threshold: 'FAILURE'
545 - project: 'apex-deploy-baremetal-os-odl_l2-bgpvpn-ha-{stream2}'
546 predefined-parameters:
547 BUILD_DIRECTORY=apex-build-{stream2}/build_output
551 - project: 'functest-apex-{slave}-daily-{stream2}'
552 predefined-parameters:
553 DEPLOY_SCENARIO=os-odl_l2-bgpvpn-ha
556 build-step-failure-threshold: 'never'
557 failure-threshold: 'never'
558 unstable-threshold: 'FAILURE'
560 - project: 'yardstick-apex-{slave}-daily-{stream2}'
561 predefined-parameters:
562 DEPLOY_SCENARIO=os-odl_l2-bgpvpn-ha
565 build-step-failure-threshold: 'never'
566 failure-threshold: 'never'
567 unstable-threshold: 'FAILURE'
571 name: 'apex-daily-{stream1}'
573 # Job template for daily build
575 # Required Variables:
576 # stream: branch with - in place of / (eg. stable)
577 # branch: branch (eg. stable)
584 credentials-id: '{ssh-credentials}'
592 gs-pathname: '{gs-pathname}'
596 use-build-blocker: true
598 - 'apex-verify.*{stream1}'
599 - 'apex-deploy.*{stream1}'
600 - 'apex-build.*{stream1}'
601 - 'apex-runner.*{stream1}'
608 - project: 'apex-build-{stream1}'
610 current-parameters: true
613 - project: 'apex-deploy-virtual-nosdn-nofeature-ha-{stream1}'
614 predefined-parameters: |
615 BUILD_DIRECTORY=apex-build-{stream1}/build
620 - project: 'functest-apex-{slave}-daily-{stream1}'
621 predefined-parameters:
622 DEPLOY_SCENARIO=os-nosdn-nofeature-ha
625 build-step-failure-threshold: 'never'
626 failure-threshold: 'never'
627 unstable-threshold: 'FAILURE'
629 - project: 'yardstick-apex-{slave}-daily-{stream1}'
630 predefined-parameters:
631 DEPLOY_SCENARIO=os-nosdn-nofeature-ha
634 build-step-failure-threshold: 'never'
635 failure-threshold: 'never'
636 unstable-threshold: 'FAILURE'
639 name: 'apex-gs-clean-{stream}'
641 # Job template for clean
643 # Required Variables:
644 # stream: branch with - in place of / (eg. stable)
653 gs-pathname: '{gs-pathname}'
659 - 'apex-gs-clean-{stream}'
662 ########################
664 ########################
671 description: "RPM Artifact name that will be appended to GS_URL to deploy a specific artifact"
673 name: ARTIFACT_VERSION
675 description: "Artifact version type"
677 name: BUILD_DIRECTORY
678 default: $WORKSPACE/build
679 description: "Directory where the build artifact will be located upon the completion of the build."
681 name: CACHE_DIRECTORY
682 default: $HOME/opnfv/cache{gs-pathname}
683 description: "Directory where the cache to be used during the build is located."
686 default: https://gerrit.opnfv.org/gerrit/$PROJECT
687 description: "Used for overriding the GIT URL coming from Global Jenkins configuration in case if the stuff is done on none-LF HW."
690 default: artifacts.opnfv.org/$PROJECT{gs-pathname}
691 description: "URL to Google Storage."
693 ########################
695 ########################
704 # log info to console
705 echo "Starting the build of Apex using OpenStack Master packages. This will take some time..."
706 echo "---------------------------------------------------------------------------------------"
708 # create the cache directory if it doesn't exist
709 [[ -d $CACHE_DIRECTORY ]] || mkdir -p $CACHE_DIRECTORY
710 # set OPNFV_ARTIFACT_VERSION
711 if echo $BUILD_TAG | grep "apex-verify" 1> /dev/null; then
712 if echo $GERRIT_BRANCH | grep "brahmaputra" 1> /dev/null; then
713 export OPNFV_ARTIFACT_VERSION=brahmaputra-dev${BUILD_NUMBER}
714 export BUILD_ARGS="-v $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY $BUILD_DIRECTORY"
716 export OPNFV_ARTIFACT_VERSION=dev${BUILD_NUMBER}
717 export BUILD_ARGS="-r $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY"
719 elif [ "$ARTIFACT_VERSION" == "daily" ]; then
720 if echo $GERRIT_BRANCH | grep "brahmaputra" 1> /dev/null; then
721 export OPNFV_ARTIFACT_VERSION=brahmaputra-$(date -u +"%Y-%m-%d")
722 export BUILD_ARGS="-v $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY $BUILD_DIRECTORY"
724 export OPNFV_ARTIFACT_VERSION=$(date -u +"%Y-%m-%d")
725 export BUILD_ARGS="-r $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY --iso"
728 export OPNFV_ARTIFACT_VERSION=${ARTIFACT_VERSION}
729 if echo $GERRIT_BRANCH | grep "brahmaputra" 1> /dev/null; then
730 export BUILD_ARGS="-v $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY $BUILD_DIRECTORY"
732 export BUILD_ARGS="-r $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY --iso"
735 # clean for stable but doesn't matter for master
736 if echo $GERRIT_BRANCH | grep "brahmaputra" 1> /dev/null; then
741 ./build.sh $BUILD_ARGS
742 RPM_VERSION=$(grep Version: $BUILD_DIRECTORY/opnfv-apex.spec | awk '{ print $2 }')-$(echo $OPNFV_ARTIFACT_VERSION | tr -d '_-')
743 # list the contents of BUILD_OUTPUT directory
744 ls -al $BUILD_DIRECTORY
745 # save information regarding artifact into file
747 echo "OPNFV_ARTIFACT_VERSION=$OPNFV_ARTIFACT_VERSION"
748 echo "OPNFV_GIT_URL=$(git config --get remote.origin.url)"
749 echo "OPNFV_GIT_SHA1=$(git rev-parse HEAD)"
750 echo "OPNFV_ARTIFACT_URL=$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
751 echo "OPNFV_ARTIFACT_MD5SUM=$(md5sum $BUILD_DIRECTORY/release/OPNFV-CentOS-7-x86_64-$OPNFV_ARTIFACT_VERSION.iso | cut -d' ' -f1)"
752 echo "OPNFV_SRPM_URL=$GS_URL/opnfv-apex-$RPM_VERSION.src.rpm"
753 echo "OPNFV_RPM_URL=$GS_URL/opnfv-apex-$RPM_VERSION.noarch.rpm"
754 echo "OPNFV_RPM_MD5SUM=$(md5sum $BUILD_DIRECTORY/noarch/opnfv-apex-$RPM_VERSION.noarch.rpm | cut -d' ' -f1)"
755 echo "OPNFV_BUILD_URL=$BUILD_URL"
756 ) > $WORKSPACE/opnfv.properties
757 echo "--------------------------------------------------------"
761 name: 'apex-workspace-cleanup'
769 # delete everything that is in $WORKSPACE
770 sudo /bin/rm -rf $WORKSPACE
773 name: 'apex-upload-artifact'
781 # log info to console
782 echo "Uploading the Apex artifact. This could take some time..."
783 echo "--------------------------------------------------------"
786 # source the opnfv.properties to get ARTIFACT_VERSION
787 source $WORKSPACE/opnfv.properties
789 # upload artifact and additional files to google storage
790 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
791 RPM_INSTALL_PATH=$BUILD_DIRECTORY/noarch
792 RPM_LIST=$RPM_INSTALL_PATH/$(basename $OPNFV_RPM_URL)
793 VERSION_EXTENSION=$(echo $(basename $OPNFV_RPM_URL) | sed 's/opnfv-apex-//')
794 for pkg in common undercloud opendaylight-sfc onos; do
795 RPM_LIST+=" ${RPM_INSTALL_PATH}/opnfv-apex-${pkg}-${VERSION_EXTENSION}"
797 SRPM_INSTALL_PATH=$BUILD_DIRECTORY
798 SRPM_LIST=$SRPM_INSTALL_PATH/$(basename $OPNFV_SRPM_URL)
799 for pkg in common undercloud opendaylight-sfc onos; do
800 SRPM_LIST+=" ${SRPM_INSTALL_PATH}/opnfv-apex-${pkg}-${VERSION_EXTENSION}"
802 for artifact in $RPM_LIST $SRPM_LIST; do
803 gsutil cp $artifact gs://$GS_URL/$(basename $artifact) > gsutil.iso.log 2>&1
805 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.properties > gsutil.properties.log 2>&1
806 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/latest.properties > gsutil.latest.log 2>&1
809 echo "--------------------------------------------------------"
811 echo "ISO Artifact is available as http://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
812 echo "RPM Artifact is available as http://$GS_URL/$(basename $OPNFV_RPM_URL)"
815 name: 'apex-gs-cleanup'
823 # log info to console
824 echo "Cleaning Google Storage"
825 echo "-----------------------"
828 thirty_days_ago=$(date -d "30 days ago" +"%Y%m%d")
830 for i in $(gsutil ls gs://$GS_URL/*201?*); do
831 filedate=$(date -d "$(echo $i | grep -Eo 201[0-9]-?[0-9][0-9]-?[0-9][0-9])" +"%Y%m%d")
832 if [ $filedate -lt $thirty_days_ago ]; then
833 # gsutil indicates what it is removing so no need for output here
839 name: 'apex-deploy-virtual'
847 # log info to console
848 echo "Starting the Apex virtual deployment."
849 echo "--------------------------------------------------------"
852 if [[ $BUILD_DIRECTORY == *verify-master* ]]; then
853 cd $WORKSPACE/../${BUILD_DIRECTORY/build_output/}
855 echo "WORKSPACE modified to $WORKSPACE"
857 elif [[ ! "$ARTIFACT_NAME" == "latest" ]]; then
858 # if artifact name is passed the pull a
859 # specific artifact from artifacts.opnfv.org
860 RPM_INSTALL_PATH=$GS_URL
861 RPM_LIST=$RPM_INSTALL_PATH/$ARTIFACT_NAME
863 if [[ $BUILD_DIRECTORY == *verify* ]]; then
864 BUILD_DIRECTORY=$WORKSPACE/../$BUILD_DIRECTORY
865 echo "BUILD DIRECTORY modified to $BUILD_DIRECTORY"
866 elif [[ $BUILD_DIRECTORY == *apex-build* ]]; then
867 BUILD_DIRECTORY=$WORKSPACE/../$BUILD_DIRECTORY
868 echo "BUILD DIRECTORY modified to $BUILD_DIRECTORY"
871 if [[ -f ${BUILD_DIRECTORY}/../opnfv.properties ]]; then
872 # if opnfv.properties exists then use the
873 # local build. Source the file so we get local OPNFV vars
874 source ${BUILD_DIRECTORY}/../opnfv.properties
875 RPM_INSTALL_PATH=${BUILD_DIRECTORY}/noarch
876 RPM_LIST=$RPM_INSTALL_PATH/$(basename $OPNFV_RPM_URL)
878 if [[ $BUILD_DIRECTORY == *verify* ]]; then
879 echo "BUILD_DIRECTORY is from a verify job, so will not use latest from URL"
880 echo "Check that the slave has opnfv.properties in $BUILD_DIRECTORY"
882 elif [[ $BUILD_DIRECTORY == *apex-build* ]]; then
883 echo "BUILD_DIRECTORY is from a daily job, so will not use latest from URL"
884 echo "Check that the slave has opnfv.properties in $BUILD_DIRECTORY"
887 # no opnfv.properties means use the latest from artifacts.opnfv.org
888 # get the latest.properties to get the link to the latest artifact
889 curl -s -o $WORKSPACE/opnfv.properties http://$GS_URL/latest.properties
890 [[ -f opnfv.properties ]] || exit 1
891 # source the file so we get OPNFV vars
892 source opnfv.properties
893 RPM_INSTALL_PATH=$(echo $OPNFV_RPM_URL | sed 's/'"$(basename $OPNFV_RPM_URL)"'//')
894 RPM_LIST=$RPM_INSTALL_PATH/$(basename $OPNFV_RPM_URL)
898 if [ -z "$DEPLOY_SCENARIO" ]; then
899 echo "Deploy scenario not set!"
903 # use local build for verify
904 if [[ $BUILD_DIRECTORY == *verify-master* ]]; then
905 if [ ! -e "${WORKSPACE}/build/lib" ]; then ln -s ${WORKSPACE}/lib ${WORKSPACE}/build/lib; fi
906 DEPLOY_CMD="CONFIG=${WORKSPACE}/build RESOURCES=${WORKSPACE}/build/images/ ./deploy.sh -c ${WORKSPACE}/build -r ${WORKSPACE}/build/images/"
907 DEPLOY_FILE="${WORKSPACE}/config/deploy/${DEPLOY_SCENARIO}.yaml"
908 NETWORK_FILE="${WORKSPACE}/config/network/network_settings.yaml"
909 # Make sure python34 is installed
910 if ! rpm -q python34 > /dev/null; then
911 sudo yum install -y epel-release
912 if ! sudo yum install -y python34; then
913 echo "Failed to install python34"
917 if ! rpm -q python34-PyYAML > /dev/null; then
918 sudo yum install -y epel-release
919 if ! sudo yum install -y python34-PyYAML; then
920 echo "Failed to install python34-PyYAML"
924 if ! rpm -q python34-setuptools > /dev/null; then
925 if ! sudo yum install -y python34-setuptools; then
926 echo "Failed to install python34-setuptools"
930 if [ -z ${PYTHONPATH:-} ]; then
931 export PYTHONPATH=${WORKSPACE}/lib/python
933 export PYTHONPATH=$PYTHONPATH:${WORKSPACE}/lib/python
936 VERSION_EXTENSION=$(echo $(basename $RPM_LIST) | sed 's/opnfv-apex-//')
937 for pkg in common undercloud opendaylight-sfc onos; do
938 RPM_LIST+=" ${RPM_INSTALL_PATH}/opnfv-apex-${pkg}-${VERSION_EXTENSION}"
941 # update / install the new rpm
942 if rpm -q opnfv-apex > /dev/null; then
943 INSTALLED_RPMS=$(rpm -qa | grep apex)
944 for x in $INSTALLED_RPMS; do
945 INSTALLED_RPM_VER=$(echo $x | sed 's/opnfv-apex-//').rpm
946 # Does each RPM's version match the version required for deployment
947 if [ "$INSTALLED_RPM_VER" == "$VERSION_EXTENSION" ]; then
948 echo "RPM $x is already installed"
950 echo "RPM $x does not match $VERSION_EXTENSION"
951 echo "Will upgrade/downgrade RPMs..."
952 # Try to upgrade/downgrade RPMS
953 if sudo yum update -y $RPM_LIST | grep "does not update installed package"; then
954 if ! sudo yum downgrade -y $RPM_LIST; then
955 sudo yum remove -y opnfv-apex-undercloud opnfv-apex-common opnfv-apex-opendaylight-sfc opnfv-apex-onos
956 sudo yum downgrade -y $RPM_INSTALL_PATH
963 sudo yum install -y $RPM_LIST;
965 DEPLOY_CMD=opnfv-deploy
966 DEPLOY_FILE="/etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml"
967 NETWORK_FILE="/etc/opnfv-apex/network_settings.yaml"
968 export RESOURCES="/var/opt/opnfv/images"
969 export CONFIG="/var/opt/opnfv"
972 if [ "$OPNFV_CLEAN" == 'yes' ]; then
973 if [[ $BUILD_DIRECTORY == *verify-master* ]]; then
974 sudo CONFIG=../lib ./clean.sh
979 # initiate virtual deployment
980 echo "Deploy Scenario set to ${DEPLOY_SCENARIO}"
981 if [ -e $DEPLOY_FILE ]; then
982 sudo $DEPLOY_CMD -v -d ${DEPLOY_FILE} -n $NETWORK_FILE --debug
984 echo "File does not exist /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml"
988 echo "--------------------------------------------------------"
992 name: 'apex-deploy-baremetal'
1000 # log info to console
1001 echo "Starting the Apex baremetal deployment."
1002 echo "--------------------------------------------------------"
1005 if [[ ! "$ARTIFACT_NAME" == "latest" ]]; then
1006 # if artifact name is passed the pull a
1007 # specific artifact from artifacts.opnfv.org
1008 RPM_INSTALL_PATH=$GS_URL/$ARTIFACT_NAME
1010 if [[ $BUILD_DIRECTORY == *apex-build* ]]; then
1011 BUILD_DIRECTORY=$WORKSPACE/../$BUILD_DIRECTORY
1012 echo "BUILD DIRECTORY modified to $BUILD_DIRECTORY"
1014 if [[ -f ${BUILD_DIRECTORY}/../opnfv.properties ]]; then
1015 # if opnfv.properties exists then use the
1016 # local build. Source the file so we get local OPNFV vars
1017 source ${BUILD_DIRECTORY}/../opnfv.properties
1018 RPM_INSTALL_PATH=${BUILD_DIRECTORY}/$(basename $OPNFV_RPM_URL)
1020 # no opnfv.properties means use the latest from artifacts.opnfv.org
1021 # get the latest.properties to get the link to the latest artifact
1022 curl -s -o $WORKSPACE/opnfv.properties http://$GS_URL/latest.properties
1023 [[ -f opnfv.properties ]] || exit 1
1024 # source the file so we get OPNFV vars
1025 source opnfv.properties
1026 RPM_INSTALL_PATH=$OPNFV_RPM_URL
1030 if [ ! -e "$RPM_INSTALL_PATH" ]; then
1031 RPM_INSTALL_PATH=http://${OPNFV_RPM_URL}
1034 RPM_LIST=$RPM_INSTALL_PATH
1035 for pkg in common undercloud; do
1036 RPM_LIST+=" ${RPM_INSTALL_PATH/opnfv-apex/opnfv-apex-${pkg}}"
1039 # update / install the new rpm
1040 if rpm -q opnfv-apex > /dev/null; then
1041 if [ $(basename $OPNFV_RPM_URL) == $(rpm -q opnfv-apex).rpm ]; then
1042 echo "RPM is already installed"
1043 elif sudo yum update -y $RPM_LIST | grep "does not update installed package"; then
1044 if ! sudo yum downgrade -y $RPM_LIST; then
1045 sudo yum remove -y opnfv-undercloud opnfv-common
1046 sudo yum downgrade -y $RPM_INSTALL_PATH
1050 sudo yum install -y $RPM_LIST;
1053 # cleanup environment before we start
1055 # initiate baremetal deployment
1056 if [ -e /etc/opnfv-apex/network_settings.yaml ]; then
1057 if [ -n "$DEPLOY_SCENARIO" ]; then
1058 echo "Deploy Scenario set to ${DEPLOY_SCENARIO}"
1059 if [ -e /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml ]; then
1060 sudo opnfv-deploy -i /root/inventory/pod_settings.yaml \
1061 -d /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml \
1062 -n /root/network/network_settings.yaml --debug
1064 echo "File does not exist /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml"
1068 echo "Deploy scenario not set!"
1072 echo "File /etc/opnfv-apex/network_settings.yaml does not exist!"
1077 echo "--------------------------------------------------------"
1080 #######################
1082 ########################
1086 - timed: '0 3 * * *'
1088 name: 'apex-brahmaputra'
1090 - timed: '0 3 * * *'
1092 name: 'apex-gs-clean-{stream}'
1094 - timed: '0 2 * * *'