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-noha'
55 - 'os-nosdn-nofeature-ha'
56 - 'os-odl_l2-nofeature-ha'
57 - 'os-odl_l2-bgpvpn-ha'
58 - 'os-odl_l2-sfc-noha'
59 - 'os-odl_l3-nofeature-ha'
60 - 'os-onos-nofeature-ha'
61 - 'os-ocl-nofeature-ha'
69 name: 'apex-verify-{stream2}'
75 gs-pathname: '{gs-pathname}'
82 default: https://gerrit.opnfv.org/gerrit/$PROJECT
83 description: "Used for overriding the GIT URL coming from parameters macro."
87 credentials-id: '{ssh-credentials}'
88 refspec: '$GERRIT_REFSPEC'
89 choosing-strategy: 'gerrit'
94 - patchset-created-event:
95 exclude-drafts: 'false'
96 exclude-trivial-rebase: 'false'
97 exclude-no-code-change: 'true'
98 - draft-published-event
99 - comment-added-contains-event:
100 comment-contains-value: 'recheck'
101 - comment-added-contains-event:
102 comment-contains-value: 'reverify'
104 - project-compare-type: 'ANT'
105 project-pattern: 'apex'
107 - branch-compare-type: 'ANT'
108 branch-pattern: '**/{branch}'
121 use-build-blocker: true
123 - 'apex-daily.*{stream2}'
124 - 'apex-deploy.*{stream2}'
125 - 'apex-build.*{stream2}'
126 - 'apex-runner.*{stream2}'
127 - 'apex-verify-{stream2}'
132 - project: 'apex-deploy-virtual-os-odl_l2-nofeature-ha-{stream2}'
133 predefined-parameters: |
134 BUILD_DIRECTORY=apex-verify-{stream2}/build_output
139 - project: 'apex-deploy-virtual-os-onos-nofeature-ha-{stream2}'
140 predefined-parameters: |
141 BUILD_DIRECTORY=apex-verify-{stream2}/build_output
146 - project: 'apex-deploy-virtual-os-odl_l3-nofeature-ha-{stream2}'
147 predefined-parameters: |
148 BUILD_DIRECTORY=apex-verify-{stream2}/build_output
153 - project: 'apex-deploy-virtual-os-odl_l2-sfc-noha-{stream2}'
154 predefined-parameters: |
155 BUILD_DIRECTORY=apex-verify-{stream2}/build_output
159 - 'apex-workspace-cleanup'
163 name: 'apex-verify-{stream1}'
165 node: '{verify-slave}'
171 gs-pathname: '{gs-pathname}'
178 default: https://gerrit.opnfv.org/gerrit/$PROJECT
179 description: "Used for overriding the GIT URL coming from parameters macro."
182 - gerrit-trigger-scm:
183 credentials-id: '{ssh-credentials}'
184 refspec: '$GERRIT_REFSPEC'
185 choosing-strategy: 'gerrit'
190 - patchset-created-event:
191 exclude-drafts: 'false'
192 exclude-trivial-rebase: 'false'
193 exclude-no-code-change: 'true'
194 - draft-published-event
195 - comment-added-contains-event:
196 comment-contains-value: 'recheck'
197 - comment-added-contains-event:
198 comment-contains-value: 'reverify'
200 - project-compare-type: 'ANT'
201 project-pattern: 'apex'
203 - branch-compare-type: 'ANT'
204 branch-pattern: '**/{branch}'
217 use-build-blocker: true
220 - 'apex-daily.*{stream1}'
221 - 'apex-deploy.*{stream1}'
222 - 'apex-build.*{stream1}'
223 - 'apex-runner.*{stream1}'
224 - 'apex-verify-{stream1}'
232 - project: 'apex-deploy-virtual-os-nosdn-nofeature-ha-{stream1}'
233 predefined-parameters: |
234 BUILD_DIRECTORY=apex-verify-{stream1}
240 # - project: 'functest-apex-{verify-slave}-suite-{stream1}'
241 # predefined-parameters: |
242 # DEPLOY_SCENARIO=os-nosdn-nofeature-ha
243 # FUNCTEST_SUITE_NAME=vping_userdata
247 - project: 'apex-deploy-virtual-os-odl_l2-nofeature-ha-{stream1}'
248 predefined-parameters: |
249 BUILD_DIRECTORY=apex-verify-{stream1}
254 - 'apex-workspace-cleanup'
257 name: 'apex-runner-{platform}-{scenario}-{stream}'
259 # runner jobs for deploying manually
267 gs-pathname: '{gs-pathname}'
274 default: https://gerrit.opnfv.org/gerrit/$PROJECT
275 description: "Used for overriding the GIT URL coming from parameters macro."
278 - gerrit-trigger-scm:
279 credentials-id: '{ssh-credentials}'
281 choosing-strategy: 'default'
285 use-build-blocker: true
287 - 'apex-daily.*{stream}'
288 - 'apex-verify.*{stream}'
292 - project: 'apex-deploy-{platform}-{scenario}-{stream}'
293 predefined-parameters:
298 - project: 'yardstick-apex-{slave}-daily-{stream}'
299 predefined-parameters:
300 DEPLOY_SCENARIO={scenario}
303 build-step-failure-threshold: 'never'
304 failure-threshold: 'never'
305 unstable-threshold: 'FAILURE'
307 - project: 'functest-apex-{slave}-daily-{stream}'
308 predefined-parameters:
309 DEPLOY_SCENARIO={scenario}
312 build-step-failure-threshold: 'never'
313 failure-threshold: 'never'
314 unstable-threshold: 'FAILURE'
317 name: 'apex-build-{stream}'
319 # Job template for builds
321 # Required Variables:
322 # stream: branch with - in place of / (eg. stable)
323 # branch: branch (eg. stable)
324 node: '{daily-slave}'
334 gs-pathname: '{gs-pathname}'
339 default: https://gerrit.opnfv.org/gerrit/$PROJECT
340 description: "Used for overriding the GIT URL coming from parameters macro."
344 credentials-id: '{ssh-credentials}'
350 use-build-blocker: true
353 - 'apex-deploy.*{stream}'
361 - project: 'apex-deploy-virtual-os-nosdn-nofeature-noha-{stream}'
362 predefined-parameters: |
363 BUILD_DIRECTORY=apex-build-{stream}/build
368 - 'apex-upload-artifact'
371 name: 'apex-deploy-virtual-{scenario}-{stream}'
373 # Job template for virtual deployment
375 # Required Variables:
376 # stream: branch with - in place of / (eg. stable)
377 # branch: branch (eg. stable)
386 credentials-id: '{ssh-credentials}'
394 gs-pathname: '{gs-pathname}'
396 name: DEPLOY_SCENARIO
397 default: '{scenario}'
398 description: "Scenario to deploy with."
402 description: "Use yes in lower case to invoke clean. Indicates if the deploy environment should be cleaned before deployment"
406 use-build-blocker: true
409 - 'apex-deploy.*{stream}'
415 - 'apex-deploy-virtual'
416 - 'apex-workspace-cleanup'
419 name: 'apex-deploy-baremetal-{scenario}-{stream}'
421 # Job template for baremetal deployment
423 # Required Variables:
424 # stream: branch with - in place of / (eg. stable)
425 # branch: branch (eg. stable)
432 credentials-id: '{ssh-credentials}'
440 gs-pathname: '{gs-pathname}'
442 name: DEPLOY_SCENARIO
443 default: '{scenario}'
444 description: "Scenario to deploy with."
448 use-build-blocker: true
450 - 'apex-verify.*{stream}'
451 - 'apex-deploy.*{stream}'
452 - 'apex-build.*{stream}'
456 - 'apex-deploy-baremetal'
457 - 'apex-workspace-cleanup'
461 name: 'apex-daily-{stream2}'
463 # Job template for daily build
465 # Required Variables:
466 # stream: branch with - in place of / (eg. stable)
467 # branch: branch (eg. stable)
474 credentials-id: '{ssh-credentials}'
482 gs-pathname: '{gs-pathname}'
486 use-build-blocker: true
488 - 'apex-verify.*{stream2}'
489 - 'apex-deploy.*{stream2}'
490 - 'apex-build.*{stream2}'
491 - 'apex-runner.*{stream2}'
498 - project: 'apex-build-{stream2}'
500 current-parameters: true
503 - project: 'apex-deploy-baremetal-os-odl_l2-nofeature-ha-{stream2}'
504 predefined-parameters: |
505 BUILD_DIRECTORY=apex-build-{stream2}/build_output
510 - project: 'functest-apex-{slave}-daily-{stream2}'
511 predefined-parameters:
512 DEPLOY_SCENARIO=os-odl_l2-nofeature-ha
515 build-step-failure-threshold: 'never'
516 failure-threshold: 'never'
517 unstable-threshold: 'FAILURE'
519 - project: 'yardstick-apex-{slave}-daily-{stream2}'
520 predefined-parameters:
521 DEPLOY_SCENARIO=os-odl_l2-nofeature-ha
524 build-step-failure-threshold: 'never'
525 failure-threshold: 'never'
526 unstable-threshold: 'FAILURE'
528 - project: 'apex-deploy-baremetal-os-onos-nofeature-ha-{stream2}'
529 predefined-parameters:
530 BUILD_DIRECTORY=apex-build-{stream2}/build_output
534 - project: 'functest-apex-{slave}-daily-{stream2}'
535 predefined-parameters:
536 DEPLOY_SCENARIO=os-onos-nofeature-ha
539 build-step-failure-threshold: 'never'
540 failure-threshold: 'never'
541 unstable-threshold: 'FAILURE'
543 - project: 'yardstick-apex-{slave}-daily-{stream2}'
544 predefined-parameters:
545 DEPLOY_SCENARIO=os-onos-nofeature-ha
548 build-step-failure-threshold: 'never'
549 failure-threshold: 'never'
550 unstable-threshold: 'FAILURE'
552 - project: 'apex-deploy-baremetal-os-odl_l3-nofeature-ha-{stream2}'
553 predefined-parameters:
554 BUILD_DIRECTORY=apex-build-{stream2}/build_output
558 - project: 'functest-apex-{slave}-daily-{stream2}'
559 predefined-parameters:
560 DEPLOY_SCENARIO=os-odl_l3-nofeature-ha
563 build-step-failure-threshold: 'never'
564 failure-threshold: 'never'
565 unstable-threshold: 'FAILURE'
567 - project: 'yardstick-apex-{slave}-daily-{stream2}'
568 predefined-parameters:
569 DEPLOY_SCENARIO=os-odl_l3-nofeature-ha
572 build-step-failure-threshold: 'never'
573 failure-threshold: 'never'
574 unstable-threshold: 'FAILURE'
576 - project: 'apex-deploy-baremetal-os-odl_l2-bgpvpn-ha-{stream2}'
577 predefined-parameters:
578 BUILD_DIRECTORY=apex-build-{stream2}/build_output
582 - project: 'functest-apex-{slave}-daily-{stream2}'
583 predefined-parameters:
584 DEPLOY_SCENARIO=os-odl_l2-bgpvpn-ha
587 build-step-failure-threshold: 'never'
588 failure-threshold: 'never'
589 unstable-threshold: 'FAILURE'
591 - project: 'yardstick-apex-{slave}-daily-{stream2}'
592 predefined-parameters:
593 DEPLOY_SCENARIO=os-odl_l2-bgpvpn-ha
596 build-step-failure-threshold: 'never'
597 failure-threshold: 'never'
598 unstable-threshold: 'FAILURE'
602 name: 'apex-daily-{stream1}'
604 # Job template for daily build
606 # Required Variables:
607 # stream: branch with - in place of / (eg. stable)
608 # branch: branch (eg. stable)
609 node: '{daily-slave}'
615 credentials-id: '{ssh-credentials}'
623 gs-pathname: '{gs-pathname}'
627 use-build-blocker: true
630 - 'apex-verify.*{stream1}'
631 - 'apex-deploy.*{stream1}'
632 - 'apex-build.*{stream1}'
633 - 'apex-runner.*{stream1}'
640 - project: 'apex-build-{stream1}'
642 current-parameters: true
646 - project: 'apex-deploy-baremetal-os-nosdn-nofeature-ha-{stream1}'
647 predefined-parameters: |
648 BUILD_DIRECTORY=apex-build-{stream1}/build
654 - project: 'functest-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'
664 - project: 'yardstick-apex-{slave}-daily-{stream1}'
665 predefined-parameters:
666 DEPLOY_SCENARIO=os-nosdn-nofeature-ha
670 build-step-failure-threshold: 'never'
671 failure-threshold: 'never'
672 unstable-threshold: 'FAILURE'
675 name: 'apex-gs-clean-{stream}'
677 # Job template for clean
679 # Required Variables:
680 # stream: branch with - in place of / (eg. stable)
689 gs-pathname: '{gs-pathname}'
695 - 'apex-gs-clean-{stream}'
698 ########################
700 ########################
707 description: "RPM Artifact name that will be appended to GS_URL to deploy a specific artifact"
709 name: ARTIFACT_VERSION
711 description: "Artifact version type"
713 name: BUILD_DIRECTORY
714 default: $WORKSPACE/build
715 description: "Directory where the build artifact will be located upon the completion of the build."
717 name: CACHE_DIRECTORY
718 default: $HOME/opnfv/cache{gs-pathname}
719 description: "Directory where the cache to be used during the build is located."
722 default: https://gerrit.opnfv.org/gerrit/$PROJECT
723 description: "Used for overriding the GIT URL coming from Global Jenkins configuration in case if the stuff is done on none-LF HW."
726 default: artifacts.opnfv.org/$PROJECT{gs-pathname}
727 description: "URL to Google Storage."
729 ########################
731 ########################
740 # log info to console
741 echo "Starting the build of Apex using OpenStack Master packages. This will take some time..."
742 echo "---------------------------------------------------------------------------------------"
744 # create the cache directory if it doesn't exist
745 [[ -d $CACHE_DIRECTORY ]] || mkdir -p $CACHE_DIRECTORY
746 # set OPNFV_ARTIFACT_VERSION
747 if echo $BUILD_TAG | grep "apex-verify" 1> /dev/null; then
748 if echo $GERRIT_BRANCH | grep "brahmaputra" 1> /dev/null; then
749 export OPNFV_ARTIFACT_VERSION=brahmaputra-dev${BUILD_NUMBER}
750 export BUILD_ARGS="-v $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY $BUILD_DIRECTORY"
752 export OPNFV_ARTIFACT_VERSION=dev${BUILD_NUMBER}
753 export BUILD_ARGS="-r $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY"
755 elif [ "$ARTIFACT_VERSION" == "daily" ]; then
756 if echo $GERRIT_BRANCH | grep "brahmaputra" 1> /dev/null; then
757 export OPNFV_ARTIFACT_VERSION=brahmaputra-$(date -u +"%Y-%m-%d")
758 export BUILD_ARGS="-v $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY $BUILD_DIRECTORY"
760 export OPNFV_ARTIFACT_VERSION=$(date -u +"%Y-%m-%d")
761 export BUILD_ARGS="-r $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY --iso"
764 export OPNFV_ARTIFACT_VERSION=${ARTIFACT_VERSION}
765 if echo $GERRIT_BRANCH | grep "brahmaputra" 1> /dev/null; then
766 export BUILD_ARGS="-v $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY $BUILD_DIRECTORY"
768 export BUILD_ARGS="-r $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY --iso"
771 # clean for stable but doesn't matter for master
772 if echo $GERRIT_BRANCH | grep "brahmaputra" 1> /dev/null; then
777 ./build.sh $BUILD_ARGS
778 RPM_VERSION=$(grep Version: $BUILD_DIRECTORY/opnfv-apex.spec | awk '{ print $2 }')-$(echo $OPNFV_ARTIFACT_VERSION | tr -d '_-')
779 # list the contents of BUILD_OUTPUT directory
780 ls -al $BUILD_DIRECTORY
781 # save information regarding artifact into file
783 echo "OPNFV_ARTIFACT_VERSION=$OPNFV_ARTIFACT_VERSION"
784 echo "OPNFV_GIT_URL=$(git config --get remote.origin.url)"
785 echo "OPNFV_GIT_SHA1=$(git rev-parse HEAD)"
786 echo "OPNFV_ARTIFACT_URL=$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
787 echo "OPNFV_ARTIFACT_MD5SUM=$(md5sum $BUILD_DIRECTORY/release/OPNFV-CentOS-7-x86_64-$OPNFV_ARTIFACT_VERSION.iso | cut -d' ' -f1)"
788 echo "OPNFV_SRPM_URL=$GS_URL/opnfv-apex-$RPM_VERSION.src.rpm"
789 echo "OPNFV_RPM_URL=$GS_URL/opnfv-apex-$RPM_VERSION.noarch.rpm"
790 echo "OPNFV_RPM_MD5SUM=$(md5sum $BUILD_DIRECTORY/noarch/opnfv-apex-$RPM_VERSION.noarch.rpm | cut -d' ' -f1)"
791 echo "OPNFV_BUILD_URL=$BUILD_URL"
792 ) > $WORKSPACE/opnfv.properties
793 echo "--------------------------------------------------------"
797 name: 'apex-workspace-cleanup'
805 # delete everything that is in $WORKSPACE
806 sudo /bin/rm -rf $WORKSPACE
809 name: 'apex-upload-artifact'
817 # log info to console
818 echo "Uploading the Apex artifact. This could take some time..."
819 echo "--------------------------------------------------------"
822 # source the opnfv.properties to get ARTIFACT_VERSION
823 source $WORKSPACE/opnfv.properties
825 # upload artifact and additional files to google storage
826 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
827 RPM_INSTALL_PATH=$BUILD_DIRECTORY/noarch
828 RPM_LIST=$RPM_INSTALL_PATH/$(basename $OPNFV_RPM_URL)
829 VERSION_EXTENSION=$(echo $(basename $OPNFV_RPM_URL) | sed 's/opnfv-apex-//')
830 for pkg in common undercloud opendaylight-sfc onos; do
831 RPM_LIST+=" ${RPM_INSTALL_PATH}/opnfv-apex-${pkg}-${VERSION_EXTENSION}"
833 SRPM_INSTALL_PATH=$BUILD_DIRECTORY
834 SRPM_LIST=$SRPM_INSTALL_PATH/$(basename $OPNFV_SRPM_URL)
835 for pkg in common undercloud opendaylight-sfc onos; do
836 SRPM_LIST+=" ${SRPM_INSTALL_PATH}/opnfv-apex-${pkg}-${VERSION_EXTENSION}"
838 for artifact in $RPM_LIST $SRPM_LIST; do
839 gsutil cp $artifact gs://$GS_URL/$(basename $artifact) > gsutil.iso.log 2>&1
841 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.properties > gsutil.properties.log 2>&1
842 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/latest.properties > gsutil.latest.log 2>&1
845 echo "--------------------------------------------------------"
847 echo "ISO Artifact is available as http://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
848 echo "RPM Artifact is available as http://$GS_URL/$(basename $OPNFV_RPM_URL)"
851 name: 'apex-gs-cleanup'
859 # log info to console
860 echo "Cleaning Google Storage"
861 echo "-----------------------"
864 thirty_days_ago=$(date -d "30 days ago" +"%Y%m%d")
866 for i in $(gsutil ls gs://$GS_URL/*201?*); do
867 filedate=$(date -d "$(echo $i | grep -Eo 201[0-9]-?[0-9][0-9]-?[0-9][0-9])" +"%Y%m%d")
868 if [ $filedate -lt $thirty_days_ago ]; then
869 # gsutil indicates what it is removing so no need for output here
875 name: 'apex-deploy-virtual'
883 # log info to console
884 echo "Starting the Apex virtual deployment."
885 echo "--------------------------------------------------------"
888 if [[ $BUILD_DIRECTORY == *verify-master* ]]; then
889 cd $WORKSPACE/../${BUILD_DIRECTORY/build_output/}
891 echo "WORKSPACE modified to $WORKSPACE"
893 elif [[ ! "$ARTIFACT_NAME" == "latest" ]]; then
894 # if artifact name is passed the pull a
895 # specific artifact from artifacts.opnfv.org
896 RPM_INSTALL_PATH=$GS_URL
897 RPM_LIST=$RPM_INSTALL_PATH/$ARTIFACT_NAME
899 if [[ $BUILD_DIRECTORY == *verify* ]]; then
900 BUILD_DIRECTORY=$WORKSPACE/../$BUILD_DIRECTORY
901 echo "BUILD DIRECTORY modified to $BUILD_DIRECTORY"
902 elif [[ $BUILD_DIRECTORY == *apex-build* ]]; then
903 BUILD_DIRECTORY=$WORKSPACE/../$BUILD_DIRECTORY
904 echo "BUILD DIRECTORY modified to $BUILD_DIRECTORY"
907 if [[ -f ${BUILD_DIRECTORY}/../opnfv.properties ]]; then
908 # if opnfv.properties exists then use the
909 # local build. Source the file so we get local OPNFV vars
910 source ${BUILD_DIRECTORY}/../opnfv.properties
911 RPM_INSTALL_PATH=${BUILD_DIRECTORY}/noarch
912 RPM_LIST=$RPM_INSTALL_PATH/$(basename $OPNFV_RPM_URL)
914 if [[ $BUILD_DIRECTORY == *verify* ]]; then
915 echo "BUILD_DIRECTORY is from a verify job, so will not use latest from URL"
916 echo "Check that the slave has opnfv.properties in $BUILD_DIRECTORY"
918 elif [[ $BUILD_DIRECTORY == *apex-build* ]]; then
919 echo "BUILD_DIRECTORY is from a daily job, so will not use latest from URL"
920 echo "Check that the slave has opnfv.properties in $BUILD_DIRECTORY"
923 # no opnfv.properties means use the latest from artifacts.opnfv.org
924 # get the latest.properties to get the link to the latest artifact
925 curl -s -o $WORKSPACE/opnfv.properties http://$GS_URL/latest.properties
926 [[ -f opnfv.properties ]] || exit 1
927 # source the file so we get OPNFV vars
928 source opnfv.properties
929 RPM_INSTALL_PATH=$(echo $OPNFV_RPM_URL | sed 's/'"$(basename $OPNFV_RPM_URL)"'//')
930 RPM_LIST=$RPM_INSTALL_PATH/$(basename $OPNFV_RPM_URL)
934 if [ -z "$DEPLOY_SCENARIO" ]; then
935 echo "Deploy scenario not set!"
939 # use local build for verify
940 if [[ $BUILD_DIRECTORY == *verify-master* ]]; then
941 if [ ! -e "${WORKSPACE}/build/lib" ]; then ln -s ${WORKSPACE}/lib ${WORKSPACE}/build/lib; fi
942 DEPLOY_CMD="CONFIG=${WORKSPACE}/build RESOURCES=${WORKSPACE}/build/images/ ./deploy.sh -c ${WORKSPACE}/build -r ${WORKSPACE}/build/images/"
943 DEPLOY_FILE="${WORKSPACE}/config/deploy/${DEPLOY_SCENARIO}.yaml"
944 NETWORK_FILE="${WORKSPACE}/config/network/network_settings.yaml"
945 # Make sure python34 is installed
946 if ! rpm -q python34 > /dev/null; then
947 sudo yum install -y epel-release
948 if ! sudo yum install -y python34; then
949 echo "Failed to install python34"
953 if ! rpm -q python34-PyYAML > /dev/null; then
954 sudo yum install -y epel-release
955 if ! sudo yum install -y python34-PyYAML; then
956 echo "Failed to install python34-PyYAML"
960 if ! rpm -q python34-setuptools > /dev/null; then
961 if ! sudo yum install -y python34-setuptools; then
962 echo "Failed to install python34-setuptools"
966 if [ -z ${PYTHONPATH:-} ]; then
967 export PYTHONPATH=${WORKSPACE}/lib/python
969 export PYTHONPATH=$PYTHONPATH:${WORKSPACE}/lib/python
972 VERSION_EXTENSION=$(echo $(basename $RPM_LIST) | sed 's/opnfv-apex-//')
973 for pkg in common undercloud opendaylight-sfc onos; do
974 RPM_LIST+=" ${RPM_INSTALL_PATH}/opnfv-apex-${pkg}-${VERSION_EXTENSION}"
977 # update / install the new rpm
978 if rpm -q opnfv-apex > /dev/null; then
979 INSTALLED_RPMS=$(rpm -qa | grep apex)
980 for x in $INSTALLED_RPMS; do
981 INSTALLED_RPM_VER=$(echo $x | sed 's/opnfv-apex-//').rpm
982 # Does each RPM's version match the version required for deployment
983 if [ "$INSTALLED_RPM_VER" == "$VERSION_EXTENSION" ]; then
984 echo "RPM $x is already installed"
986 echo "RPM $x does not match $VERSION_EXTENSION"
987 echo "Will upgrade/downgrade RPMs..."
988 # Try to upgrade/downgrade RPMS
989 if sudo yum update -y $RPM_LIST | grep "does not update installed package"; then
990 if ! sudo yum downgrade -y $RPM_LIST; then
991 sudo yum remove -y opnfv-apex-undercloud opnfv-apex-common opnfv-apex-opendaylight-sfc opnfv-apex-onos
992 sudo yum downgrade -y $RPM_INSTALL_PATH
999 sudo yum install -y $RPM_LIST;
1001 DEPLOY_CMD=opnfv-deploy
1002 DEPLOY_FILE="/etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml"
1003 NETWORK_FILE="/etc/opnfv-apex/network_settings.yaml"
1004 export RESOURCES="/var/opt/opnfv/images"
1005 export CONFIG="/var/opt/opnfv"
1008 if [ "$OPNFV_CLEAN" == 'yes' ]; then
1009 if [[ $BUILD_DIRECTORY == *verify-master* ]]; then
1010 sudo CONFIG=${WORKSPACE}/build ./clean.sh
1015 # initiate virtual deployment
1016 echo "Deploy Scenario set to ${DEPLOY_SCENARIO}"
1017 if [ -e $DEPLOY_FILE ]; then
1018 sudo $DEPLOY_CMD -v -d ${DEPLOY_FILE} -n $NETWORK_FILE --debug
1020 echo "File does not exist /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml"
1024 echo "--------------------------------------------------------"
1028 name: 'apex-deploy-baremetal'
1036 # log info to console
1037 echo "Starting the Apex baremetal deployment."
1038 echo "--------------------------------------------------------"
1041 if [[ ! "$ARTIFACT_NAME" == "latest" ]]; then
1042 # if artifact name is passed the pull a
1043 # specific artifact from artifacts.opnfv.org
1044 RPM_INSTALL_PATH=$GS_URL/$ARTIFACT_NAME
1046 if [[ $BUILD_DIRECTORY == *apex-build* ]]; then
1047 BUILD_DIRECTORY=$WORKSPACE/../$BUILD_DIRECTORY
1048 echo "BUILD DIRECTORY modified to $BUILD_DIRECTORY"
1050 if [[ -f ${BUILD_DIRECTORY}/../opnfv.properties ]]; then
1051 # if opnfv.properties exists then use the
1052 # local build. Source the file so we get local OPNFV vars
1053 source ${BUILD_DIRECTORY}/../opnfv.properties
1054 RPM_INSTALL_PATH=${BUILD_DIRECTORY}/$(basename $OPNFV_RPM_URL)
1056 # no opnfv.properties means use the latest from artifacts.opnfv.org
1057 # get the latest.properties to get the link to the latest artifact
1058 curl -s -o $WORKSPACE/opnfv.properties http://$GS_URL/latest.properties
1059 [[ -f opnfv.properties ]] || exit 1
1060 # source the file so we get OPNFV vars
1061 source opnfv.properties
1062 RPM_INSTALL_PATH=$OPNFV_RPM_URL
1066 if [ ! -e "$RPM_INSTALL_PATH" ]; then
1067 RPM_INSTALL_PATH=http://${OPNFV_RPM_URL}
1070 RPM_LIST=$RPM_INSTALL_PATH
1071 for pkg in common undercloud; do
1072 RPM_LIST+=" ${RPM_INSTALL_PATH/opnfv-apex/opnfv-apex-${pkg}}"
1075 # update / install the new rpm
1076 if rpm -q opnfv-apex > /dev/null; then
1077 if [ $(basename $OPNFV_RPM_URL) == $(rpm -q opnfv-apex).rpm ]; then
1078 echo "RPM is already installed"
1079 elif sudo yum update -y $RPM_LIST | grep "does not update installed package"; then
1080 if ! sudo yum downgrade -y $RPM_LIST; then
1081 sudo yum remove -y opnfv-undercloud opnfv-common
1082 sudo yum downgrade -y $RPM_INSTALL_PATH
1086 sudo yum install -y $RPM_LIST;
1089 # cleanup environment before we start
1091 # initiate baremetal deployment
1092 if [ -e /etc/opnfv-apex/network_settings.yaml ]; then
1093 if [ -n "$DEPLOY_SCENARIO" ]; then
1094 echo "Deploy Scenario set to ${DEPLOY_SCENARIO}"
1095 if [ -e /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml ]; then
1096 sudo opnfv-deploy -i /root/inventory/pod_settings.yaml \
1097 -d /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml \
1098 -n /root/network/network_settings.yaml --debug
1100 echo "File does not exist /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml"
1104 echo "Deploy scenario not set!"
1108 echo "File /etc/opnfv-apex/network_settings.yaml does not exist!"
1113 echo "--------------------------------------------------------"
1116 #######################
1118 ########################
1122 - timed: '0 3 * * *'
1124 name: 'apex-brahmaputra'
1126 - timed: '0 3 * * *'
1128 name: 'apex-gs-clean-{stream}'
1130 - timed: '0 2 * * *'