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
224 # - project: 'functest-apex-{slave}-suite-{stream1}'
225 # predefined-parameters: |
226 # DEPLOY_SCENARIO=os-nosdn-nofeature-ha
227 # FUNCTEST_SUITE_NAME=vping_userdata
229 - 'apex-workspace-cleanup'
232 name: 'apex-runner-{platform}-{scenario}-{stream}'
234 # runner jobs for deploying manually
242 gs-pathname: '{gs-pathname}'
249 default: https://gerrit.opnfv.org/gerrit/$PROJECT
250 description: "Used for overriding the GIT URL coming from parameters macro."
253 - gerrit-trigger-scm:
254 credentials-id: '{ssh-credentials}'
256 choosing-strategy: 'default'
260 use-build-blocker: true
262 - 'apex-daily.*{stream}'
263 - 'apex-verify.*{stream}'
267 - project: 'apex-deploy-{platform}-{scenario}-{stream}'
268 predefined-parameters:
273 - project: 'yardstick-apex-{slave}-daily-{stream}'
274 predefined-parameters:
275 DEPLOY_SCENARIO={scenario}
278 build-step-failure-threshold: 'never'
279 failure-threshold: 'never'
280 unstable-threshold: 'FAILURE'
282 - project: 'functest-apex-{slave}-daily-{stream}'
283 predefined-parameters:
284 DEPLOY_SCENARIO={scenario}
287 build-step-failure-threshold: 'never'
288 failure-threshold: 'never'
289 unstable-threshold: 'FAILURE'
292 name: 'apex-build-{stream}'
294 # Job template for builds
296 # Required Variables:
297 # stream: branch with - in place of / (eg. stable)
298 # branch: branch (eg. stable)
307 gs-pathname: '{gs-pathname}'
312 default: https://gerrit.opnfv.org/gerrit/$PROJECT
313 description: "Used for overriding the GIT URL coming from parameters macro."
317 credentials-id: '{ssh-credentials}'
323 use-build-blocker: true
325 - 'apex-deploy.*{stream}'
330 - project: 'apex-deploy-virtual-os-nosdn-nofeature-ha-{stream}'
331 predefined-parameters: |
332 BUILD_DIRECTORY=apex-build-{stream}/build_output
336 - 'apex-upload-artifact'
339 name: 'apex-deploy-virtual-{scenario}-{stream}'
341 # Job template for virtual deployment
343 # Required Variables:
344 # stream: branch with - in place of / (eg. stable)
345 # branch: branch (eg. stable)
352 credentials-id: '{ssh-credentials}'
360 gs-pathname: '{gs-pathname}'
362 name: DEPLOY_SCENARIO
363 default: '{scenario}'
364 description: "Scenario to deploy with."
368 description: "Use yes in lower case to invoke clean. Indicates if the deploy environment should be cleaned before deployment"
372 use-build-blocker: true
374 - 'apex-deploy.*{stream}'
377 - 'apex-deploy-virtual'
378 - 'apex-workspace-cleanup'
381 name: 'apex-deploy-baremetal-{scenario}-{stream}'
383 # Job template for baremetal deployment
385 # Required Variables:
386 # stream: branch with - in place of / (eg. stable)
387 # branch: branch (eg. stable)
394 credentials-id: '{ssh-credentials}'
402 gs-pathname: '{gs-pathname}'
404 name: DEPLOY_SCENARIO
405 default: '{scenario}'
406 description: "Scenario to deploy with."
410 use-build-blocker: true
412 - 'apex-verify.*{stream}'
413 - 'apex-deploy.*{stream}'
414 - 'apex-build.*{stream}'
418 - 'apex-deploy-baremetal'
419 - 'apex-workspace-cleanup'
423 name: 'apex-daily-{stream2}'
425 # Job template for daily build
427 # Required Variables:
428 # stream: branch with - in place of / (eg. stable)
429 # branch: branch (eg. stable)
436 credentials-id: '{ssh-credentials}'
444 gs-pathname: '{gs-pathname}'
448 use-build-blocker: true
450 - 'apex-verify.*{stream2}'
451 - 'apex-deploy.*{stream2}'
452 - 'apex-build.*{stream2}'
453 - 'apex-runner.*{stream2}'
460 - project: 'apex-build-{stream2}'
462 current-parameters: true
465 - project: 'apex-deploy-baremetal-os-odl_l2-nofeature-ha-{stream2}'
466 predefined-parameters: |
467 BUILD_DIRECTORY=apex-build-{stream2}/build_output
472 - project: 'functest-apex-{slave}-daily-{stream2}'
473 predefined-parameters:
474 DEPLOY_SCENARIO=os-odl_l2-nofeature-ha
477 build-step-failure-threshold: 'never'
478 failure-threshold: 'never'
479 unstable-threshold: 'FAILURE'
481 - project: 'yardstick-apex-{slave}-daily-{stream2}'
482 predefined-parameters:
483 DEPLOY_SCENARIO=os-odl_l2-nofeature-ha
486 build-step-failure-threshold: 'never'
487 failure-threshold: 'never'
488 unstable-threshold: 'FAILURE'
490 - project: 'apex-deploy-baremetal-os-onos-nofeature-ha-{stream2}'
491 predefined-parameters:
492 BUILD_DIRECTORY=apex-build-{stream2}/build_output
496 - project: 'functest-apex-{slave}-daily-{stream2}'
497 predefined-parameters:
498 DEPLOY_SCENARIO=os-onos-nofeature-ha
501 build-step-failure-threshold: 'never'
502 failure-threshold: 'never'
503 unstable-threshold: 'FAILURE'
505 - project: 'yardstick-apex-{slave}-daily-{stream2}'
506 predefined-parameters:
507 DEPLOY_SCENARIO=os-onos-nofeature-ha
510 build-step-failure-threshold: 'never'
511 failure-threshold: 'never'
512 unstable-threshold: 'FAILURE'
514 - project: 'apex-deploy-baremetal-os-odl_l3-nofeature-ha-{stream2}'
515 predefined-parameters:
516 BUILD_DIRECTORY=apex-build-{stream2}/build_output
520 - project: 'functest-apex-{slave}-daily-{stream2}'
521 predefined-parameters:
522 DEPLOY_SCENARIO=os-odl_l3-nofeature-ha
525 build-step-failure-threshold: 'never'
526 failure-threshold: 'never'
527 unstable-threshold: 'FAILURE'
529 - project: 'yardstick-apex-{slave}-daily-{stream2}'
530 predefined-parameters:
531 DEPLOY_SCENARIO=os-odl_l3-nofeature-ha
534 build-step-failure-threshold: 'never'
535 failure-threshold: 'never'
536 unstable-threshold: 'FAILURE'
538 - project: 'apex-deploy-baremetal-os-odl_l2-bgpvpn-ha-{stream2}'
539 predefined-parameters:
540 BUILD_DIRECTORY=apex-build-{stream2}/build_output
544 - project: 'functest-apex-{slave}-daily-{stream2}'
545 predefined-parameters:
546 DEPLOY_SCENARIO=os-odl_l2-bgpvpn-ha
549 build-step-failure-threshold: 'never'
550 failure-threshold: 'never'
551 unstable-threshold: 'FAILURE'
553 - project: 'yardstick-apex-{slave}-daily-{stream2}'
554 predefined-parameters:
555 DEPLOY_SCENARIO=os-odl_l2-bgpvpn-ha
558 build-step-failure-threshold: 'never'
559 failure-threshold: 'never'
560 unstable-threshold: 'FAILURE'
564 name: 'apex-daily-{stream1}'
566 # Job template for daily build
568 # Required Variables:
569 # stream: branch with - in place of / (eg. stable)
570 # branch: branch (eg. stable)
577 credentials-id: '{ssh-credentials}'
585 gs-pathname: '{gs-pathname}'
589 use-build-blocker: true
591 - 'apex-verify.*{stream1}'
592 - 'apex-deploy.*{stream1}'
593 - 'apex-build.*{stream1}'
594 - 'apex-runner.*{stream1}'
601 - project: 'apex-build-{stream1}'
603 current-parameters: true
606 - project: 'apex-deploy-virtual-nosdn-nofeature-ha-{stream1}'
607 predefined-parameters: |
608 BUILD_DIRECTORY=apex-build-{stream1}
613 - project: 'functest-apex-{slave}-daily-{stream1}'
614 predefined-parameters:
615 DEPLOY_SCENARIO=os-nosdn-nofeature-ha
618 build-step-failure-threshold: 'never'
619 failure-threshold: 'never'
620 unstable-threshold: 'FAILURE'
622 - project: 'yardstick-apex-{slave}-daily-{stream1}'
623 predefined-parameters:
624 DEPLOY_SCENARIO=os-nosdn-nofeature-ha
627 build-step-failure-threshold: 'never'
628 failure-threshold: 'never'
629 unstable-threshold: 'FAILURE'
632 name: 'apex-gs-clean-{stream}'
634 # Job template for clean
636 # Required Variables:
637 # stream: branch with - in place of / (eg. stable)
646 gs-pathname: '{gs-pathname}'
652 - 'apex-gs-clean-{stream}'
655 ########################
657 ########################
664 description: "RPM Artifact name that will be appended to GS_URL to deploy a specific artifact"
666 name: ARTIFACT_VERSION
668 description: "Artifact version type"
670 name: BUILD_DIRECTORY
671 default: $WORKSPACE/build_output
672 description: "Directory where the build artifact will be located upon the completion of the build."
674 name: CACHE_DIRECTORY
675 default: $HOME/opnfv/cache{gs-pathname}
676 description: "Directory where the cache to be used during the build is located."
679 default: https://gerrit.opnfv.org/gerrit/$PROJECT
680 description: "Used for overriding the GIT URL coming from Global Jenkins configuration in case if the stuff is done on none-LF HW."
683 default: artifacts.opnfv.org/$PROJECT{gs-pathname}
684 description: "URL to Google Storage."
686 ########################
688 ########################
697 # log info to console
698 echo "Starting the build of Apex using OpenStack Master packages. This will take some time..."
699 echo "---------------------------------------------------------------------------------------"
701 # create the cache directory if it doesn't exist
702 [[ -d $CACHE_DIRECTORY ]] || mkdir -p $CACHE_DIRECTORY
703 # set OPNFV_ARTIFACT_VERSION
704 if echo $BUILD_TAG | grep "apex-verify" 1> /dev/null; then
705 if echo $GERRIT_BRANCH | grep "brahmaputra" 1> /dev/null; then
706 export OPNFV_ARTIFACT_VERSION=brahmaputra-dev${BUILD_NUMBER}
707 export BUILD_ARGS="-v $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY $BUILD_DIRECTORY"
709 export OPNFV_ARTIFACT_VERSION=dev${BUILD_NUMBER}
710 export BUILD_ARGS="-r $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY"
712 elif [ "$ARTIFACT_VERSION" == "daily" ]; then
713 if echo $GERRIT_BRANCH | grep "brahmaputra" 1> /dev/null; then
714 export OPNFV_ARTIFACT_VERSION=brahmaputra-$(date -u +"%Y-%m-%d")
715 export BUILD_ARGS="-v $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY $BUILD_DIRECTORY"
717 export OPNFV_ARTIFACT_VERSION=$(date -u +"%Y-%m-%d")
718 export BUILD_ARGS="-r $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY --iso"
721 export OPNFV_ARTIFACT_VERSION=${ARTIFACT_VERSION}
722 if echo $GERRIT_BRANCH | grep "brahmaputra" 1> /dev/null; then
723 export BUILD_ARGS="-v $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY $BUILD_DIRECTORY"
725 export BUILD_ARGS="-r $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY --iso"
728 # clean for stable but doesn't matter for master
729 if echo $GERRIT_BRANCH | grep "brahmaputra" 1> /dev/null; then
734 ./build.sh $BUILD_ARGS
735 RPM_VERSION=$(grep Version $BUILD_DIRECTORY/build/opnfv-apex.spec | awk '{ print $2 }')-$(echo $OPNFV_ARTIFACT_VERSION | tr -d '_-')
736 # list the contents of BUILD_OUTPUT directory
737 ls -al $BUILD_DIRECTORY
738 # save information regarding artifact into file
740 echo "OPNFV_ARTIFACT_VERSION=$OPNFV_ARTIFACT_VERSION"
741 echo "OPNFV_GIT_URL=$(git config --get remote.origin.url)"
742 echo "OPNFV_GIT_SHA1=$(git rev-parse HEAD)"
743 echo "OPNFV_ARTIFACT_URL=$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
744 echo "OPNFV_ARTIFACT_MD5SUM=$(md5sum $BUILD_DIRECTORY/OPNFV-CentOS-7-x86_64-$OPNFV_ARTIFACT_VERSION.iso | cut -d' ' -f1)"
745 echo "OPNFV_SRPM_URL=$GS_URL/opnfv-apex-$RPM_VERSION.src.rpm"
746 echo "OPNFV_RPM_URL=$GS_URL/opnfv-apex-$RPM_VERSION.noarch.rpm"
747 echo "OPNFV_RPM_MD5SUM=$(md5sum $BUILD_DIRECTORY/opnfv-apex-$RPM_VERSION.noarch.rpm | cut -d' ' -f1)"
748 echo "OPNFV_BUILD_URL=$BUILD_URL"
749 ) > $WORKSPACE/opnfv.properties
750 echo "--------------------------------------------------------"
754 name: 'apex-workspace-cleanup'
762 # delete everything that is in $WORKSPACE
763 sudo /bin/rm -rf $WORKSPACE
766 name: 'apex-upload-artifact'
774 # log info to console
775 echo "Uploading the Apex artifact. This could take some time..."
776 echo "--------------------------------------------------------"
779 # source the opnfv.properties to get ARTIFACT_VERSION
780 source $WORKSPACE/opnfv.properties
782 # upload artifact and additional files to google storage
783 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
784 RPM_INSTALL_PATH=$BUILD_DIRECTORY/$(basename $OPNFV_RPM_URL)
785 RPM_LIST=$RPM_INSTALL_PATH
786 for pkg in common undercloud opendaylight-sfc; do
787 RPM_LIST+=" ${RPM_INSTALL_PATH/opnfv-apex/opnfv-apex-${pkg}}"
789 SRPM_INSTALL_PATH=$BUILD_DIRECTORY/$(basename $OPNFV_SRPM_URL)
790 SRPM_LIST=$SRPM_INSTALL_PATH
791 for pkg in common undercloud opendaylight-sfc; do
792 SRPM_LIST+=" ${SRPM_INSTALL_PATH/opnfv-apex/opnfv-apex-${pkg}}"
794 for artifact in $RPM_LIST $SRPM_LIST; do
795 gsutil cp $artifact gs://$GS_URL/$(basename $artifact) > gsutil.iso.log 2>&1
797 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.properties > gsutil.properties.log 2>&1
798 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/latest.properties > gsutil.latest.log 2>&1
801 echo "--------------------------------------------------------"
803 echo "ISO Artifact is available as http://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
804 echo "RPM Artifact is available as http://$GS_URL/$(basename $OPNFV_RPM_URL)"
807 name: 'apex-gs-cleanup'
815 # log info to console
816 echo "Cleaning Google Storage"
817 echo "-----------------------"
820 thirty_days_ago=$(date -d "30 days ago" +"%Y%m%d")
822 for i in $(gsutil ls gs://$GS_URL/*201?*); do
823 filedate=$(date -d "$(echo $i | grep -Eo 201[0-9]-?[0-9][0-9]-?[0-9][0-9])" +"%Y%m%d")
824 if [ $filedate -lt $thirty_days_ago ]; then
825 # gsutil indicates what it is removing so no need for output here
831 name: 'apex-deploy-virtual'
839 # log info to console
840 echo "Starting the Apex virtual deployment."
841 echo "--------------------------------------------------------"
844 if [[ $BUILD_DIRECTORY == *verify-master* ]]; then
845 cd $WORKSPACE/../${BUILD_DIRECTORY/build_output/}
847 echo "WORKSPACE modified to $WORKSPACE"
849 elif [[ ! "$ARTIFACT_NAME" == "latest" ]]; then
850 # if artifact name is passed the pull a
851 # specific artifact from artifacts.opnfv.org
852 RPM_INSTALL_PATH=$GS_URL/$ARTIFACT_NAME
854 if [[ $BUILD_DIRECTORY == *verify* ]]; then
855 BUILD_DIRECTORY=$WORKSPACE/../$BUILD_DIRECTORY
856 echo "BUILD DIRECTORY modified to $BUILD_DIRECTORY"
857 elif [[ $BUILD_DIRECTORY == *apex-build* ]]; then
858 BUILD_DIRECTORY=$WORKSPACE/../$BUILD_DIRECTORY
859 echo "BUILD DIRECTORY modified to $BUILD_DIRECTORY"
862 if [[ -f ${BUILD_DIRECTORY}/opnfv.properties ]]; then
863 # if opnfv.properties exists then use the
864 # local build. Source the file so we get local OPNFV vars
865 source ${BUILD_DIRECTORY}/opnfv.properties
866 RPM_INSTALL_PATH=${BUILD_DIRECTORY}/$(basename $OPNFV_RPM_URL)
868 if [[ $BUILD_DIRECTORY == *verify* ]]; then
869 echo "BUILD_DIRECTORY is from a verify job, so will not use latest from URL"
870 echo "Check that the slave has opnfv.properties in $BUILD_DIRECTORY"
872 elif [[ $BUILD_DIRECTORY == *apex-build* ]]; then
873 echo "BUILD_DIRECTORY is from a daily job, so will not use latest from URL"
874 echo "Check that the slave has opnfv.properties in $BUILD_DIRECTORY"
877 # no opnfv.properties means use the latest from artifacts.opnfv.org
878 # get the latest.properties to get the link to the latest artifact
879 curl -s -o $WORKSPACE/opnfv.properties http://$GS_URL/latest.properties
880 [[ -f opnfv.properties ]] || exit 1
881 # source the file so we get OPNFV vars
882 source opnfv.properties
883 RPM_INSTALL_PATH=$OPNFV_RPM_URL
887 if [ -z "$DEPLOY_SCENARIO" ]; then
888 echo "Deploy scenario not set!"
892 # use local build for verify
893 if [[ $BUILD_DIRECTORY == *verify-master* ]]; then
894 if [ ! -e "${WORKSPACE}/build/lib" ]; then ln -s ${WORKSPACE}/lib ${WORKSPACE}/build/lib; fi
895 DEPLOY_CMD="./deploy.sh -c ${WORKSPACE}/build -r ${WORKSPACE}/build/images/"
896 DEPLOY_FILE="${WORKSPACE}/config/deploy/${DEPLOY_SCENARIO}.yaml"
897 NETWORK_FILE="${WORKSPACE}/config/network/network_settings.yaml"
898 # Make sure python34 is installed
899 if ! rpm -q python34 > /dev/null; then
900 sudo yum install -y epel-release
901 if ! sudo yum install -y python34; then
902 echo "Failed to install python34"
906 if ! rpm -q python34-PyYAML > /dev/null; then
907 sudo yum install -y epel-release
908 if ! sudo yum install -y python34-PyYAML; then
909 echo "Failed to install python34-PyYAML"
913 if [ -z ${PYTHONPATH:-} ]; then
914 export PYTHONPATH=${WORKSPACE}/lib/python
916 export PYTHONPATH=$PYTHONPATH:${WORKSPACE}/lib/python
919 RPM_LIST=$RPM_INSTALL_PATH
920 for pkg in common undercloud opendaylight-sfc; do
921 RPM_LIST+=" ${RPM_INSTALL_PATH/opnfv-apex/opnfv-apex-${pkg}}"
924 # update / install the new rpm
925 if rpm -q opnfv-apex > /dev/null; then
926 if [ $(basename $OPNFV_RPM_URL) == $(rpm -q opnfv-apex).rpm ]; then
927 echo "RPM is already installed"
928 elif sudo yum update -y $RPM_LIST | grep "does not update installed package"; then
929 if ! sudo yum downgrade -y $RPM_LIST; then
930 sudo yum remove -y opnfv-undercloud opnfv-common
931 sudo yum downgrade -y $RPM_INSTALL_PATH
935 sudo yum install -y $RPM_LIST;
937 DEPLOY_CMD=opnfv-deploy
938 DEPLOY_FILE="/etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml"
939 NETWORK_FILE="/etc/opnfv-apex/network_settings.yaml"
942 if [ "$OPNFV_CLEAN" == 'yes' ]; then
943 if [[ $BUILD_DIRECTORY == *verify-master* ]]; then
949 # initiate virtual deployment
950 echo "Deploy Scenario set to ${DEPLOY_SCENARIO}"
951 if [ -e $DEPLOY_FILE ]; then
952 sudo $DEPLOY_CMD -v -d ${DEPLOY_FILE} -n $NETWORK_FILE --debug
954 echo "File does not exist /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml"
958 echo "--------------------------------------------------------"
962 name: 'apex-deploy-baremetal'
970 # log info to console
971 echo "Starting the Apex baremetal deployment."
972 echo "--------------------------------------------------------"
975 if [[ ! "$ARTIFACT_NAME" == "latest" ]]; then
976 # if artifact name is passed the pull a
977 # specific artifact from artifacts.opnfv.org
978 RPM_INSTALL_PATH=$GS_URL/$ARTIFACT_NAME
980 if [[ $BUILD_DIRECTORY == *apex-build* ]]; then
981 BUILD_DIRECTORY=$WORKSPACE/../$BUILD_DIRECTORY
982 echo "BUILD DIRECTORY modified to $BUILD_DIRECTORY"
984 if [[ -f ${BUILD_DIRECTORY}/../opnfv.properties ]]; then
985 # if opnfv.properties exists then use the
986 # local build. Source the file so we get local OPNFV vars
987 source ${BUILD_DIRECTORY}/../opnfv.properties
988 RPM_INSTALL_PATH=${BUILD_DIRECTORY}/$(basename $OPNFV_RPM_URL)
990 # no opnfv.properties means use the latest from artifacts.opnfv.org
991 # get the latest.properties to get the link to the latest artifact
992 curl -s -o $WORKSPACE/opnfv.properties http://$GS_URL/latest.properties
993 [[ -f opnfv.properties ]] || exit 1
994 # source the file so we get OPNFV vars
995 source opnfv.properties
996 RPM_INSTALL_PATH=$OPNFV_RPM_URL
1000 if [ ! -e "$RPM_INSTALL_PATH" ]; then
1001 RPM_INSTALL_PATH=http://${OPNFV_RPM_URL}
1004 RPM_LIST=$RPM_INSTALL_PATH
1005 for pkg in common undercloud; do
1006 RPM_LIST+=" ${RPM_INSTALL_PATH/opnfv-apex/opnfv-apex-${pkg}}"
1009 # update / install the new rpm
1010 if rpm -q opnfv-apex > /dev/null; then
1011 if [ $(basename $OPNFV_RPM_URL) == $(rpm -q opnfv-apex).rpm ]; then
1012 echo "RPM is already installed"
1013 elif sudo yum update -y $RPM_LIST | grep "does not update installed package"; then
1014 if ! sudo yum downgrade -y $RPM_LIST; then
1015 sudo yum remove -y opnfv-undercloud opnfv-common
1016 sudo yum downgrade -y $RPM_INSTALL_PATH
1020 sudo yum install -y $RPM_LIST;
1023 # cleanup environment before we start
1025 # initiate baremetal deployment
1026 if [ -e /etc/opnfv-apex/network_settings.yaml ]; then
1027 if [ -n "$DEPLOY_SCENARIO" ]; then
1028 echo "Deploy Scenario set to ${DEPLOY_SCENARIO}"
1029 if [ -e /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml ]; then
1030 sudo opnfv-deploy -i /root/inventory/pod_settings.yaml \
1031 -d /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml \
1032 -n /root/network/network_settings.yaml --debug
1034 echo "File does not exist /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml"
1038 echo "Deploy scenario not set!"
1042 echo "File /etc/opnfv-apex/network_settings.yaml does not exist!"
1047 echo "--------------------------------------------------------"
1050 #######################
1052 ########################
1056 - timed: '0 3 * * *'
1058 name: 'apex-brahmaputra'
1060 - timed: '0 3 * * *'
1062 name: 'apex-gs-clean-{stream}'
1064 - timed: '0 2 * * *'