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}
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}
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_output
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/build/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/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/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/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/$(basename $OPNFV_RPM_URL)
792 RPM_LIST=$RPM_INSTALL_PATH
793 for pkg in common undercloud opendaylight-sfc; do
794 RPM_LIST+=" ${RPM_INSTALL_PATH/opnfv-apex/opnfv-apex-${pkg}}"
796 SRPM_INSTALL_PATH=$BUILD_DIRECTORY/$(basename $OPNFV_SRPM_URL)
797 SRPM_LIST=$SRPM_INSTALL_PATH
798 for pkg in common undercloud opendaylight-sfc; do
799 SRPM_LIST+=" ${SRPM_INSTALL_PATH/opnfv-apex/opnfv-apex-${pkg}}"
801 for artifact in $RPM_LIST $SRPM_LIST; do
802 gsutil cp $artifact gs://$GS_URL/$(basename $artifact) > gsutil.iso.log 2>&1
804 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.properties > gsutil.properties.log 2>&1
805 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/latest.properties > gsutil.latest.log 2>&1
808 echo "--------------------------------------------------------"
810 echo "ISO Artifact is available as http://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
811 echo "RPM Artifact is available as http://$GS_URL/$(basename $OPNFV_RPM_URL)"
814 name: 'apex-gs-cleanup'
822 # log info to console
823 echo "Cleaning Google Storage"
824 echo "-----------------------"
827 thirty_days_ago=$(date -d "30 days ago" +"%Y%m%d")
829 for i in $(gsutil ls gs://$GS_URL/*201?*); do
830 filedate=$(date -d "$(echo $i | grep -Eo 201[0-9]-?[0-9][0-9]-?[0-9][0-9])" +"%Y%m%d")
831 if [ $filedate -lt $thirty_days_ago ]; then
832 # gsutil indicates what it is removing so no need for output here
838 name: 'apex-deploy-virtual'
846 # log info to console
847 echo "Starting the Apex virtual deployment."
848 echo "--------------------------------------------------------"
851 if [[ $BUILD_DIRECTORY == *verify-master* ]]; then
852 cd $WORKSPACE/../${BUILD_DIRECTORY/build_output/}
854 echo "WORKSPACE modified to $WORKSPACE"
856 elif [[ ! "$ARTIFACT_NAME" == "latest" ]]; then
857 # if artifact name is passed the pull a
858 # specific artifact from artifacts.opnfv.org
859 RPM_INSTALL_PATH=$GS_URL/$ARTIFACT_NAME
861 if [[ $BUILD_DIRECTORY == *verify* ]]; then
862 BUILD_DIRECTORY=$WORKSPACE/../$BUILD_DIRECTORY
863 echo "BUILD DIRECTORY modified to $BUILD_DIRECTORY"
864 elif [[ $BUILD_DIRECTORY == *apex-build* ]]; then
865 BUILD_DIRECTORY=$WORKSPACE/../$BUILD_DIRECTORY
866 echo "BUILD DIRECTORY modified to $BUILD_DIRECTORY"
869 if [[ -f ${BUILD_DIRECTORY}/opnfv.properties ]]; then
870 # if opnfv.properties exists then use the
871 # local build. Source the file so we get local OPNFV vars
872 source ${BUILD_DIRECTORY}/opnfv.properties
873 RPM_INSTALL_PATH=${BUILD_DIRECTORY}/$(basename $OPNFV_RPM_URL)
875 if [[ $BUILD_DIRECTORY == *verify* ]]; then
876 echo "BUILD_DIRECTORY is from a verify job, so will not use latest from URL"
877 echo "Check that the slave has opnfv.properties in $BUILD_DIRECTORY"
879 elif [[ $BUILD_DIRECTORY == *apex-build* ]]; then
880 echo "BUILD_DIRECTORY is from a daily job, so will not use latest from URL"
881 echo "Check that the slave has opnfv.properties in $BUILD_DIRECTORY"
884 # no opnfv.properties means use the latest from artifacts.opnfv.org
885 # get the latest.properties to get the link to the latest artifact
886 curl -s -o $WORKSPACE/opnfv.properties http://$GS_URL/latest.properties
887 [[ -f opnfv.properties ]] || exit 1
888 # source the file so we get OPNFV vars
889 source opnfv.properties
890 RPM_INSTALL_PATH=$OPNFV_RPM_URL
894 if [ -z "$DEPLOY_SCENARIO" ]; then
895 echo "Deploy scenario not set!"
899 # use local build for verify
900 if [[ $BUILD_DIRECTORY == *verify-master* ]]; then
901 if [ ! -e "${WORKSPACE}/build/lib" ]; then ln -s ${WORKSPACE}/lib ${WORKSPACE}/build/lib; fi
902 DEPLOY_CMD="CONFIG=${WORKSPACE}/build RESOURCES=${WORKSPACE}/build/images/ ./deploy.sh -c ${WORKSPACE}/build -r ${WORKSPACE}/build/images/"
903 DEPLOY_FILE="${WORKSPACE}/config/deploy/${DEPLOY_SCENARIO}.yaml"
904 NETWORK_FILE="${WORKSPACE}/config/network/network_settings.yaml"
905 # Make sure python34 is installed
906 if ! rpm -q python34 > /dev/null; then
907 sudo yum install -y epel-release
908 if ! sudo yum install -y python34; then
909 echo "Failed to install python34"
913 if ! rpm -q python34-PyYAML > /dev/null; then
914 sudo yum install -y epel-release
915 if ! sudo yum install -y python34-PyYAML; then
916 echo "Failed to install python34-PyYAML"
920 if [ -z ${PYTHONPATH:-} ]; then
921 export PYTHONPATH=${WORKSPACE}/lib/python
923 export PYTHONPATH=$PYTHONPATH:${WORKSPACE}/lib/python
926 RPM_LIST=$RPM_INSTALL_PATH
927 for pkg in common undercloud opendaylight-sfc; do
928 RPM_LIST+=" ${RPM_INSTALL_PATH/opnfv-apex/opnfv-apex-${pkg}}"
931 # update / install the new rpm
932 if rpm -q opnfv-apex > /dev/null; then
933 if [ $(basename $OPNFV_RPM_URL) == $(rpm -q opnfv-apex).rpm ]; then
934 echo "RPM is already installed"
935 elif sudo yum update -y $RPM_LIST | grep "does not update installed package"; then
936 if ! sudo yum downgrade -y $RPM_LIST; then
937 sudo yum remove -y opnfv-undercloud opnfv-common
938 sudo yum downgrade -y $RPM_INSTALL_PATH
942 sudo yum install -y $RPM_LIST;
944 DEPLOY_CMD=opnfv-deploy
945 DEPLOY_FILE="/etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml"
946 NETWORK_FILE="/etc/opnfv-apex/network_settings.yaml"
949 if [ "$OPNFV_CLEAN" == 'yes' ]; then
950 if [[ $BUILD_DIRECTORY == *verify-master* ]]; then
951 sudo CONFIG=../lib ./clean.sh
956 # initiate virtual deployment
957 echo "Deploy Scenario set to ${DEPLOY_SCENARIO}"
958 if [ -e $DEPLOY_FILE ]; then
959 sudo $DEPLOY_CMD -v -d ${DEPLOY_FILE} -n $NETWORK_FILE --debug
961 echo "File does not exist /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml"
965 echo "--------------------------------------------------------"
969 name: 'apex-deploy-baremetal'
977 # log info to console
978 echo "Starting the Apex baremetal deployment."
979 echo "--------------------------------------------------------"
982 if [[ ! "$ARTIFACT_NAME" == "latest" ]]; then
983 # if artifact name is passed the pull a
984 # specific artifact from artifacts.opnfv.org
985 RPM_INSTALL_PATH=$GS_URL/$ARTIFACT_NAME
987 if [[ $BUILD_DIRECTORY == *apex-build* ]]; then
988 BUILD_DIRECTORY=$WORKSPACE/../$BUILD_DIRECTORY
989 echo "BUILD DIRECTORY modified to $BUILD_DIRECTORY"
991 if [[ -f ${BUILD_DIRECTORY}/../opnfv.properties ]]; then
992 # if opnfv.properties exists then use the
993 # local build. Source the file so we get local OPNFV vars
994 source ${BUILD_DIRECTORY}/../opnfv.properties
995 RPM_INSTALL_PATH=${BUILD_DIRECTORY}/$(basename $OPNFV_RPM_URL)
997 # no opnfv.properties means use the latest from artifacts.opnfv.org
998 # get the latest.properties to get the link to the latest artifact
999 curl -s -o $WORKSPACE/opnfv.properties http://$GS_URL/latest.properties
1000 [[ -f opnfv.properties ]] || exit 1
1001 # source the file so we get OPNFV vars
1002 source opnfv.properties
1003 RPM_INSTALL_PATH=$OPNFV_RPM_URL
1007 if [ ! -e "$RPM_INSTALL_PATH" ]; then
1008 RPM_INSTALL_PATH=http://${OPNFV_RPM_URL}
1011 RPM_LIST=$RPM_INSTALL_PATH
1012 for pkg in common undercloud; do
1013 RPM_LIST+=" ${RPM_INSTALL_PATH/opnfv-apex/opnfv-apex-${pkg}}"
1016 # update / install the new rpm
1017 if rpm -q opnfv-apex > /dev/null; then
1018 if [ $(basename $OPNFV_RPM_URL) == $(rpm -q opnfv-apex).rpm ]; then
1019 echo "RPM is already installed"
1020 elif sudo yum update -y $RPM_LIST | grep "does not update installed package"; then
1021 if ! sudo yum downgrade -y $RPM_LIST; then
1022 sudo yum remove -y opnfv-undercloud opnfv-common
1023 sudo yum downgrade -y $RPM_INSTALL_PATH
1027 sudo yum install -y $RPM_LIST;
1030 # cleanup environment before we start
1032 # initiate baremetal deployment
1033 if [ -e /etc/opnfv-apex/network_settings.yaml ]; then
1034 if [ -n "$DEPLOY_SCENARIO" ]; then
1035 echo "Deploy Scenario set to ${DEPLOY_SCENARIO}"
1036 if [ -e /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml ]; then
1037 sudo opnfv-deploy -i /root/inventory/pod_settings.yaml \
1038 -d /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml \
1039 -n /root/network/network_settings.yaml --debug
1041 echo "File does not exist /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml"
1045 echo "Deploy scenario not set!"
1049 echo "File /etc/opnfv-apex/network_settings.yaml does not exist!"
1054 echo "--------------------------------------------------------"
1057 #######################
1059 ########################
1063 - timed: '0 3 * * *'
1065 name: 'apex-brahmaputra'
1067 - timed: '0 3 * * *'
1069 name: 'apex-gs-clean-{stream}'
1071 - timed: '0 2 * * *'