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
216 - 'apex-daily.*{stream1}'
217 - 'apex-deploy.*{stream1}'
218 - 'apex-build.*{stream1}'
219 - 'apex-runner.*{stream1}'
220 - 'apex-verify-{stream1}'
225 - project: 'apex-deploy-virtual-os-nosdn-nofeature-ha-{stream1}'
226 predefined-parameters: |
227 BUILD_DIRECTORY=apex-verify-{stream1}
233 # - project: 'functest-apex-{slave}-suite-{stream1}'
234 # predefined-parameters: |
235 # DEPLOY_SCENARIO=os-nosdn-nofeature-ha
236 # FUNCTEST_SUITE_NAME=vping_userdata
239 - project: 'apex-deploy-virtual-os-odl_l2-nofeature-ha-{stream1}'
240 predefined-parameters: |
241 BUILD_DIRECTORY=apex-verify-{stream1}
246 - 'apex-workspace-cleanup'
249 name: 'apex-runner-{platform}-{scenario}-{stream}'
251 # runner jobs for deploying manually
259 gs-pathname: '{gs-pathname}'
266 default: https://gerrit.opnfv.org/gerrit/$PROJECT
267 description: "Used for overriding the GIT URL coming from parameters macro."
270 - gerrit-trigger-scm:
271 credentials-id: '{ssh-credentials}'
273 choosing-strategy: 'default'
277 use-build-blocker: true
279 - 'apex-daily.*{stream}'
280 - 'apex-verify.*{stream}'
284 - project: 'apex-deploy-{platform}-{scenario}-{stream}'
285 predefined-parameters:
290 - project: 'yardstick-apex-{slave}-daily-{stream}'
291 predefined-parameters:
292 DEPLOY_SCENARIO={scenario}
295 build-step-failure-threshold: 'never'
296 failure-threshold: 'never'
297 unstable-threshold: 'FAILURE'
299 - project: 'functest-apex-{slave}-daily-{stream}'
300 predefined-parameters:
301 DEPLOY_SCENARIO={scenario}
304 build-step-failure-threshold: 'never'
305 failure-threshold: 'never'
306 unstable-threshold: 'FAILURE'
309 name: 'apex-build-{stream}'
311 # Job template for builds
313 # Required Variables:
314 # stream: branch with - in place of / (eg. stable)
315 # branch: branch (eg. stable)
324 gs-pathname: '{gs-pathname}'
329 default: https://gerrit.opnfv.org/gerrit/$PROJECT
330 description: "Used for overriding the GIT URL coming from parameters macro."
334 credentials-id: '{ssh-credentials}'
340 use-build-blocker: true
342 - 'apex-deploy.*{stream}'
347 - project: 'apex-deploy-virtual-os-nosdn-nofeature-ha-{stream}'
348 predefined-parameters: |
349 BUILD_DIRECTORY=apex-build-{stream}/build
353 - 'apex-upload-artifact'
356 name: 'apex-deploy-virtual-{scenario}-{stream}'
358 # Job template for virtual deployment
360 # Required Variables:
361 # stream: branch with - in place of / (eg. stable)
362 # branch: branch (eg. stable)
369 credentials-id: '{ssh-credentials}'
377 gs-pathname: '{gs-pathname}'
379 name: DEPLOY_SCENARIO
380 default: '{scenario}'
381 description: "Scenario to deploy with."
385 description: "Use yes in lower case to invoke clean. Indicates if the deploy environment should be cleaned before deployment"
389 use-build-blocker: true
391 - 'apex-deploy.*{stream}'
394 - 'apex-deploy-virtual'
395 - 'apex-workspace-cleanup'
398 name: 'apex-deploy-baremetal-{scenario}-{stream}'
400 # Job template for baremetal deployment
402 # Required Variables:
403 # stream: branch with - in place of / (eg. stable)
404 # branch: branch (eg. stable)
411 credentials-id: '{ssh-credentials}'
419 gs-pathname: '{gs-pathname}'
421 name: DEPLOY_SCENARIO
422 default: '{scenario}'
423 description: "Scenario to deploy with."
427 use-build-blocker: true
429 - 'apex-verify.*{stream}'
430 - 'apex-deploy.*{stream}'
431 - 'apex-build.*{stream}'
435 - 'apex-deploy-baremetal'
436 - 'apex-workspace-cleanup'
440 name: 'apex-daily-{stream2}'
442 # Job template for daily build
444 # Required Variables:
445 # stream: branch with - in place of / (eg. stable)
446 # branch: branch (eg. stable)
453 credentials-id: '{ssh-credentials}'
461 gs-pathname: '{gs-pathname}'
465 use-build-blocker: true
467 - 'apex-verify.*{stream2}'
468 - 'apex-deploy.*{stream2}'
469 - 'apex-build.*{stream2}'
470 - 'apex-runner.*{stream2}'
477 - project: 'apex-build-{stream2}'
479 current-parameters: true
482 - project: 'apex-deploy-baremetal-os-odl_l2-nofeature-ha-{stream2}'
483 predefined-parameters: |
484 BUILD_DIRECTORY=apex-build-{stream2}/build_output
489 - project: 'functest-apex-{slave}-daily-{stream2}'
490 predefined-parameters:
491 DEPLOY_SCENARIO=os-odl_l2-nofeature-ha
494 build-step-failure-threshold: 'never'
495 failure-threshold: 'never'
496 unstable-threshold: 'FAILURE'
498 - project: 'yardstick-apex-{slave}-daily-{stream2}'
499 predefined-parameters:
500 DEPLOY_SCENARIO=os-odl_l2-nofeature-ha
503 build-step-failure-threshold: 'never'
504 failure-threshold: 'never'
505 unstable-threshold: 'FAILURE'
507 - project: 'apex-deploy-baremetal-os-onos-nofeature-ha-{stream2}'
508 predefined-parameters:
509 BUILD_DIRECTORY=apex-build-{stream2}/build_output
513 - project: 'functest-apex-{slave}-daily-{stream2}'
514 predefined-parameters:
515 DEPLOY_SCENARIO=os-onos-nofeature-ha
518 build-step-failure-threshold: 'never'
519 failure-threshold: 'never'
520 unstable-threshold: 'FAILURE'
522 - project: 'yardstick-apex-{slave}-daily-{stream2}'
523 predefined-parameters:
524 DEPLOY_SCENARIO=os-onos-nofeature-ha
527 build-step-failure-threshold: 'never'
528 failure-threshold: 'never'
529 unstable-threshold: 'FAILURE'
531 - project: 'apex-deploy-baremetal-os-odl_l3-nofeature-ha-{stream2}'
532 predefined-parameters:
533 BUILD_DIRECTORY=apex-build-{stream2}/build_output
537 - project: 'functest-apex-{slave}-daily-{stream2}'
538 predefined-parameters:
539 DEPLOY_SCENARIO=os-odl_l3-nofeature-ha
542 build-step-failure-threshold: 'never'
543 failure-threshold: 'never'
544 unstable-threshold: 'FAILURE'
546 - project: 'yardstick-apex-{slave}-daily-{stream2}'
547 predefined-parameters:
548 DEPLOY_SCENARIO=os-odl_l3-nofeature-ha
551 build-step-failure-threshold: 'never'
552 failure-threshold: 'never'
553 unstable-threshold: 'FAILURE'
555 - project: 'apex-deploy-baremetal-os-odl_l2-bgpvpn-ha-{stream2}'
556 predefined-parameters:
557 BUILD_DIRECTORY=apex-build-{stream2}/build_output
561 - project: 'functest-apex-{slave}-daily-{stream2}'
562 predefined-parameters:
563 DEPLOY_SCENARIO=os-odl_l2-bgpvpn-ha
566 build-step-failure-threshold: 'never'
567 failure-threshold: 'never'
568 unstable-threshold: 'FAILURE'
570 - project: 'yardstick-apex-{slave}-daily-{stream2}'
571 predefined-parameters:
572 DEPLOY_SCENARIO=os-odl_l2-bgpvpn-ha
575 build-step-failure-threshold: 'never'
576 failure-threshold: 'never'
577 unstable-threshold: 'FAILURE'
581 name: 'apex-daily-{stream1}'
583 # Job template for daily build
585 # Required Variables:
586 # stream: branch with - in place of / (eg. stable)
587 # branch: branch (eg. stable)
588 node: '{daily-slave}'
594 credentials-id: '{ssh-credentials}'
602 gs-pathname: '{gs-pathname}'
606 use-build-blocker: true
608 - 'apex-verify.*{stream1}'
609 - 'apex-deploy.*{stream1}'
610 - 'apex-build.*{stream1}'
611 - 'apex-runner.*{stream1}'
618 - project: 'apex-build-{stream1}'
620 current-parameters: true
623 - project: 'apex-deploy-virtual-nosdn-nofeature-ha-{stream1}'
624 predefined-parameters: |
625 BUILD_DIRECTORY=apex-build-{stream1}/build
631 - project: 'functest-apex-{slave}-daily-{stream1}'
632 predefined-parameters:
633 DEPLOY_SCENARIO=os-nosdn-nofeature-ha
637 build-step-failure-threshold: 'never'
638 failure-threshold: 'never'
639 unstable-threshold: 'FAILURE'
641 - project: 'yardstick-apex-{slave}-daily-{stream1}'
642 predefined-parameters:
643 DEPLOY_SCENARIO=os-nosdn-nofeature-ha
647 build-step-failure-threshold: 'never'
648 failure-threshold: 'never'
649 unstable-threshold: 'FAILURE'
652 name: 'apex-gs-clean-{stream}'
654 # Job template for clean
656 # Required Variables:
657 # stream: branch with - in place of / (eg. stable)
666 gs-pathname: '{gs-pathname}'
672 - 'apex-gs-clean-{stream}'
675 ########################
677 ########################
684 description: "RPM Artifact name that will be appended to GS_URL to deploy a specific artifact"
686 name: ARTIFACT_VERSION
688 description: "Artifact version type"
690 name: BUILD_DIRECTORY
691 default: $WORKSPACE/build
692 description: "Directory where the build artifact will be located upon the completion of the build."
694 name: CACHE_DIRECTORY
695 default: $HOME/opnfv/cache{gs-pathname}
696 description: "Directory where the cache to be used during the build is located."
699 default: https://gerrit.opnfv.org/gerrit/$PROJECT
700 description: "Used for overriding the GIT URL coming from Global Jenkins configuration in case if the stuff is done on none-LF HW."
703 default: artifacts.opnfv.org/$PROJECT{gs-pathname}
704 description: "URL to Google Storage."
706 ########################
708 ########################
717 # log info to console
718 echo "Starting the build of Apex using OpenStack Master packages. This will take some time..."
719 echo "---------------------------------------------------------------------------------------"
721 # create the cache directory if it doesn't exist
722 [[ -d $CACHE_DIRECTORY ]] || mkdir -p $CACHE_DIRECTORY
723 # set OPNFV_ARTIFACT_VERSION
724 if echo $BUILD_TAG | grep "apex-verify" 1> /dev/null; then
725 if echo $GERRIT_BRANCH | grep "brahmaputra" 1> /dev/null; then
726 export OPNFV_ARTIFACT_VERSION=brahmaputra-dev${BUILD_NUMBER}
727 export BUILD_ARGS="-v $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY $BUILD_DIRECTORY"
729 export OPNFV_ARTIFACT_VERSION=dev${BUILD_NUMBER}
730 export BUILD_ARGS="-r $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY"
732 elif [ "$ARTIFACT_VERSION" == "daily" ]; then
733 if echo $GERRIT_BRANCH | grep "brahmaputra" 1> /dev/null; then
734 export OPNFV_ARTIFACT_VERSION=brahmaputra-$(date -u +"%Y-%m-%d")
735 export BUILD_ARGS="-v $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY $BUILD_DIRECTORY"
737 export OPNFV_ARTIFACT_VERSION=$(date -u +"%Y-%m-%d")
738 export BUILD_ARGS="-r $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY --iso"
741 export OPNFV_ARTIFACT_VERSION=${ARTIFACT_VERSION}
742 if echo $GERRIT_BRANCH | grep "brahmaputra" 1> /dev/null; then
743 export BUILD_ARGS="-v $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY $BUILD_DIRECTORY"
745 export BUILD_ARGS="-r $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY --iso"
748 # clean for stable but doesn't matter for master
749 if echo $GERRIT_BRANCH | grep "brahmaputra" 1> /dev/null; then
754 ./build.sh $BUILD_ARGS
755 RPM_VERSION=$(grep Version: $BUILD_DIRECTORY/opnfv-apex.spec | awk '{ print $2 }')-$(echo $OPNFV_ARTIFACT_VERSION | tr -d '_-')
756 # list the contents of BUILD_OUTPUT directory
757 ls -al $BUILD_DIRECTORY
758 # save information regarding artifact into file
760 echo "OPNFV_ARTIFACT_VERSION=$OPNFV_ARTIFACT_VERSION"
761 echo "OPNFV_GIT_URL=$(git config --get remote.origin.url)"
762 echo "OPNFV_GIT_SHA1=$(git rev-parse HEAD)"
763 echo "OPNFV_ARTIFACT_URL=$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
764 echo "OPNFV_ARTIFACT_MD5SUM=$(md5sum $BUILD_DIRECTORY/release/OPNFV-CentOS-7-x86_64-$OPNFV_ARTIFACT_VERSION.iso | cut -d' ' -f1)"
765 echo "OPNFV_SRPM_URL=$GS_URL/opnfv-apex-$RPM_VERSION.src.rpm"
766 echo "OPNFV_RPM_URL=$GS_URL/opnfv-apex-$RPM_VERSION.noarch.rpm"
767 echo "OPNFV_RPM_MD5SUM=$(md5sum $BUILD_DIRECTORY/noarch/opnfv-apex-$RPM_VERSION.noarch.rpm | cut -d' ' -f1)"
768 echo "OPNFV_BUILD_URL=$BUILD_URL"
769 ) > $WORKSPACE/opnfv.properties
770 echo "--------------------------------------------------------"
774 name: 'apex-workspace-cleanup'
782 # delete everything that is in $WORKSPACE
783 sudo /bin/rm -rf $WORKSPACE
786 name: 'apex-upload-artifact'
794 # log info to console
795 echo "Uploading the Apex artifact. This could take some time..."
796 echo "--------------------------------------------------------"
799 # source the opnfv.properties to get ARTIFACT_VERSION
800 source $WORKSPACE/opnfv.properties
802 # upload artifact and additional files to google storage
803 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
804 RPM_INSTALL_PATH=$BUILD_DIRECTORY/noarch
805 RPM_LIST=$RPM_INSTALL_PATH/$(basename $OPNFV_RPM_URL)
806 VERSION_EXTENSION=$(echo $(basename $OPNFV_RPM_URL) | sed 's/opnfv-apex-//')
807 for pkg in common undercloud opendaylight-sfc onos; do
808 RPM_LIST+=" ${RPM_INSTALL_PATH}/opnfv-apex-${pkg}-${VERSION_EXTENSION}"
810 SRPM_INSTALL_PATH=$BUILD_DIRECTORY
811 SRPM_LIST=$SRPM_INSTALL_PATH/$(basename $OPNFV_SRPM_URL)
812 for pkg in common undercloud opendaylight-sfc onos; do
813 SRPM_LIST+=" ${SRPM_INSTALL_PATH}/opnfv-apex-${pkg}-${VERSION_EXTENSION}"
815 for artifact in $RPM_LIST $SRPM_LIST; do
816 gsutil cp $artifact gs://$GS_URL/$(basename $artifact) > gsutil.iso.log 2>&1
818 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.properties > gsutil.properties.log 2>&1
819 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/latest.properties > gsutil.latest.log 2>&1
822 echo "--------------------------------------------------------"
824 echo "ISO Artifact is available as http://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
825 echo "RPM Artifact is available as http://$GS_URL/$(basename $OPNFV_RPM_URL)"
828 name: 'apex-gs-cleanup'
836 # log info to console
837 echo "Cleaning Google Storage"
838 echo "-----------------------"
841 thirty_days_ago=$(date -d "30 days ago" +"%Y%m%d")
843 for i in $(gsutil ls gs://$GS_URL/*201?*); do
844 filedate=$(date -d "$(echo $i | grep -Eo 201[0-9]-?[0-9][0-9]-?[0-9][0-9])" +"%Y%m%d")
845 if [ $filedate -lt $thirty_days_ago ]; then
846 # gsutil indicates what it is removing so no need for output here
852 name: 'apex-deploy-virtual'
860 # log info to console
861 echo "Starting the Apex virtual deployment."
862 echo "--------------------------------------------------------"
865 if [[ $BUILD_DIRECTORY == *verify-master* ]]; then
866 cd $WORKSPACE/../${BUILD_DIRECTORY/build_output/}
868 echo "WORKSPACE modified to $WORKSPACE"
870 elif [[ ! "$ARTIFACT_NAME" == "latest" ]]; then
871 # if artifact name is passed the pull a
872 # specific artifact from artifacts.opnfv.org
873 RPM_INSTALL_PATH=$GS_URL
874 RPM_LIST=$RPM_INSTALL_PATH/$ARTIFACT_NAME
876 if [[ $BUILD_DIRECTORY == *verify* ]]; then
877 BUILD_DIRECTORY=$WORKSPACE/../$BUILD_DIRECTORY
878 echo "BUILD DIRECTORY modified to $BUILD_DIRECTORY"
879 elif [[ $BUILD_DIRECTORY == *apex-build* ]]; then
880 BUILD_DIRECTORY=$WORKSPACE/../$BUILD_DIRECTORY
881 echo "BUILD DIRECTORY modified to $BUILD_DIRECTORY"
884 if [[ -f ${BUILD_DIRECTORY}/../opnfv.properties ]]; then
885 # if opnfv.properties exists then use the
886 # local build. Source the file so we get local OPNFV vars
887 source ${BUILD_DIRECTORY}/../opnfv.properties
888 RPM_INSTALL_PATH=${BUILD_DIRECTORY}/noarch
889 RPM_LIST=$RPM_INSTALL_PATH/$(basename $OPNFV_RPM_URL)
891 if [[ $BUILD_DIRECTORY == *verify* ]]; then
892 echo "BUILD_DIRECTORY is from a verify job, so will not use latest from URL"
893 echo "Check that the slave has opnfv.properties in $BUILD_DIRECTORY"
895 elif [[ $BUILD_DIRECTORY == *apex-build* ]]; then
896 echo "BUILD_DIRECTORY is from a daily job, so will not use latest from URL"
897 echo "Check that the slave has opnfv.properties in $BUILD_DIRECTORY"
900 # no opnfv.properties means use the latest from artifacts.opnfv.org
901 # get the latest.properties to get the link to the latest artifact
902 curl -s -o $WORKSPACE/opnfv.properties http://$GS_URL/latest.properties
903 [[ -f opnfv.properties ]] || exit 1
904 # source the file so we get OPNFV vars
905 source opnfv.properties
906 RPM_INSTALL_PATH=$(echo $OPNFV_RPM_URL | sed 's/'"$(basename $OPNFV_RPM_URL)"'//')
907 RPM_LIST=$RPM_INSTALL_PATH/$(basename $OPNFV_RPM_URL)
911 if [ -z "$DEPLOY_SCENARIO" ]; then
912 echo "Deploy scenario not set!"
916 # use local build for verify
917 if [[ $BUILD_DIRECTORY == *verify-master* ]]; then
918 if [ ! -e "${WORKSPACE}/build/lib" ]; then ln -s ${WORKSPACE}/lib ${WORKSPACE}/build/lib; fi
919 DEPLOY_CMD="CONFIG=${WORKSPACE}/build RESOURCES=${WORKSPACE}/build/images/ ./deploy.sh -c ${WORKSPACE}/build -r ${WORKSPACE}/build/images/"
920 DEPLOY_FILE="${WORKSPACE}/config/deploy/${DEPLOY_SCENARIO}.yaml"
921 NETWORK_FILE="${WORKSPACE}/config/network/network_settings.yaml"
922 # Make sure python34 is installed
923 if ! rpm -q python34 > /dev/null; then
924 sudo yum install -y epel-release
925 if ! sudo yum install -y python34; then
926 echo "Failed to install python34"
930 if ! rpm -q python34-PyYAML > /dev/null; then
931 sudo yum install -y epel-release
932 if ! sudo yum install -y python34-PyYAML; then
933 echo "Failed to install python34-PyYAML"
937 if ! rpm -q python34-setuptools > /dev/null; then
938 if ! sudo yum install -y python34-setuptools; then
939 echo "Failed to install python34-setuptools"
943 if [ -z ${PYTHONPATH:-} ]; then
944 export PYTHONPATH=${WORKSPACE}/lib/python
946 export PYTHONPATH=$PYTHONPATH:${WORKSPACE}/lib/python
949 VERSION_EXTENSION=$(echo $(basename $RPM_LIST) | sed 's/opnfv-apex-//')
950 for pkg in common undercloud opendaylight-sfc onos; do
951 RPM_LIST+=" ${RPM_INSTALL_PATH}/opnfv-apex-${pkg}-${VERSION_EXTENSION}"
954 # update / install the new rpm
955 if rpm -q opnfv-apex > /dev/null; then
956 INSTALLED_RPMS=$(rpm -qa | grep apex)
957 for x in $INSTALLED_RPMS; do
958 INSTALLED_RPM_VER=$(echo $x | sed 's/opnfv-apex-//').rpm
959 # Does each RPM's version match the version required for deployment
960 if [ "$INSTALLED_RPM_VER" == "$VERSION_EXTENSION" ]; then
961 echo "RPM $x is already installed"
963 echo "RPM $x does not match $VERSION_EXTENSION"
964 echo "Will upgrade/downgrade RPMs..."
965 # Try to upgrade/downgrade RPMS
966 if sudo yum update -y $RPM_LIST | grep "does not update installed package"; then
967 if ! sudo yum downgrade -y $RPM_LIST; then
968 sudo yum remove -y opnfv-apex-undercloud opnfv-apex-common opnfv-apex-opendaylight-sfc opnfv-apex-onos
969 sudo yum downgrade -y $RPM_INSTALL_PATH
976 sudo yum install -y $RPM_LIST;
978 DEPLOY_CMD=opnfv-deploy
979 DEPLOY_FILE="/etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml"
980 NETWORK_FILE="/etc/opnfv-apex/network_settings.yaml"
981 export RESOURCES="/var/opt/opnfv/images"
982 export CONFIG="/var/opt/opnfv"
985 if [ "$OPNFV_CLEAN" == 'yes' ]; then
986 if [[ $BUILD_DIRECTORY == *verify-master* ]]; then
987 sudo CONFIG=../lib ./clean.sh
992 # initiate virtual deployment
993 echo "Deploy Scenario set to ${DEPLOY_SCENARIO}"
994 if [ -e $DEPLOY_FILE ]; then
995 sudo $DEPLOY_CMD -v -d ${DEPLOY_FILE} -n $NETWORK_FILE --debug
997 echo "File does not exist /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml"
1001 echo "--------------------------------------------------------"
1005 name: 'apex-deploy-baremetal'
1013 # log info to console
1014 echo "Starting the Apex baremetal deployment."
1015 echo "--------------------------------------------------------"
1018 if [[ ! "$ARTIFACT_NAME" == "latest" ]]; then
1019 # if artifact name is passed the pull a
1020 # specific artifact from artifacts.opnfv.org
1021 RPM_INSTALL_PATH=$GS_URL/$ARTIFACT_NAME
1023 if [[ $BUILD_DIRECTORY == *apex-build* ]]; then
1024 BUILD_DIRECTORY=$WORKSPACE/../$BUILD_DIRECTORY
1025 echo "BUILD DIRECTORY modified to $BUILD_DIRECTORY"
1027 if [[ -f ${BUILD_DIRECTORY}/../opnfv.properties ]]; then
1028 # if opnfv.properties exists then use the
1029 # local build. Source the file so we get local OPNFV vars
1030 source ${BUILD_DIRECTORY}/../opnfv.properties
1031 RPM_INSTALL_PATH=${BUILD_DIRECTORY}/$(basename $OPNFV_RPM_URL)
1033 # no opnfv.properties means use the latest from artifacts.opnfv.org
1034 # get the latest.properties to get the link to the latest artifact
1035 curl -s -o $WORKSPACE/opnfv.properties http://$GS_URL/latest.properties
1036 [[ -f opnfv.properties ]] || exit 1
1037 # source the file so we get OPNFV vars
1038 source opnfv.properties
1039 RPM_INSTALL_PATH=$OPNFV_RPM_URL
1043 if [ ! -e "$RPM_INSTALL_PATH" ]; then
1044 RPM_INSTALL_PATH=http://${OPNFV_RPM_URL}
1047 RPM_LIST=$RPM_INSTALL_PATH
1048 for pkg in common undercloud; do
1049 RPM_LIST+=" ${RPM_INSTALL_PATH/opnfv-apex/opnfv-apex-${pkg}}"
1052 # update / install the new rpm
1053 if rpm -q opnfv-apex > /dev/null; then
1054 if [ $(basename $OPNFV_RPM_URL) == $(rpm -q opnfv-apex).rpm ]; then
1055 echo "RPM is already installed"
1056 elif sudo yum update -y $RPM_LIST | grep "does not update installed package"; then
1057 if ! sudo yum downgrade -y $RPM_LIST; then
1058 sudo yum remove -y opnfv-undercloud opnfv-common
1059 sudo yum downgrade -y $RPM_INSTALL_PATH
1063 sudo yum install -y $RPM_LIST;
1066 # cleanup environment before we start
1068 # initiate baremetal deployment
1069 if [ -e /etc/opnfv-apex/network_settings.yaml ]; then
1070 if [ -n "$DEPLOY_SCENARIO" ]; then
1071 echo "Deploy Scenario set to ${DEPLOY_SCENARIO}"
1072 if [ -e /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml ]; then
1073 sudo opnfv-deploy -i /root/inventory/pod_settings.yaml \
1074 -d /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml \
1075 -n /root/network/network_settings.yaml --debug
1077 echo "File does not exist /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml"
1081 echo "Deploy scenario not set!"
1085 echo "File /etc/opnfv-apex/network_settings.yaml does not exist!"
1090 echo "--------------------------------------------------------"
1093 #######################
1095 ########################
1099 - timed: '0 3 * * *'
1101 name: 'apex-brahmaputra'
1103 - timed: '0 3 * * *'
1105 name: 'apex-gs-clean-{stream}'
1107 - timed: '0 2 * * *'