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}/build_output
223 - 'apex-workspace-cleanup'
226 name: 'apex-runner-{platform}-{scenario}-{stream}'
228 # runner jobs for deploying manually
236 gs-pathname: '{gs-pathname}'
243 default: https://gerrit.opnfv.org/gerrit/$PROJECT
244 description: "Used for overriding the GIT URL coming from parameters macro."
247 - gerrit-trigger-scm:
248 credentials-id: '{ssh-credentials}'
250 choosing-strategy: 'default'
254 use-build-blocker: true
256 - 'apex-daily.*{stream}'
257 - 'apex-verify.*{stream}'
261 - project: 'apex-deploy-{platform}-{scenario}-{stream}'
262 predefined-parameters:
267 - project: 'yardstick-apex-{slave}-daily-{stream}'
268 predefined-parameters:
269 DEPLOY_SCENARIO={scenario}
272 build-step-failure-threshold: 'never'
273 failure-threshold: 'never'
274 unstable-threshold: 'FAILURE'
276 - project: 'functest-apex-{slave}-daily-{stream}'
277 predefined-parameters:
278 DEPLOY_SCENARIO={scenario}
281 build-step-failure-threshold: 'never'
282 failure-threshold: 'never'
283 unstable-threshold: 'FAILURE'
286 name: 'apex-build-{stream}'
288 # Job template for builds
290 # Required Variables:
291 # stream: branch with - in place of / (eg. stable)
292 # branch: branch (eg. stable)
301 gs-pathname: '{gs-pathname}'
306 default: https://gerrit.opnfv.org/gerrit/$PROJECT
307 description: "Used for overriding the GIT URL coming from parameters macro."
311 credentials-id: '{ssh-credentials}'
317 use-build-blocker: true
319 - 'apex-deploy.*{stream}'
324 - project: 'apex-deploy-virtual-os-nosdn-nofeature-ha-{stream}'
325 predefined-parameters: |
326 BUILD_DIRECTORY=apex-build-{stream}/build_output
330 - 'apex-upload-artifact'
333 name: 'apex-deploy-virtual-{scenario}-{stream}'
335 # Job template for virtual deployment
337 # Required Variables:
338 # stream: branch with - in place of / (eg. stable)
339 # branch: branch (eg. stable)
346 credentials-id: '{ssh-credentials}'
354 gs-pathname: '{gs-pathname}'
356 name: DEPLOY_SCENARIO
357 default: '{scenario}'
358 description: "Scenario to deploy with."
362 description: "Use yes in lower case to invoke clean. Indicates if the deploy environment should be cleaned before deployment"
366 use-build-blocker: true
368 - 'apex-deploy.*{stream}'
371 - 'apex-deploy-virtual'
372 - 'apex-workspace-cleanup'
375 name: 'apex-deploy-baremetal-{scenario}-{stream}'
377 # Job template for baremetal deployment
379 # Required Variables:
380 # stream: branch with - in place of / (eg. stable)
381 # branch: branch (eg. stable)
388 credentials-id: '{ssh-credentials}'
396 gs-pathname: '{gs-pathname}'
398 name: DEPLOY_SCENARIO
399 default: '{scenario}'
400 description: "Scenario to deploy with."
404 use-build-blocker: true
406 - 'apex-verify.*{stream}'
407 - 'apex-deploy.*{stream}'
408 - 'apex-build.*{stream}'
412 - 'apex-deploy-baremetal'
413 - 'apex-workspace-cleanup'
417 name: 'apex-daily-{stream2}'
419 # Job template for daily build
421 # Required Variables:
422 # stream: branch with - in place of / (eg. stable)
423 # branch: branch (eg. stable)
430 credentials-id: '{ssh-credentials}'
438 gs-pathname: '{gs-pathname}'
442 use-build-blocker: true
444 - 'apex-verify.*{stream2}'
445 - 'apex-deploy.*{stream2}'
446 - 'apex-build.*{stream2}'
447 - 'apex-runner.*{stream2}'
454 - project: 'apex-build-{stream2}'
456 current-parameters: true
459 - project: 'apex-deploy-baremetal-os-odl_l2-nofeature-ha-{stream2}'
460 predefined-parameters: |
461 BUILD_DIRECTORY=apex-build-{stream2}/build_output
466 - project: 'functest-apex-{slave}-daily-{stream2}'
467 predefined-parameters:
468 DEPLOY_SCENARIO=os-odl_l2-nofeature-ha
471 build-step-failure-threshold: 'never'
472 failure-threshold: 'never'
473 unstable-threshold: 'FAILURE'
475 - project: 'yardstick-apex-{slave}-daily-{stream2}'
476 predefined-parameters:
477 DEPLOY_SCENARIO=os-odl_l2-nofeature-ha
480 build-step-failure-threshold: 'never'
481 failure-threshold: 'never'
482 unstable-threshold: 'FAILURE'
484 - project: 'apex-deploy-baremetal-os-onos-nofeature-ha-{stream2}'
485 predefined-parameters:
486 BUILD_DIRECTORY=apex-build-{stream2}/build_output
490 - project: 'functest-apex-{slave}-daily-{stream2}'
491 predefined-parameters:
492 DEPLOY_SCENARIO=os-onos-nofeature-ha
495 build-step-failure-threshold: 'never'
496 failure-threshold: 'never'
497 unstable-threshold: 'FAILURE'
499 - project: 'yardstick-apex-{slave}-daily-{stream2}'
500 predefined-parameters:
501 DEPLOY_SCENARIO=os-onos-nofeature-ha
504 build-step-failure-threshold: 'never'
505 failure-threshold: 'never'
506 unstable-threshold: 'FAILURE'
508 - project: 'apex-deploy-baremetal-os-odl_l3-nofeature-ha-{stream2}'
509 predefined-parameters:
510 BUILD_DIRECTORY=apex-build-{stream2}/build_output
514 - project: 'functest-apex-{slave}-daily-{stream2}'
515 predefined-parameters:
516 DEPLOY_SCENARIO=os-odl_l3-nofeature-ha
519 build-step-failure-threshold: 'never'
520 failure-threshold: 'never'
521 unstable-threshold: 'FAILURE'
523 - project: 'yardstick-apex-{slave}-daily-{stream2}'
524 predefined-parameters:
525 DEPLOY_SCENARIO=os-odl_l3-nofeature-ha
528 build-step-failure-threshold: 'never'
529 failure-threshold: 'never'
530 unstable-threshold: 'FAILURE'
532 - project: 'apex-deploy-baremetal-os-odl_l2-bgpvpn-ha-{stream2}'
533 predefined-parameters:
534 BUILD_DIRECTORY=apex-build-{stream2}/build_output
538 - project: 'functest-apex-{slave}-daily-{stream2}'
539 predefined-parameters:
540 DEPLOY_SCENARIO=os-odl_l2-bgpvpn-ha
543 build-step-failure-threshold: 'never'
544 failure-threshold: 'never'
545 unstable-threshold: 'FAILURE'
547 - project: 'yardstick-apex-{slave}-daily-{stream2}'
548 predefined-parameters:
549 DEPLOY_SCENARIO=os-odl_l2-bgpvpn-ha
552 build-step-failure-threshold: 'never'
553 failure-threshold: 'never'
554 unstable-threshold: 'FAILURE'
558 name: 'apex-daily-{stream1}'
560 # Job template for daily build
562 # Required Variables:
563 # stream: branch with - in place of / (eg. stable)
564 # branch: branch (eg. stable)
571 credentials-id: '{ssh-credentials}'
579 gs-pathname: '{gs-pathname}'
583 use-build-blocker: true
585 - 'apex-verify.*{stream1}'
586 - 'apex-deploy.*{stream1}'
587 - 'apex-build.*{stream1}'
588 - 'apex-runner.*{stream1}'
595 - project: 'apex-build-{stream1}'
597 current-parameters: true
600 - project: 'apex-deploy-virtual-nosdn-nofeature-ha-{stream1}'
601 predefined-parameters: |
602 BUILD_DIRECTORY=apex-build-{stream1}/build_output
607 - project: 'functest-apex-{slave}-daily-{stream1}'
608 predefined-parameters:
609 DEPLOY_SCENARIO=os-nosdn-nofeature-ha
612 build-step-failure-threshold: 'never'
613 failure-threshold: 'never'
614 unstable-threshold: 'FAILURE'
616 - project: 'yardstick-apex-{slave}-daily-{stream1}'
617 predefined-parameters:
618 DEPLOY_SCENARIO=os-nosdn-nofeature-ha
621 build-step-failure-threshold: 'never'
622 failure-threshold: 'never'
623 unstable-threshold: 'FAILURE'
625 ########################
627 ########################
634 description: "RPM Artifact name that will be appended to GS_URL to deploy a specific artifact"
636 name: ARTIFACT_VERSION
638 description: "Artifact version type"
640 name: BUILD_DIRECTORY
641 default: $WORKSPACE/build_output
642 description: "Directory where the build artifact will be located upon the completion of the build."
644 name: CACHE_DIRECTORY
645 default: $HOME/opnfv/cache{gs-pathname}
646 description: "Directory where the cache to be used during the build is located."
649 default: https://gerrit.opnfv.org/gerrit/$PROJECT
650 description: "Used for overriding the GIT URL coming from Global Jenkins configuration in case if the stuff is done on none-LF HW."
653 default: artifacts.opnfv.org/$PROJECT{gs-pathname}
654 description: "URL to Google Storage."
656 ########################
658 ########################
667 # log info to console
668 echo "Starting the build of Apex using OpenStack Master packages. This will take some time..."
669 echo "---------------------------------------------------------------------------------------"
671 # create the cache directory if it doesn't exist
672 [[ -d $CACHE_DIRECTORY ]] || mkdir -p $CACHE_DIRECTORY
673 # set OPNFV_ARTIFACT_VERSION
674 if echo $BUILD_TAG | grep "apex-verify" 1> /dev/null; then
675 if echo $GERRIT_BRANCH | grep "brahmaputra" 1> /dev/null; then
676 export OPNFV_ARTIFACT_VERSION=brahmaputra-dev${BUILD_NUMBER}
677 export BUILD_ARGS="-v $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY $BUILD_DIRECTORY"
679 export OPNFV_ARTIFACT_VERSION=dev${BUILD_NUMBER}
680 export BUILD_ARGS="-r $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY"
682 elif [ "$ARTIFACT_VERSION" == "daily" ]; then
683 if echo $GERRIT_BRANCH | grep "brahmaputra" 1> /dev/null; then
684 export OPNFV_ARTIFACT_VERSION=brahmaputra-$(date -u +"%Y-%m-%d")
685 export BUILD_ARGS="-v $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY $BUILD_DIRECTORY"
687 export OPNFV_ARTIFACT_VERSION=$(date -u +"%Y-%m-%d")
688 export BUILD_ARGS="-r $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY --iso"
691 export OPNFV_ARTIFACT_VERSION=${ARTIFACT_VERSION}
692 if echo $GERRIT_BRANCH | grep "brahmaputra" 1> /dev/null; then
693 export BUILD_ARGS="-v $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY $BUILD_DIRECTORY"
695 export BUILD_ARGS="-r $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY --iso"
698 # clean for stable but doesn't matter for master
699 if echo $GERRIT_BRANCH | grep "brahmaputra" 1> /dev/null; then
704 ./build.sh $BUILD_ARGS
705 RPM_VERSION=$(grep Version $BUILD_DIRECTORY/../build/opnfv-apex.spec | awk '{ print $2 }')-$(echo $OPNFV_ARTIFACT_VERSION | tr -d '_-')
706 # list the contents of BUILD_OUTPUT directory
707 ls -al $BUILD_DIRECTORY
708 # save information regarding artifact into file
710 echo "OPNFV_ARTIFACT_VERSION=$OPNFV_ARTIFACT_VERSION"
711 echo "OPNFV_GIT_URL=$(git config --get remote.origin.url)"
712 echo "OPNFV_GIT_SHA1=$(git rev-parse HEAD)"
713 echo "OPNFV_ARTIFACT_URL=$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
714 echo "OPNFV_ARTIFACT_MD5SUM=$(md5sum $BUILD_DIRECTORY/OPNFV-CentOS-7-x86_64-$OPNFV_ARTIFACT_VERSION.iso | cut -d' ' -f1)"
715 echo "OPNFV_SRPM_URL=$GS_URL/opnfv-apex-$RPM_VERSION.src.rpm"
716 echo "OPNFV_RPM_URL=$GS_URL/opnfv-apex-$RPM_VERSION.noarch.rpm"
717 echo "OPNFV_RPM_MD5SUM=$(md5sum $BUILD_DIRECTORY/opnfv-apex-$RPM_VERSION.noarch.rpm | cut -d' ' -f1)"
718 echo "OPNFV_BUILD_URL=$BUILD_URL"
719 ) > $WORKSPACE/opnfv.properties
720 echo "--------------------------------------------------------"
724 name: 'apex-workspace-cleanup'
732 # delete everything that is in $WORKSPACE
733 /bin/rm -rf $WORKSPACE
736 name: 'apex-upload-artifact'
744 # log info to console
745 echo "Uploading the Apex artifact. This could take some time..."
746 echo "--------------------------------------------------------"
749 # source the opnfv.properties to get ARTIFACT_VERSION
750 source $WORKSPACE/opnfv.properties
752 # upload artifact and additional files to google storage
753 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
754 RPM_INSTALL_PATH=$BUILD_DIRECTORY/$(basename $OPNFV_RPM_URL)
755 RPM_LIST=$RPM_INSTALL_PATH
756 for pkg in common undercloud opendaylight-sfc; do
757 RPM_LIST+=" ${RPM_INSTALL_PATH/opnfv-apex/opnfv-apex-${pkg}}"
759 SRPM_INSTALL_PATH=$BUILD_DIRECTORY/$(basename $OPNFV_SRPM_URL)
760 SRPM_LIST=$SRPM_INSTALL_PATH
761 for pkg in common undercloud opendaylight-sfc; do
762 SRPM_LIST+=" ${SRPM_INSTALL_PATH/opnfv-apex/opnfv-apex-${pkg}}"
764 for artifact in $RPM_LIST $SRPM_LIST; do
765 gsutil cp $artifact gs://$GS_URL/$(basename $artifact) > gsutil.iso.log 2>&1
767 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.properties > gsutil.properties.log 2>&1
768 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/latest.properties > gsutil.latest.log 2>&1
771 echo "--------------------------------------------------------"
773 echo "ISO Artifact is available as http://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
774 echo "RPM Artifact is available as http://$GS_URL/$(basename $OPNFV_RPM_URL)"
777 name: 'apex-deploy-virtual'
785 # log info to console
786 echo "Starting the Apex virtual deployment."
787 echo "--------------------------------------------------------"
790 if [[ $BUILD_DIRECTORY == *verify-master* ]]; then
791 cd $WORKSPACE/../${BUILD_DIRECTORY/build_output/}
793 echo "WORKSPACE modified to $WORKSPACE"
795 elif [[ ! "$ARTIFACT_NAME" == "latest" ]]; then
796 # if artifact name is passed the pull a
797 # specific artifact from artifacts.opnfv.org
798 RPM_INSTALL_PATH=$GS_URL/$ARTIFACT_NAME
800 if [[ $BUILD_DIRECTORY == *verify* ]]; then
801 BUILD_DIRECTORY=$WORKSPACE/../$BUILD_DIRECTORY
802 echo "BUILD DIRECTORY modified to $BUILD_DIRECTORY"
803 elif [[ $BUILD_DIRECTORY == *apex-build* ]]; then
804 BUILD_DIRECTORY=$WORKSPACE/../$BUILD_DIRECTORY
805 echo "BUILD DIRECTORY modified to $BUILD_DIRECTORY"
808 if [[ -f ${BUILD_DIRECTORY}/../opnfv.properties ]]; then
809 # if opnfv.properties exists then use the
810 # local build. Source the file so we get local OPNFV vars
811 source ${BUILD_DIRECTORY}/../opnfv.properties
812 RPM_INSTALL_PATH=${BUILD_DIRECTORY}/$(basename $OPNFV_RPM_URL)
814 if [[ $BUILD_DIRECTORY == *verify* ]]; then
815 echo "BUILD_DIRECTORY is from a verify job, so will not use latest from URL"
816 echo "Check that the slave has opnfv.properties in $BUILD_DIRECTORY"
818 elif [[ $BUILD_DIRECTORY == *apex-build* ]]; then
819 echo "BUILD_DIRECTORY is from a daily job, so will not use latest from URL"
820 echo "Check that the slave has opnfv.properties in $BUILD_DIRECTORY"
823 # no opnfv.properties means use the latest from artifacts.opnfv.org
824 # get the latest.properties to get the link to the latest artifact
825 curl -s -o $WORKSPACE/opnfv.properties http://$GS_URL/latest.properties
826 [[ -f opnfv.properties ]] || exit 1
827 # source the file so we get OPNFV vars
828 source opnfv.properties
829 RPM_INSTALL_PATH=$OPNFV_RPM_URL
833 if [ -z "$DEPLOY_SCENARIO" ]; then
834 echo "Deploy scenario not set!"
838 # use local build for verify
839 if [[ $BUILD_DIRECTORY == *verify-master* ]]; then
840 if [ ! -e "${WORKSPACE}/build/lib" ]; then ln -s ${WORKSPACE}/lib ${WORKSPACE}/build/lib; fi
841 DEPLOY_CMD="./deploy.sh -c ${WORKSPACE}/build -r ${WORKSPACE}/build/images/"
842 DEPLOY_FILE="${WORKSPACE}/config/deploy/${DEPLOY_SCENARIO}.yaml"
843 NETWORK_FILE="${WORKSPACE}/config/network/network_settings.yaml"
845 RPM_LIST=$RPM_INSTALL_PATH
846 for pkg in common undercloud opendaylight-sfc; do
847 RPM_LIST+=" ${RPM_INSTALL_PATH/opnfv-apex/opnfv-apex-${pkg}}"
850 # update / install the new rpm
851 if rpm -q opnfv-apex > /dev/null; then
852 if [ $(basename $OPNFV_RPM_URL) == $(rpm -q opnfv-apex).rpm ]; then
853 echo "RPM is already installed"
854 elif sudo yum update -y $RPM_LIST | grep "does not update installed package"; then
855 if ! sudo yum downgrade -y $RPM_LIST; then
856 sudo yum remove -y opnfv-undercloud opnfv-common
857 sudo yum downgrade -y $RPM_INSTALL_PATH
861 sudo yum install -y $RPM_LIST;
863 DEPLOY_CMD=opnfv-deploy
864 DEPLOY_FILE="/etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml"
865 NETWORK_FILE="/etc/opnfv-apex/network_settings.yaml"
868 if [ "$OPNFV_CLEAN" == 'yes' ]; then
869 if [[ $BUILD_DIRECTORY == *verify-master* ]]; then
875 # initiate virtual deployment
876 echo "Deploy Scenario set to ${DEPLOY_SCENARIO}"
877 if [ -e $DEPLOY_FILE ]; then
878 sudo $DEPLOY_CMD -v -d ${DEPLOY_FILE} -n $NETWORK_FILE --debug
880 echo "File does not exist /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml"
884 echo "--------------------------------------------------------"
888 name: 'apex-deploy-baremetal'
896 # log info to console
897 echo "Starting the Apex baremetal deployment."
898 echo "--------------------------------------------------------"
901 if [[ ! "$ARTIFACT_NAME" == "latest" ]]; then
902 # if artifact name is passed the pull a
903 # specific artifact from artifacts.opnfv.org
904 RPM_INSTALL_PATH=$GS_URL/$ARTIFACT_NAME
906 if [[ $BUILD_DIRECTORY == *apex-build* ]]; then
907 BUILD_DIRECTORY=$WORKSPACE/../$BUILD_DIRECTORY
908 echo "BUILD DIRECTORY modified to $BUILD_DIRECTORY"
910 if [[ -f ${BUILD_DIRECTORY}/../opnfv.properties ]]; then
911 # if opnfv.properties exists then use the
912 # local build. Source the file so we get local OPNFV vars
913 source ${BUILD_DIRECTORY}/../opnfv.properties
914 RPM_INSTALL_PATH=${BUILD_DIRECTORY}/$(basename $OPNFV_RPM_URL)
916 # no opnfv.properties means use the latest from artifacts.opnfv.org
917 # get the latest.properties to get the link to the latest artifact
918 curl -s -o $WORKSPACE/opnfv.properties http://$GS_URL/latest.properties
919 [[ -f opnfv.properties ]] || exit 1
920 # source the file so we get OPNFV vars
921 source opnfv.properties
922 RPM_INSTALL_PATH=$OPNFV_RPM_URL
926 if [ ! -e "$RPM_INSTALL_PATH" ]; then
927 RPM_INSTALL_PATH=http://${OPNFV_RPM_URL}
930 RPM_LIST=$RPM_INSTALL_PATH
931 for pkg in common undercloud; do
932 RPM_LIST+=" ${RPM_INSTALL_PATH/opnfv-apex/opnfv-apex-${pkg}}"
935 # update / install the new rpm
936 if rpm -q opnfv-apex > /dev/null; then
937 if [ $(basename $OPNFV_RPM_URL) == $(rpm -q opnfv-apex).rpm ]; then
938 echo "RPM is already installed"
939 elif sudo yum update -y $RPM_LIST | grep "does not update installed package"; then
940 if ! sudo yum downgrade -y $RPM_LIST; then
941 sudo yum remove -y opnfv-undercloud opnfv-common
942 sudo yum downgrade -y $RPM_INSTALL_PATH
946 sudo yum install -y $RPM_LIST;
949 # cleanup environment before we start
951 # initiate baremetal deployment
952 if [ -e /etc/opnfv-apex/network_settings.yaml ]; then
953 if [ -n "$DEPLOY_SCENARIO" ]; then
954 echo "Deploy Scenario set to ${DEPLOY_SCENARIO}"
955 if [ -e /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml ]; then
956 sudo opnfv-deploy -i /root/inventory/pod_settings.yaml \
957 -d /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml \
958 -n /root/network/network_settings.yaml --debug
960 echo "File does not exist /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml"
964 echo "Deploy scenario not set!"
968 echo "File /etc/opnfv-apex/network_settings.yaml does not exist!"
973 echo "--------------------------------------------------------"
976 #######################
978 ########################
984 name: 'apex-brahmaputra'