4 - 'apex-verify-{stream1}'
5 - 'apex-verify-{stream2}'
6 - 'apex-runner-{platform}-{scenario}-{stream}'
7 - 'apex-build-{stream}'
8 - 'apex-deploy-virtual-{scenario}-{stream}'
9 - 'apex-deploy-baremetal-{scenario}-{stream}'
10 - 'apex-daily-{stream1}'
11 - 'apex-daily-{stream2}'
13 # stream: branch with - in place of / (eg. stable-arno)
14 # branch: branch (eg. stable/arno)
19 block-stream: 'brahmaputra'
21 verify-slave: 'apex-verify-master'
22 daily-slave: 'apex-daily-master'
24 branch: 'stable/brahmaputra'
25 gs-pathname: '/brahmaputra'
26 block-stream: 'master'
28 verify-slave: 'apex-verify-brahmaputra'
29 daily-slave: 'apex-daily-brahmaputra'
36 block-stream: 'brahmaputra'
38 verify-slave: 'apex-verify-master'
39 daily-slave: 'apex-daily-master'
43 branch: 'stable/brahmaputra'
44 gs-pathname: '/brahmaputra'
45 block-stream: 'master'
47 verify-slave: 'apex-verify-brahmaputra'
48 daily-slave: 'apex-daily-brahmaputra'
54 - 'os-nosdn-nofeature-ha'
55 - 'os-odl_l2-nofeature-ha'
56 - 'os-odl_l2-bgpvpn-ha'
57 - 'os-odl_l2-sfc-noha'
58 - 'os-odl_l3-nofeature-ha'
59 - 'os-onos-nofeature-ha'
60 - 'os-opencontrail-nofeature-ha'
68 name: 'apex-verify-{stream2}'
74 gs-pathname: '{gs-pathname}'
81 default: https://gerrit.opnfv.org/gerrit/$PROJECT
82 description: "Used for overriding the GIT URL coming from parameters macro."
86 credentials-id: '{ssh-credentials}'
87 refspec: '$GERRIT_REFSPEC'
88 choosing-strategy: 'gerrit'
93 - patchset-created-event:
94 exclude-drafts: 'false'
95 exclude-trivial-rebase: 'false'
96 exclude-no-code-change: 'true'
97 - draft-published-event
98 - comment-added-contains-event:
99 comment-contains-value: 'recheck'
100 - comment-added-contains-event:
101 comment-contains-value: 'reverify'
103 - project-compare-type: 'ANT'
104 project-pattern: 'apex'
106 - branch-compare-type: 'ANT'
107 branch-pattern: '**/{branch}'
120 use-build-blocker: true
122 - 'apex-daily.*{stream2}'
123 - 'apex-deploy.*{stream2}'
124 - 'apex-build.*{stream2}'
125 - 'apex-runner.*{stream2}'
126 - 'apex-verify-{stream2}'
131 - project: 'apex-deploy-virtual-os-odl_l2-nofeature-ha-{stream2}'
132 predefined-parameters: |
133 BUILD_DIRECTORY=apex-verify-{stream2}/build_output
138 - project: 'apex-deploy-virtual-os-onos-nofeature-ha-{stream2}'
139 predefined-parameters: |
140 BUILD_DIRECTORY=apex-verify-{stream2}/build_output
145 - project: 'apex-deploy-virtual-os-odl_l3-nofeature-ha-{stream2}'
146 predefined-parameters: |
147 BUILD_DIRECTORY=apex-verify-{stream2}/build_output
152 - project: 'apex-deploy-virtual-os-odl_l2-sfc-noha-{stream2}'
153 predefined-parameters: |
154 BUILD_DIRECTORY=apex-verify-{stream2}/build_output
158 - 'apex-workspace-cleanup'
162 name: 'apex-verify-{stream1}'
164 node: '{verify-slave}'
168 gs-pathname: '{gs-pathname}'
175 default: https://gerrit.opnfv.org/gerrit/$PROJECT
176 description: "Used for overriding the GIT URL coming from parameters macro."
179 - gerrit-trigger-scm:
180 credentials-id: '{ssh-credentials}'
181 refspec: '$GERRIT_REFSPEC'
182 choosing-strategy: 'gerrit'
187 - patchset-created-event:
188 exclude-drafts: 'false'
189 exclude-trivial-rebase: 'false'
190 exclude-no-code-change: 'true'
191 - draft-published-event
192 - comment-added-contains-event:
193 comment-contains-value: 'recheck'
194 - comment-added-contains-event:
195 comment-contains-value: 'reverify'
197 - project-compare-type: 'ANT'
198 project-pattern: 'apex'
200 - branch-compare-type: 'ANT'
201 branch-pattern: '**/{branch}'
214 use-build-blocker: true
217 - 'apex-daily.*{stream1}'
218 - 'apex-deploy.*{stream1}'
219 - 'apex-build.*{stream1}'
220 - 'apex-runner.*{stream1}'
221 - 'apex-verify-{stream1}'
228 - project: 'apex-deploy-virtual-os-nosdn-nofeature-ha-{stream1}'
229 predefined-parameters: |
230 BUILD_DIRECTORY=apex-verify-{stream1}
236 # - project: 'functest-apex-{verify-slave}-suite-{stream1}'
237 # predefined-parameters: |
238 # DEPLOY_SCENARIO=os-nosdn-nofeature-ha
239 # FUNCTEST_SUITE_NAME=vping_userdata
243 - project: 'apex-deploy-virtual-os-odl_l2-nofeature-ha-{stream1}'
244 predefined-parameters: |
245 BUILD_DIRECTORY=apex-verify-{stream1}
250 - 'apex-workspace-cleanup'
253 name: 'apex-runner-{platform}-{scenario}-{stream}'
255 # runner jobs for deploying manually
263 gs-pathname: '{gs-pathname}'
270 default: https://gerrit.opnfv.org/gerrit/$PROJECT
271 description: "Used for overriding the GIT URL coming from parameters macro."
274 - gerrit-trigger-scm:
275 credentials-id: '{ssh-credentials}'
277 choosing-strategy: 'default'
281 use-build-blocker: true
283 - 'apex-daily.*{stream}'
284 - 'apex-verify.*{stream}'
288 - project: 'apex-deploy-{platform}-{scenario}-{stream}'
289 predefined-parameters:
294 - project: 'yardstick-apex-{slave}-daily-{stream}'
295 predefined-parameters:
296 DEPLOY_SCENARIO={scenario}
299 build-step-failure-threshold: 'never'
300 failure-threshold: 'never'
301 unstable-threshold: 'FAILURE'
303 - project: 'functest-apex-{slave}-daily-{stream}'
304 predefined-parameters:
305 DEPLOY_SCENARIO={scenario}
308 build-step-failure-threshold: 'never'
309 failure-threshold: 'never'
310 unstable-threshold: 'FAILURE'
313 name: 'apex-build-{stream}'
315 # Job template for builds
317 # Required Variables:
318 # stream: branch with - in place of / (eg. stable)
319 # branch: branch (eg. stable)
320 node: '{daily-slave}'
328 gs-pathname: '{gs-pathname}'
333 default: https://gerrit.opnfv.org/gerrit/$PROJECT
334 description: "Used for overriding the GIT URL coming from parameters macro."
338 credentials-id: '{ssh-credentials}'
344 use-build-blocker: true
347 - 'apex-deploy.*{stream}'
354 - project: 'apex-deploy-virtual-os-nosdn-nofeature-ha-{stream}'
355 predefined-parameters: |
356 BUILD_DIRECTORY=apex-build-{stream}/build
361 - 'apex-upload-artifact'
364 name: 'apex-deploy-virtual-{scenario}-{stream}'
366 # Job template for virtual deployment
368 # Required Variables:
369 # stream: branch with - in place of / (eg. stable)
370 # branch: branch (eg. stable)
377 credentials-id: '{ssh-credentials}'
385 gs-pathname: '{gs-pathname}'
387 name: DEPLOY_SCENARIO
388 default: '{scenario}'
389 description: "Scenario to deploy with."
393 description: "Use yes in lower case to invoke clean. Indicates if the deploy environment should be cleaned before deployment"
397 use-build-blocker: true
400 - 'apex-deploy.*{stream}'
405 - 'apex-deploy-virtual'
406 - 'apex-workspace-cleanup'
409 name: 'apex-deploy-baremetal-{scenario}-{stream}'
411 # Job template for baremetal deployment
413 # Required Variables:
414 # stream: branch with - in place of / (eg. stable)
415 # branch: branch (eg. stable)
422 credentials-id: '{ssh-credentials}'
430 gs-pathname: '{gs-pathname}'
432 name: DEPLOY_SCENARIO
433 default: '{scenario}'
434 description: "Scenario to deploy with."
438 use-build-blocker: true
440 - 'apex-verify.*{stream}'
441 - 'apex-deploy.*{stream}'
442 - 'apex-build.*{stream}'
446 - 'apex-deploy-baremetal'
447 - 'apex-workspace-cleanup'
451 name: 'apex-daily-{stream2}'
453 # Job template for daily build
455 # Required Variables:
456 # stream: branch with - in place of / (eg. stable)
457 # branch: branch (eg. stable)
464 credentials-id: '{ssh-credentials}'
472 gs-pathname: '{gs-pathname}'
476 use-build-blocker: true
478 - 'apex-verify.*{stream2}'
479 - 'apex-deploy.*{stream2}'
480 - 'apex-build.*{stream2}'
481 - 'apex-runner.*{stream2}'
488 - project: 'apex-build-{stream2}'
490 current-parameters: true
493 - project: 'apex-deploy-baremetal-os-odl_l2-nofeature-ha-{stream2}'
494 predefined-parameters: |
495 BUILD_DIRECTORY=apex-build-{stream2}/build_output
500 - project: 'functest-apex-{slave}-daily-{stream2}'
501 predefined-parameters:
502 DEPLOY_SCENARIO=os-odl_l2-nofeature-ha
505 build-step-failure-threshold: 'never'
506 failure-threshold: 'never'
507 unstable-threshold: 'FAILURE'
509 - project: 'yardstick-apex-{slave}-daily-{stream2}'
510 predefined-parameters:
511 DEPLOY_SCENARIO=os-odl_l2-nofeature-ha
514 build-step-failure-threshold: 'never'
515 failure-threshold: 'never'
516 unstable-threshold: 'FAILURE'
518 - project: 'apex-deploy-baremetal-os-onos-nofeature-ha-{stream2}'
519 predefined-parameters:
520 BUILD_DIRECTORY=apex-build-{stream2}/build_output
524 - project: 'functest-apex-{slave}-daily-{stream2}'
525 predefined-parameters:
526 DEPLOY_SCENARIO=os-onos-nofeature-ha
529 build-step-failure-threshold: 'never'
530 failure-threshold: 'never'
531 unstable-threshold: 'FAILURE'
533 - project: 'yardstick-apex-{slave}-daily-{stream2}'
534 predefined-parameters:
535 DEPLOY_SCENARIO=os-onos-nofeature-ha
538 build-step-failure-threshold: 'never'
539 failure-threshold: 'never'
540 unstable-threshold: 'FAILURE'
542 - project: 'apex-deploy-baremetal-os-odl_l3-nofeature-ha-{stream2}'
543 predefined-parameters:
544 BUILD_DIRECTORY=apex-build-{stream2}/build_output
548 - project: 'functest-apex-{slave}-daily-{stream2}'
549 predefined-parameters:
550 DEPLOY_SCENARIO=os-odl_l3-nofeature-ha
553 build-step-failure-threshold: 'never'
554 failure-threshold: 'never'
555 unstable-threshold: 'FAILURE'
557 - project: 'yardstick-apex-{slave}-daily-{stream2}'
558 predefined-parameters:
559 DEPLOY_SCENARIO=os-odl_l3-nofeature-ha
562 build-step-failure-threshold: 'never'
563 failure-threshold: 'never'
564 unstable-threshold: 'FAILURE'
566 - project: 'apex-deploy-baremetal-os-odl_l2-bgpvpn-ha-{stream2}'
567 predefined-parameters:
568 BUILD_DIRECTORY=apex-build-{stream2}/build_output
572 - project: 'functest-apex-{slave}-daily-{stream2}'
573 predefined-parameters:
574 DEPLOY_SCENARIO=os-odl_l2-bgpvpn-ha
577 build-step-failure-threshold: 'never'
578 failure-threshold: 'never'
579 unstable-threshold: 'FAILURE'
581 - project: 'yardstick-apex-{slave}-daily-{stream2}'
582 predefined-parameters:
583 DEPLOY_SCENARIO=os-odl_l2-bgpvpn-ha
586 build-step-failure-threshold: 'never'
587 failure-threshold: 'never'
588 unstable-threshold: 'FAILURE'
592 name: 'apex-daily-{stream1}'
594 # Job template for daily build
596 # Required Variables:
597 # stream: branch with - in place of / (eg. stable)
598 # branch: branch (eg. stable)
599 node: '{daily-slave}'
605 credentials-id: '{ssh-credentials}'
613 gs-pathname: '{gs-pathname}'
617 use-build-blocker: true
620 - 'apex-verify.*{stream1}'
621 - 'apex-deploy.*{stream1}'
622 - 'apex-build.*{stream1}'
623 - 'apex-runner.*{stream1}'
630 - project: 'apex-build-{stream1}'
632 current-parameters: true
636 - project: 'apex-deploy-virtual-nosdn-nofeature-ha-{stream1}'
637 predefined-parameters: |
638 BUILD_DIRECTORY=apex-build-{stream1}/build
644 - project: 'functest-apex-{slave}-daily-{stream1}'
645 predefined-parameters:
646 DEPLOY_SCENARIO=os-nosdn-nofeature-ha
650 build-step-failure-threshold: 'never'
651 failure-threshold: 'never'
652 unstable-threshold: 'FAILURE'
654 - project: 'yardstick-apex-{slave}-daily-{stream1}'
655 predefined-parameters:
656 DEPLOY_SCENARIO=os-nosdn-nofeature-ha
660 build-step-failure-threshold: 'never'
661 failure-threshold: 'never'
662 unstable-threshold: 'FAILURE'
665 name: 'apex-gs-clean-{stream}'
667 # Job template for clean
669 # Required Variables:
670 # stream: branch with - in place of / (eg. stable)
679 gs-pathname: '{gs-pathname}'
685 - 'apex-gs-clean-{stream}'
688 ########################
690 ########################
697 description: "RPM Artifact name that will be appended to GS_URL to deploy a specific artifact"
699 name: ARTIFACT_VERSION
701 description: "Artifact version type"
703 name: BUILD_DIRECTORY
704 default: $WORKSPACE/build
705 description: "Directory where the build artifact will be located upon the completion of the build."
707 name: CACHE_DIRECTORY
708 default: $HOME/opnfv/cache{gs-pathname}
709 description: "Directory where the cache to be used during the build is located."
712 default: https://gerrit.opnfv.org/gerrit/$PROJECT
713 description: "Used for overriding the GIT URL coming from Global Jenkins configuration in case if the stuff is done on none-LF HW."
716 default: artifacts.opnfv.org/$PROJECT{gs-pathname}
717 description: "URL to Google Storage."
719 ########################
721 ########################
730 # log info to console
731 echo "Starting the build of Apex using OpenStack Master packages. This will take some time..."
732 echo "---------------------------------------------------------------------------------------"
734 # create the cache directory if it doesn't exist
735 [[ -d $CACHE_DIRECTORY ]] || mkdir -p $CACHE_DIRECTORY
736 # set OPNFV_ARTIFACT_VERSION
737 if echo $BUILD_TAG | grep "apex-verify" 1> /dev/null; then
738 if echo $GERRIT_BRANCH | grep "brahmaputra" 1> /dev/null; then
739 export OPNFV_ARTIFACT_VERSION=brahmaputra-dev${BUILD_NUMBER}
740 export BUILD_ARGS="-v $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY $BUILD_DIRECTORY"
742 export OPNFV_ARTIFACT_VERSION=dev${BUILD_NUMBER}
743 export BUILD_ARGS="-r $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY"
745 elif [ "$ARTIFACT_VERSION" == "daily" ]; then
746 if echo $GERRIT_BRANCH | grep "brahmaputra" 1> /dev/null; then
747 export OPNFV_ARTIFACT_VERSION=brahmaputra-$(date -u +"%Y-%m-%d")
748 export BUILD_ARGS="-v $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY $BUILD_DIRECTORY"
750 export OPNFV_ARTIFACT_VERSION=$(date -u +"%Y-%m-%d")
751 export BUILD_ARGS="-r $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY --iso"
754 export OPNFV_ARTIFACT_VERSION=${ARTIFACT_VERSION}
755 if echo $GERRIT_BRANCH | grep "brahmaputra" 1> /dev/null; then
756 export BUILD_ARGS="-v $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY $BUILD_DIRECTORY"
758 export BUILD_ARGS="-r $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY --iso"
761 # clean for stable but doesn't matter for master
762 if echo $GERRIT_BRANCH | grep "brahmaputra" 1> /dev/null; then
767 ./build.sh $BUILD_ARGS
768 RPM_VERSION=$(grep Version: $BUILD_DIRECTORY/opnfv-apex.spec | awk '{ print $2 }')-$(echo $OPNFV_ARTIFACT_VERSION | tr -d '_-')
769 # list the contents of BUILD_OUTPUT directory
770 ls -al $BUILD_DIRECTORY
771 # save information regarding artifact into file
773 echo "OPNFV_ARTIFACT_VERSION=$OPNFV_ARTIFACT_VERSION"
774 echo "OPNFV_GIT_URL=$(git config --get remote.origin.url)"
775 echo "OPNFV_GIT_SHA1=$(git rev-parse HEAD)"
776 echo "OPNFV_ARTIFACT_URL=$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
777 echo "OPNFV_ARTIFACT_MD5SUM=$(md5sum $BUILD_DIRECTORY/release/OPNFV-CentOS-7-x86_64-$OPNFV_ARTIFACT_VERSION.iso | cut -d' ' -f1)"
778 echo "OPNFV_SRPM_URL=$GS_URL/opnfv-apex-$RPM_VERSION.src.rpm"
779 echo "OPNFV_RPM_URL=$GS_URL/opnfv-apex-$RPM_VERSION.noarch.rpm"
780 echo "OPNFV_RPM_MD5SUM=$(md5sum $BUILD_DIRECTORY/noarch/opnfv-apex-$RPM_VERSION.noarch.rpm | cut -d' ' -f1)"
781 echo "OPNFV_BUILD_URL=$BUILD_URL"
782 ) > $WORKSPACE/opnfv.properties
783 echo "--------------------------------------------------------"
787 name: 'apex-workspace-cleanup'
795 # delete everything that is in $WORKSPACE
796 sudo /bin/rm -rf $WORKSPACE
799 name: 'apex-upload-artifact'
807 # log info to console
808 echo "Uploading the Apex artifact. This could take some time..."
809 echo "--------------------------------------------------------"
812 # source the opnfv.properties to get ARTIFACT_VERSION
813 source $WORKSPACE/opnfv.properties
815 # upload artifact and additional files to google storage
816 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
817 RPM_INSTALL_PATH=$BUILD_DIRECTORY/noarch
818 RPM_LIST=$RPM_INSTALL_PATH/$(basename $OPNFV_RPM_URL)
819 VERSION_EXTENSION=$(echo $(basename $OPNFV_RPM_URL) | sed 's/opnfv-apex-//')
820 for pkg in common undercloud opendaylight-sfc onos; do
821 RPM_LIST+=" ${RPM_INSTALL_PATH}/opnfv-apex-${pkg}-${VERSION_EXTENSION}"
823 SRPM_INSTALL_PATH=$BUILD_DIRECTORY
824 SRPM_LIST=$SRPM_INSTALL_PATH/$(basename $OPNFV_SRPM_URL)
825 for pkg in common undercloud opendaylight-sfc onos; do
826 SRPM_LIST+=" ${SRPM_INSTALL_PATH}/opnfv-apex-${pkg}-${VERSION_EXTENSION}"
828 for artifact in $RPM_LIST $SRPM_LIST; do
829 gsutil cp $artifact gs://$GS_URL/$(basename $artifact) > gsutil.iso.log 2>&1
831 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.properties > gsutil.properties.log 2>&1
832 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/latest.properties > gsutil.latest.log 2>&1
835 echo "--------------------------------------------------------"
837 echo "ISO Artifact is available as http://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
838 echo "RPM Artifact is available as http://$GS_URL/$(basename $OPNFV_RPM_URL)"
841 name: 'apex-gs-cleanup'
849 # log info to console
850 echo "Cleaning Google Storage"
851 echo "-----------------------"
854 thirty_days_ago=$(date -d "30 days ago" +"%Y%m%d")
856 for i in $(gsutil ls gs://$GS_URL/*201?*); do
857 filedate=$(date -d "$(echo $i | grep -Eo 201[0-9]-?[0-9][0-9]-?[0-9][0-9])" +"%Y%m%d")
858 if [ $filedate -lt $thirty_days_ago ]; then
859 # gsutil indicates what it is removing so no need for output here
865 name: 'apex-deploy-virtual'
873 # log info to console
874 echo "Starting the Apex virtual deployment."
875 echo "--------------------------------------------------------"
878 if [[ $BUILD_DIRECTORY == *verify-master* ]]; then
879 cd $WORKSPACE/../${BUILD_DIRECTORY/build_output/}
881 echo "WORKSPACE modified to $WORKSPACE"
883 elif [[ ! "$ARTIFACT_NAME" == "latest" ]]; then
884 # if artifact name is passed the pull a
885 # specific artifact from artifacts.opnfv.org
886 RPM_INSTALL_PATH=$GS_URL
887 RPM_LIST=$RPM_INSTALL_PATH/$ARTIFACT_NAME
889 if [[ $BUILD_DIRECTORY == *verify* ]]; then
890 BUILD_DIRECTORY=$WORKSPACE/../$BUILD_DIRECTORY
891 echo "BUILD DIRECTORY modified to $BUILD_DIRECTORY"
892 elif [[ $BUILD_DIRECTORY == *apex-build* ]]; then
893 BUILD_DIRECTORY=$WORKSPACE/../$BUILD_DIRECTORY
894 echo "BUILD DIRECTORY modified to $BUILD_DIRECTORY"
897 if [[ -f ${BUILD_DIRECTORY}/../opnfv.properties ]]; then
898 # if opnfv.properties exists then use the
899 # local build. Source the file so we get local OPNFV vars
900 source ${BUILD_DIRECTORY}/../opnfv.properties
901 RPM_INSTALL_PATH=${BUILD_DIRECTORY}/noarch
902 RPM_LIST=$RPM_INSTALL_PATH/$(basename $OPNFV_RPM_URL)
904 if [[ $BUILD_DIRECTORY == *verify* ]]; then
905 echo "BUILD_DIRECTORY is from a verify job, so will not use latest from URL"
906 echo "Check that the slave has opnfv.properties in $BUILD_DIRECTORY"
908 elif [[ $BUILD_DIRECTORY == *apex-build* ]]; then
909 echo "BUILD_DIRECTORY is from a daily job, so will not use latest from URL"
910 echo "Check that the slave has opnfv.properties in $BUILD_DIRECTORY"
913 # no opnfv.properties means use the latest from artifacts.opnfv.org
914 # get the latest.properties to get the link to the latest artifact
915 curl -s -o $WORKSPACE/opnfv.properties http://$GS_URL/latest.properties
916 [[ -f opnfv.properties ]] || exit 1
917 # source the file so we get OPNFV vars
918 source opnfv.properties
919 RPM_INSTALL_PATH=$(echo $OPNFV_RPM_URL | sed 's/'"$(basename $OPNFV_RPM_URL)"'//')
920 RPM_LIST=$RPM_INSTALL_PATH/$(basename $OPNFV_RPM_URL)
924 if [ -z "$DEPLOY_SCENARIO" ]; then
925 echo "Deploy scenario not set!"
929 # use local build for verify
930 if [[ $BUILD_DIRECTORY == *verify-master* ]]; then
931 if [ ! -e "${WORKSPACE}/build/lib" ]; then ln -s ${WORKSPACE}/lib ${WORKSPACE}/build/lib; fi
932 DEPLOY_CMD="CONFIG=${WORKSPACE}/build RESOURCES=${WORKSPACE}/build/images/ ./deploy.sh -c ${WORKSPACE}/build -r ${WORKSPACE}/build/images/"
933 DEPLOY_FILE="${WORKSPACE}/config/deploy/${DEPLOY_SCENARIO}.yaml"
934 NETWORK_FILE="${WORKSPACE}/config/network/network_settings.yaml"
935 # Make sure python34 is installed
936 if ! rpm -q python34 > /dev/null; then
937 sudo yum install -y epel-release
938 if ! sudo yum install -y python34; then
939 echo "Failed to install python34"
943 if ! rpm -q python34-PyYAML > /dev/null; then
944 sudo yum install -y epel-release
945 if ! sudo yum install -y python34-PyYAML; then
946 echo "Failed to install python34-PyYAML"
950 if ! rpm -q python34-setuptools > /dev/null; then
951 if ! sudo yum install -y python34-setuptools; then
952 echo "Failed to install python34-setuptools"
956 if [ -z ${PYTHONPATH:-} ]; then
957 export PYTHONPATH=${WORKSPACE}/lib/python
959 export PYTHONPATH=$PYTHONPATH:${WORKSPACE}/lib/python
962 VERSION_EXTENSION=$(echo $(basename $RPM_LIST) | sed 's/opnfv-apex-//')
963 for pkg in common undercloud opendaylight-sfc onos; do
964 RPM_LIST+=" ${RPM_INSTALL_PATH}/opnfv-apex-${pkg}-${VERSION_EXTENSION}"
967 # update / install the new rpm
968 if rpm -q opnfv-apex > /dev/null; then
969 INSTALLED_RPMS=$(rpm -qa | grep apex)
970 for x in $INSTALLED_RPMS; do
971 INSTALLED_RPM_VER=$(echo $x | sed 's/opnfv-apex-//').rpm
972 # Does each RPM's version match the version required for deployment
973 if [ "$INSTALLED_RPM_VER" == "$VERSION_EXTENSION" ]; then
974 echo "RPM $x is already installed"
976 echo "RPM $x does not match $VERSION_EXTENSION"
977 echo "Will upgrade/downgrade RPMs..."
978 # Try to upgrade/downgrade RPMS
979 if sudo yum update -y $RPM_LIST | grep "does not update installed package"; then
980 if ! sudo yum downgrade -y $RPM_LIST; then
981 sudo yum remove -y opnfv-apex-undercloud opnfv-apex-common opnfv-apex-opendaylight-sfc opnfv-apex-onos
982 sudo yum downgrade -y $RPM_INSTALL_PATH
989 sudo yum install -y $RPM_LIST;
991 DEPLOY_CMD=opnfv-deploy
992 DEPLOY_FILE="/etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml"
993 NETWORK_FILE="/etc/opnfv-apex/network_settings.yaml"
994 export RESOURCES="/var/opt/opnfv/images"
995 export CONFIG="/var/opt/opnfv"
998 if [ "$OPNFV_CLEAN" == 'yes' ]; then
999 if [[ $BUILD_DIRECTORY == *verify-master* ]]; then
1000 sudo CONFIG=../lib ./clean.sh
1005 # initiate virtual deployment
1006 echo "Deploy Scenario set to ${DEPLOY_SCENARIO}"
1007 if [ -e $DEPLOY_FILE ]; then
1008 sudo $DEPLOY_CMD -v -d ${DEPLOY_FILE} -n $NETWORK_FILE --debug
1010 echo "File does not exist /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml"
1014 echo "--------------------------------------------------------"
1018 name: 'apex-deploy-baremetal'
1026 # log info to console
1027 echo "Starting the Apex baremetal deployment."
1028 echo "--------------------------------------------------------"
1031 if [[ ! "$ARTIFACT_NAME" == "latest" ]]; then
1032 # if artifact name is passed the pull a
1033 # specific artifact from artifacts.opnfv.org
1034 RPM_INSTALL_PATH=$GS_URL/$ARTIFACT_NAME
1036 if [[ $BUILD_DIRECTORY == *apex-build* ]]; then
1037 BUILD_DIRECTORY=$WORKSPACE/../$BUILD_DIRECTORY
1038 echo "BUILD DIRECTORY modified to $BUILD_DIRECTORY"
1040 if [[ -f ${BUILD_DIRECTORY}/../opnfv.properties ]]; then
1041 # if opnfv.properties exists then use the
1042 # local build. Source the file so we get local OPNFV vars
1043 source ${BUILD_DIRECTORY}/../opnfv.properties
1044 RPM_INSTALL_PATH=${BUILD_DIRECTORY}/$(basename $OPNFV_RPM_URL)
1046 # no opnfv.properties means use the latest from artifacts.opnfv.org
1047 # get the latest.properties to get the link to the latest artifact
1048 curl -s -o $WORKSPACE/opnfv.properties http://$GS_URL/latest.properties
1049 [[ -f opnfv.properties ]] || exit 1
1050 # source the file so we get OPNFV vars
1051 source opnfv.properties
1052 RPM_INSTALL_PATH=$OPNFV_RPM_URL
1056 if [ ! -e "$RPM_INSTALL_PATH" ]; then
1057 RPM_INSTALL_PATH=http://${OPNFV_RPM_URL}
1060 RPM_LIST=$RPM_INSTALL_PATH
1061 for pkg in common undercloud; do
1062 RPM_LIST+=" ${RPM_INSTALL_PATH/opnfv-apex/opnfv-apex-${pkg}}"
1065 # update / install the new rpm
1066 if rpm -q opnfv-apex > /dev/null; then
1067 if [ $(basename $OPNFV_RPM_URL) == $(rpm -q opnfv-apex).rpm ]; then
1068 echo "RPM is already installed"
1069 elif sudo yum update -y $RPM_LIST | grep "does not update installed package"; then
1070 if ! sudo yum downgrade -y $RPM_LIST; then
1071 sudo yum remove -y opnfv-undercloud opnfv-common
1072 sudo yum downgrade -y $RPM_INSTALL_PATH
1076 sudo yum install -y $RPM_LIST;
1079 # cleanup environment before we start
1081 # initiate baremetal deployment
1082 if [ -e /etc/opnfv-apex/network_settings.yaml ]; then
1083 if [ -n "$DEPLOY_SCENARIO" ]; then
1084 echo "Deploy Scenario set to ${DEPLOY_SCENARIO}"
1085 if [ -e /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml ]; then
1086 sudo opnfv-deploy -i /root/inventory/pod_settings.yaml \
1087 -d /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml \
1088 -n /root/network/network_settings.yaml --debug
1090 echo "File does not exist /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml"
1094 echo "Deploy scenario not set!"
1098 echo "File /etc/opnfv-apex/network_settings.yaml does not exist!"
1103 echo "--------------------------------------------------------"
1106 #######################
1108 ########################
1112 - timed: '0 3 * * *'
1114 name: 'apex-brahmaputra'
1116 - timed: '0 3 * * *'
1118 name: 'apex-gs-clean-{stream}'
1120 - timed: '0 2 * * *'