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'
23 branch: 'stable/brahmaputra'
24 gs-pathname: '/brahmaputra'
25 block-stream: 'master'
27 verify-slave: 'apex-verify-brahmaputra'
34 block-stream: 'brahmaputra'
36 verify-slave: 'apex-verify-master'
40 branch: 'stable/brahmaputra'
41 gs-pathname: '/brahmaputra'
42 block-stream: 'master'
44 verify-slave: 'apex-verify-brahmaputra'
50 - 'os-nosdn-nofeature-ha'
51 - 'os-odl_l2-nofeature-ha'
52 - 'os-odl_l2-bgpvpn-ha'
53 - 'os-odl_l2-sfc-noha'
54 - 'os-odl_l3-nofeature-ha'
55 - 'os-onos-nofeature-ha'
56 - 'os-opencontrail-nofeature-ha'
64 name: 'apex-verify-{stream2}'
70 gs-pathname: '{gs-pathname}'
77 default: https://gerrit.opnfv.org/gerrit/$PROJECT
78 description: "Used for overriding the GIT URL coming from parameters macro."
82 credentials-id: '{ssh-credentials}'
83 refspec: '$GERRIT_REFSPEC'
84 choosing-strategy: 'gerrit'
89 - patchset-created-event:
90 exclude-drafts: 'false'
91 exclude-trivial-rebase: 'false'
92 exclude-no-code-change: 'true'
93 - draft-published-event
94 - comment-added-contains-event:
95 comment-contains-value: 'recheck'
96 - comment-added-contains-event:
97 comment-contains-value: 'reverify'
99 - project-compare-type: 'ANT'
100 project-pattern: 'apex'
102 - branch-compare-type: 'ANT'
103 branch-pattern: '**/{branch}'
116 use-build-blocker: true
118 - 'apex-daily.*{stream2}'
119 - 'apex-deploy.*{stream2}'
120 - 'apex-build.*{stream2}'
121 - 'apex-runner.*{stream2}'
122 - 'apex-verify-{stream2}'
127 - project: 'apex-deploy-virtual-os-odl_l2-nofeature-ha-{stream2}'
128 predefined-parameters: |
129 BUILD_DIRECTORY=apex-verify-{stream2}/build_output
134 - project: 'apex-deploy-virtual-os-onos-nofeature-ha-{stream2}'
135 predefined-parameters: |
136 BUILD_DIRECTORY=apex-verify-{stream2}/build_output
141 - project: 'apex-deploy-virtual-os-odl_l3-nofeature-ha-{stream2}'
142 predefined-parameters: |
143 BUILD_DIRECTORY=apex-verify-{stream2}/build_output
148 - project: 'apex-deploy-virtual-os-odl_l2-sfc-noha-{stream2}'
149 predefined-parameters: |
150 BUILD_DIRECTORY=apex-verify-{stream2}/build_output
154 - 'apex-workspace-cleanup'
158 name: 'apex-verify-{stream1}'
160 node: '{verify-slave}'
164 gs-pathname: '{gs-pathname}'
171 default: https://gerrit.opnfv.org/gerrit/$PROJECT
172 description: "Used for overriding the GIT URL coming from parameters macro."
175 - gerrit-trigger-scm:
176 credentials-id: '{ssh-credentials}'
177 refspec: '$GERRIT_REFSPEC'
178 choosing-strategy: 'gerrit'
183 - patchset-created-event:
184 exclude-drafts: 'false'
185 exclude-trivial-rebase: 'false'
186 exclude-no-code-change: 'true'
187 - draft-published-event
188 - comment-added-contains-event:
189 comment-contains-value: 'recheck'
190 - comment-added-contains-event:
191 comment-contains-value: 'reverify'
193 - project-compare-type: 'ANT'
194 project-pattern: 'apex'
196 - branch-compare-type: 'ANT'
197 branch-pattern: '**/{branch}'
210 use-build-blocker: true
212 - 'apex-daily.*{stream1}'
213 - 'apex-deploy.*{stream1}'
214 - 'apex-build.*{stream1}'
215 - 'apex-runner.*{stream1}'
216 - 'apex-verify-{stream1}'
221 - project: 'apex-deploy-virtual-os-nosdn-nofeature-ha-{stream1}'
222 predefined-parameters: |
223 BUILD_DIRECTORY=apex-verify-{stream1}
229 # - project: 'functest-apex-{slave}-suite-{stream1}'
230 # predefined-parameters: |
231 # DEPLOY_SCENARIO=os-nosdn-nofeature-ha
232 # FUNCTEST_SUITE_NAME=vping_userdata
235 - project: 'apex-deploy-virtual-os-odl_l2-nofeature-ha-{stream1}'
236 predefined-parameters: |
237 BUILD_DIRECTORY=apex-verify-{stream1}
242 - 'apex-workspace-cleanup'
245 name: 'apex-runner-{platform}-{scenario}-{stream}'
247 # runner jobs for deploying manually
255 gs-pathname: '{gs-pathname}'
262 default: https://gerrit.opnfv.org/gerrit/$PROJECT
263 description: "Used for overriding the GIT URL coming from parameters macro."
266 - gerrit-trigger-scm:
267 credentials-id: '{ssh-credentials}'
269 choosing-strategy: 'default'
273 use-build-blocker: true
275 - 'apex-daily.*{stream}'
276 - 'apex-verify.*{stream}'
280 - project: 'apex-deploy-{platform}-{scenario}-{stream}'
281 predefined-parameters:
286 - project: 'yardstick-apex-{slave}-daily-{stream}'
287 predefined-parameters:
288 DEPLOY_SCENARIO={scenario}
291 build-step-failure-threshold: 'never'
292 failure-threshold: 'never'
293 unstable-threshold: 'FAILURE'
295 - project: 'functest-apex-{slave}-daily-{stream}'
296 predefined-parameters:
297 DEPLOY_SCENARIO={scenario}
300 build-step-failure-threshold: 'never'
301 failure-threshold: 'never'
302 unstable-threshold: 'FAILURE'
305 name: 'apex-build-{stream}'
307 # Job template for builds
309 # Required Variables:
310 # stream: branch with - in place of / (eg. stable)
311 # branch: branch (eg. stable)
320 gs-pathname: '{gs-pathname}'
325 default: https://gerrit.opnfv.org/gerrit/$PROJECT
326 description: "Used for overriding the GIT URL coming from parameters macro."
330 credentials-id: '{ssh-credentials}'
336 use-build-blocker: true
338 - 'apex-deploy.*{stream}'
343 - project: 'apex-deploy-virtual-os-nosdn-nofeature-ha-{stream}'
344 predefined-parameters: |
345 BUILD_DIRECTORY=apex-build-{stream}/build
349 - 'apex-upload-artifact'
352 name: 'apex-deploy-virtual-{scenario}-{stream}'
354 # Job template for virtual deployment
356 # Required Variables:
357 # stream: branch with - in place of / (eg. stable)
358 # branch: branch (eg. stable)
365 credentials-id: '{ssh-credentials}'
373 gs-pathname: '{gs-pathname}'
375 name: DEPLOY_SCENARIO
376 default: '{scenario}'
377 description: "Scenario to deploy with."
381 description: "Use yes in lower case to invoke clean. Indicates if the deploy environment should be cleaned before deployment"
385 use-build-blocker: true
387 - 'apex-deploy.*{stream}'
390 - 'apex-deploy-virtual'
391 - 'apex-workspace-cleanup'
394 name: 'apex-deploy-baremetal-{scenario}-{stream}'
396 # Job template for baremetal deployment
398 # Required Variables:
399 # stream: branch with - in place of / (eg. stable)
400 # branch: branch (eg. stable)
407 credentials-id: '{ssh-credentials}'
415 gs-pathname: '{gs-pathname}'
417 name: DEPLOY_SCENARIO
418 default: '{scenario}'
419 description: "Scenario to deploy with."
423 use-build-blocker: true
425 - 'apex-verify.*{stream}'
426 - 'apex-deploy.*{stream}'
427 - 'apex-build.*{stream}'
431 - 'apex-deploy-baremetal'
432 - 'apex-workspace-cleanup'
436 name: 'apex-daily-{stream2}'
438 # Job template for daily build
440 # Required Variables:
441 # stream: branch with - in place of / (eg. stable)
442 # branch: branch (eg. stable)
449 credentials-id: '{ssh-credentials}'
457 gs-pathname: '{gs-pathname}'
461 use-build-blocker: true
463 - 'apex-verify.*{stream2}'
464 - 'apex-deploy.*{stream2}'
465 - 'apex-build.*{stream2}'
466 - 'apex-runner.*{stream2}'
473 - project: 'apex-build-{stream2}'
475 current-parameters: true
478 - project: 'apex-deploy-baremetal-os-odl_l2-nofeature-ha-{stream2}'
479 predefined-parameters: |
480 BUILD_DIRECTORY=apex-build-{stream2}/build_output
485 - project: 'functest-apex-{slave}-daily-{stream2}'
486 predefined-parameters:
487 DEPLOY_SCENARIO=os-odl_l2-nofeature-ha
490 build-step-failure-threshold: 'never'
491 failure-threshold: 'never'
492 unstable-threshold: 'FAILURE'
494 - project: 'yardstick-apex-{slave}-daily-{stream2}'
495 predefined-parameters:
496 DEPLOY_SCENARIO=os-odl_l2-nofeature-ha
499 build-step-failure-threshold: 'never'
500 failure-threshold: 'never'
501 unstable-threshold: 'FAILURE'
503 - project: 'apex-deploy-baremetal-os-onos-nofeature-ha-{stream2}'
504 predefined-parameters:
505 BUILD_DIRECTORY=apex-build-{stream2}/build_output
509 - project: 'functest-apex-{slave}-daily-{stream2}'
510 predefined-parameters:
511 DEPLOY_SCENARIO=os-onos-nofeature-ha
514 build-step-failure-threshold: 'never'
515 failure-threshold: 'never'
516 unstable-threshold: 'FAILURE'
518 - project: 'yardstick-apex-{slave}-daily-{stream2}'
519 predefined-parameters:
520 DEPLOY_SCENARIO=os-onos-nofeature-ha
523 build-step-failure-threshold: 'never'
524 failure-threshold: 'never'
525 unstable-threshold: 'FAILURE'
527 - project: 'apex-deploy-baremetal-os-odl_l3-nofeature-ha-{stream2}'
528 predefined-parameters:
529 BUILD_DIRECTORY=apex-build-{stream2}/build_output
533 - project: 'functest-apex-{slave}-daily-{stream2}'
534 predefined-parameters:
535 DEPLOY_SCENARIO=os-odl_l3-nofeature-ha
538 build-step-failure-threshold: 'never'
539 failure-threshold: 'never'
540 unstable-threshold: 'FAILURE'
542 - project: 'yardstick-apex-{slave}-daily-{stream2}'
543 predefined-parameters:
544 DEPLOY_SCENARIO=os-odl_l3-nofeature-ha
547 build-step-failure-threshold: 'never'
548 failure-threshold: 'never'
549 unstable-threshold: 'FAILURE'
551 - project: 'apex-deploy-baremetal-os-odl_l2-bgpvpn-ha-{stream2}'
552 predefined-parameters:
553 BUILD_DIRECTORY=apex-build-{stream2}/build_output
557 - project: 'functest-apex-{slave}-daily-{stream2}'
558 predefined-parameters:
559 DEPLOY_SCENARIO=os-odl_l2-bgpvpn-ha
562 build-step-failure-threshold: 'never'
563 failure-threshold: 'never'
564 unstable-threshold: 'FAILURE'
566 - project: 'yardstick-apex-{slave}-daily-{stream2}'
567 predefined-parameters:
568 DEPLOY_SCENARIO=os-odl_l2-bgpvpn-ha
571 build-step-failure-threshold: 'never'
572 failure-threshold: 'never'
573 unstable-threshold: 'FAILURE'
577 name: 'apex-daily-{stream1}'
579 # Job template for daily build
581 # Required Variables:
582 # stream: branch with - in place of / (eg. stable)
583 # branch: branch (eg. stable)
590 credentials-id: '{ssh-credentials}'
598 gs-pathname: '{gs-pathname}'
602 use-build-blocker: true
604 - 'apex-verify.*{stream1}'
605 - 'apex-deploy.*{stream1}'
606 - 'apex-build.*{stream1}'
607 - 'apex-runner.*{stream1}'
614 - project: 'apex-build-{stream1}'
616 current-parameters: true
619 - project: 'apex-deploy-virtual-nosdn-nofeature-ha-{stream1}'
620 predefined-parameters: |
621 BUILD_DIRECTORY=apex-build-{stream1}/build
626 - project: 'functest-apex-{slave}-daily-{stream1}'
627 predefined-parameters:
628 DEPLOY_SCENARIO=os-nosdn-nofeature-ha
631 build-step-failure-threshold: 'never'
632 failure-threshold: 'never'
633 unstable-threshold: 'FAILURE'
635 - project: 'yardstick-apex-{slave}-daily-{stream1}'
636 predefined-parameters:
637 DEPLOY_SCENARIO=os-nosdn-nofeature-ha
640 build-step-failure-threshold: 'never'
641 failure-threshold: 'never'
642 unstable-threshold: 'FAILURE'
645 name: 'apex-gs-clean-{stream}'
647 # Job template for clean
649 # Required Variables:
650 # stream: branch with - in place of / (eg. stable)
659 gs-pathname: '{gs-pathname}'
665 - 'apex-gs-clean-{stream}'
668 ########################
670 ########################
677 description: "RPM Artifact name that will be appended to GS_URL to deploy a specific artifact"
679 name: ARTIFACT_VERSION
681 description: "Artifact version type"
683 name: BUILD_DIRECTORY
684 default: $WORKSPACE/build
685 description: "Directory where the build artifact will be located upon the completion of the build."
687 name: CACHE_DIRECTORY
688 default: $HOME/opnfv/cache{gs-pathname}
689 description: "Directory where the cache to be used during the build is located."
692 default: https://gerrit.opnfv.org/gerrit/$PROJECT
693 description: "Used for overriding the GIT URL coming from Global Jenkins configuration in case if the stuff is done on none-LF HW."
696 default: artifacts.opnfv.org/$PROJECT{gs-pathname}
697 description: "URL to Google Storage."
699 ########################
701 ########################
710 # log info to console
711 echo "Starting the build of Apex using OpenStack Master packages. This will take some time..."
712 echo "---------------------------------------------------------------------------------------"
714 # create the cache directory if it doesn't exist
715 [[ -d $CACHE_DIRECTORY ]] || mkdir -p $CACHE_DIRECTORY
716 # set OPNFV_ARTIFACT_VERSION
717 if echo $BUILD_TAG | grep "apex-verify" 1> /dev/null; then
718 if echo $GERRIT_BRANCH | grep "brahmaputra" 1> /dev/null; then
719 export OPNFV_ARTIFACT_VERSION=brahmaputra-dev${BUILD_NUMBER}
720 export BUILD_ARGS="-v $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY $BUILD_DIRECTORY"
722 export OPNFV_ARTIFACT_VERSION=dev${BUILD_NUMBER}
723 export BUILD_ARGS="-r $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY"
725 elif [ "$ARTIFACT_VERSION" == "daily" ]; then
726 if echo $GERRIT_BRANCH | grep "brahmaputra" 1> /dev/null; then
727 export OPNFV_ARTIFACT_VERSION=brahmaputra-$(date -u +"%Y-%m-%d")
728 export BUILD_ARGS="-v $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY $BUILD_DIRECTORY"
730 export OPNFV_ARTIFACT_VERSION=$(date -u +"%Y-%m-%d")
731 export BUILD_ARGS="-r $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY --iso"
734 export OPNFV_ARTIFACT_VERSION=${ARTIFACT_VERSION}
735 if echo $GERRIT_BRANCH | grep "brahmaputra" 1> /dev/null; then
736 export BUILD_ARGS="-v $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY $BUILD_DIRECTORY"
738 export BUILD_ARGS="-r $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY --iso"
741 # clean for stable but doesn't matter for master
742 if echo $GERRIT_BRANCH | grep "brahmaputra" 1> /dev/null; then
747 ./build.sh $BUILD_ARGS
748 RPM_VERSION=$(grep Version: $BUILD_DIRECTORY/opnfv-apex.spec | awk '{ print $2 }')-$(echo $OPNFV_ARTIFACT_VERSION | tr -d '_-')
749 # list the contents of BUILD_OUTPUT directory
750 ls -al $BUILD_DIRECTORY
751 # save information regarding artifact into file
753 echo "OPNFV_ARTIFACT_VERSION=$OPNFV_ARTIFACT_VERSION"
754 echo "OPNFV_GIT_URL=$(git config --get remote.origin.url)"
755 echo "OPNFV_GIT_SHA1=$(git rev-parse HEAD)"
756 echo "OPNFV_ARTIFACT_URL=$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
757 echo "OPNFV_ARTIFACT_MD5SUM=$(md5sum $BUILD_DIRECTORY/release/OPNFV-CentOS-7-x86_64-$OPNFV_ARTIFACT_VERSION.iso | cut -d' ' -f1)"
758 echo "OPNFV_SRPM_URL=$GS_URL/opnfv-apex-$RPM_VERSION.src.rpm"
759 echo "OPNFV_RPM_URL=$GS_URL/opnfv-apex-$RPM_VERSION.noarch.rpm"
760 echo "OPNFV_RPM_MD5SUM=$(md5sum $BUILD_DIRECTORY/noarch/opnfv-apex-$RPM_VERSION.noarch.rpm | cut -d' ' -f1)"
761 echo "OPNFV_BUILD_URL=$BUILD_URL"
762 ) > $WORKSPACE/opnfv.properties
763 echo "--------------------------------------------------------"
767 name: 'apex-workspace-cleanup'
775 # delete everything that is in $WORKSPACE
776 sudo /bin/rm -rf $WORKSPACE
779 name: 'apex-upload-artifact'
787 # log info to console
788 echo "Uploading the Apex artifact. This could take some time..."
789 echo "--------------------------------------------------------"
792 # source the opnfv.properties to get ARTIFACT_VERSION
793 source $WORKSPACE/opnfv.properties
795 # upload artifact and additional files to google storage
796 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
797 RPM_INSTALL_PATH=$BUILD_DIRECTORY/noarch
798 RPM_LIST=$RPM_INSTALL_PATH/$(basename $OPNFV_RPM_URL)
799 VERSION_EXTENSION=$(echo $(basename $OPNFV_RPM_URL) | sed 's/opnfv-apex-//')
800 for pkg in common undercloud opendaylight-sfc onos; do
801 RPM_LIST+=" ${RPM_INSTALL_PATH}/opnfv-apex-${pkg}-${VERSION_EXTENSION}"
803 SRPM_INSTALL_PATH=$BUILD_DIRECTORY
804 SRPM_LIST=$SRPM_INSTALL_PATH/$(basename $OPNFV_SRPM_URL)
805 for pkg in common undercloud opendaylight-sfc onos; do
806 SRPM_LIST+=" ${SRPM_INSTALL_PATH}/opnfv-apex-${pkg}-${VERSION_EXTENSION}"
808 for artifact in $RPM_LIST $SRPM_LIST; do
809 gsutil cp $artifact gs://$GS_URL/$(basename $artifact) > gsutil.iso.log 2>&1
811 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.properties > gsutil.properties.log 2>&1
812 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/latest.properties > gsutil.latest.log 2>&1
815 echo "--------------------------------------------------------"
817 echo "ISO Artifact is available as http://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
818 echo "RPM Artifact is available as http://$GS_URL/$(basename $OPNFV_RPM_URL)"
821 name: 'apex-gs-cleanup'
829 # log info to console
830 echo "Cleaning Google Storage"
831 echo "-----------------------"
834 thirty_days_ago=$(date -d "30 days ago" +"%Y%m%d")
836 for i in $(gsutil ls gs://$GS_URL/*201?*); do
837 filedate=$(date -d "$(echo $i | grep -Eo 201[0-9]-?[0-9][0-9]-?[0-9][0-9])" +"%Y%m%d")
838 if [ $filedate -lt $thirty_days_ago ]; then
839 # gsutil indicates what it is removing so no need for output here
845 name: 'apex-deploy-virtual'
853 # log info to console
854 echo "Starting the Apex virtual deployment."
855 echo "--------------------------------------------------------"
858 if [[ $BUILD_DIRECTORY == *verify-master* ]]; then
859 cd $WORKSPACE/../${BUILD_DIRECTORY/build_output/}
861 echo "WORKSPACE modified to $WORKSPACE"
863 elif [[ ! "$ARTIFACT_NAME" == "latest" ]]; then
864 # if artifact name is passed the pull a
865 # specific artifact from artifacts.opnfv.org
866 RPM_INSTALL_PATH=$GS_URL
867 RPM_LIST=$RPM_INSTALL_PATH/$ARTIFACT_NAME
869 if [[ $BUILD_DIRECTORY == *verify* ]]; then
870 BUILD_DIRECTORY=$WORKSPACE/../$BUILD_DIRECTORY
871 echo "BUILD DIRECTORY modified to $BUILD_DIRECTORY"
872 elif [[ $BUILD_DIRECTORY == *apex-build* ]]; then
873 BUILD_DIRECTORY=$WORKSPACE/../$BUILD_DIRECTORY
874 echo "BUILD DIRECTORY modified to $BUILD_DIRECTORY"
877 if [[ -f ${BUILD_DIRECTORY}/../opnfv.properties ]]; then
878 # if opnfv.properties exists then use the
879 # local build. Source the file so we get local OPNFV vars
880 source ${BUILD_DIRECTORY}/../opnfv.properties
881 RPM_INSTALL_PATH=${BUILD_DIRECTORY}/noarch
882 RPM_LIST=$RPM_INSTALL_PATH/$(basename $OPNFV_RPM_URL)
884 if [[ $BUILD_DIRECTORY == *verify* ]]; then
885 echo "BUILD_DIRECTORY is from a verify job, so will not use latest from URL"
886 echo "Check that the slave has opnfv.properties in $BUILD_DIRECTORY"
888 elif [[ $BUILD_DIRECTORY == *apex-build* ]]; then
889 echo "BUILD_DIRECTORY is from a daily job, so will not use latest from URL"
890 echo "Check that the slave has opnfv.properties in $BUILD_DIRECTORY"
893 # no opnfv.properties means use the latest from artifacts.opnfv.org
894 # get the latest.properties to get the link to the latest artifact
895 curl -s -o $WORKSPACE/opnfv.properties http://$GS_URL/latest.properties
896 [[ -f opnfv.properties ]] || exit 1
897 # source the file so we get OPNFV vars
898 source opnfv.properties
899 RPM_INSTALL_PATH=$(echo $OPNFV_RPM_URL | sed 's/'"$(basename $OPNFV_RPM_URL)"'//')
900 RPM_LIST=$RPM_INSTALL_PATH/$(basename $OPNFV_RPM_URL)
904 if [ -z "$DEPLOY_SCENARIO" ]; then
905 echo "Deploy scenario not set!"
909 # use local build for verify
910 if [[ $BUILD_DIRECTORY == *verify-master* ]]; then
911 if [ ! -e "${WORKSPACE}/build/lib" ]; then ln -s ${WORKSPACE}/lib ${WORKSPACE}/build/lib; fi
912 DEPLOY_CMD="CONFIG=${WORKSPACE}/build RESOURCES=${WORKSPACE}/build/images/ ./deploy.sh -c ${WORKSPACE}/build -r ${WORKSPACE}/build/images/"
913 DEPLOY_FILE="${WORKSPACE}/config/deploy/${DEPLOY_SCENARIO}.yaml"
914 NETWORK_FILE="${WORKSPACE}/config/network/network_settings.yaml"
915 # Make sure python34 is installed
916 if ! rpm -q python34 > /dev/null; then
917 sudo yum install -y epel-release
918 if ! sudo yum install -y python34; then
919 echo "Failed to install python34"
923 if ! rpm -q python34-PyYAML > /dev/null; then
924 sudo yum install -y epel-release
925 if ! sudo yum install -y python34-PyYAML; then
926 echo "Failed to install python34-PyYAML"
930 if ! rpm -q python34-setuptools > /dev/null; then
931 if ! sudo yum install -y python34-setuptools; then
932 echo "Failed to install python34-setuptools"
936 if [ -z ${PYTHONPATH:-} ]; then
937 export PYTHONPATH=${WORKSPACE}/lib/python
939 export PYTHONPATH=$PYTHONPATH:${WORKSPACE}/lib/python
942 VERSION_EXTENSION=$(echo $(basename $RPM_LIST) | sed 's/opnfv-apex-//')
943 for pkg in common undercloud opendaylight-sfc onos; do
944 RPM_LIST+=" ${RPM_INSTALL_PATH}/opnfv-apex-${pkg}-${VERSION_EXTENSION}"
947 # update / install the new rpm
948 if rpm -q opnfv-apex > /dev/null; then
949 INSTALLED_RPMS=$(rpm -qa | grep apex)
950 for x in $INSTALLED_RPMS; do
951 INSTALLED_RPM_VER=$(echo $x | sed 's/opnfv-apex-//').rpm
952 # Does each RPM's version match the version required for deployment
953 if [ "$INSTALLED_RPM_VER" == "$VERSION_EXTENSION" ]; then
954 echo "RPM $x is already installed"
956 echo "RPM $x does not match $VERSION_EXTENSION"
957 echo "Will upgrade/downgrade RPMs..."
958 # Try to upgrade/downgrade RPMS
959 if sudo yum update -y $RPM_LIST | grep "does not update installed package"; then
960 if ! sudo yum downgrade -y $RPM_LIST; then
961 sudo yum remove -y opnfv-apex-undercloud opnfv-apex-common opnfv-apex-opendaylight-sfc opnfv-apex-onos
962 sudo yum downgrade -y $RPM_INSTALL_PATH
969 sudo yum install -y $RPM_LIST;
971 DEPLOY_CMD=opnfv-deploy
972 DEPLOY_FILE="/etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml"
973 NETWORK_FILE="/etc/opnfv-apex/network_settings.yaml"
974 export RESOURCES="/var/opt/opnfv/images"
975 export CONFIG="/var/opt/opnfv"
978 if [ "$OPNFV_CLEAN" == 'yes' ]; then
979 if [[ $BUILD_DIRECTORY == *verify-master* ]]; then
980 sudo CONFIG=../lib ./clean.sh
985 # initiate virtual deployment
986 echo "Deploy Scenario set to ${DEPLOY_SCENARIO}"
987 if [ -e $DEPLOY_FILE ]; then
988 sudo $DEPLOY_CMD -v -d ${DEPLOY_FILE} -n $NETWORK_FILE --debug
990 echo "File does not exist /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml"
994 echo "--------------------------------------------------------"
998 name: 'apex-deploy-baremetal'
1006 # log info to console
1007 echo "Starting the Apex baremetal deployment."
1008 echo "--------------------------------------------------------"
1011 if [[ ! "$ARTIFACT_NAME" == "latest" ]]; then
1012 # if artifact name is passed the pull a
1013 # specific artifact from artifacts.opnfv.org
1014 RPM_INSTALL_PATH=$GS_URL/$ARTIFACT_NAME
1016 if [[ $BUILD_DIRECTORY == *apex-build* ]]; then
1017 BUILD_DIRECTORY=$WORKSPACE/../$BUILD_DIRECTORY
1018 echo "BUILD DIRECTORY modified to $BUILD_DIRECTORY"
1020 if [[ -f ${BUILD_DIRECTORY}/../opnfv.properties ]]; then
1021 # if opnfv.properties exists then use the
1022 # local build. Source the file so we get local OPNFV vars
1023 source ${BUILD_DIRECTORY}/../opnfv.properties
1024 RPM_INSTALL_PATH=${BUILD_DIRECTORY}/$(basename $OPNFV_RPM_URL)
1026 # no opnfv.properties means use the latest from artifacts.opnfv.org
1027 # get the latest.properties to get the link to the latest artifact
1028 curl -s -o $WORKSPACE/opnfv.properties http://$GS_URL/latest.properties
1029 [[ -f opnfv.properties ]] || exit 1
1030 # source the file so we get OPNFV vars
1031 source opnfv.properties
1032 RPM_INSTALL_PATH=$OPNFV_RPM_URL
1036 if [ ! -e "$RPM_INSTALL_PATH" ]; then
1037 RPM_INSTALL_PATH=http://${OPNFV_RPM_URL}
1040 RPM_LIST=$RPM_INSTALL_PATH
1041 for pkg in common undercloud; do
1042 RPM_LIST+=" ${RPM_INSTALL_PATH/opnfv-apex/opnfv-apex-${pkg}}"
1045 # update / install the new rpm
1046 if rpm -q opnfv-apex > /dev/null; then
1047 if [ $(basename $OPNFV_RPM_URL) == $(rpm -q opnfv-apex).rpm ]; then
1048 echo "RPM is already installed"
1049 elif sudo yum update -y $RPM_LIST | grep "does not update installed package"; then
1050 if ! sudo yum downgrade -y $RPM_LIST; then
1051 sudo yum remove -y opnfv-undercloud opnfv-common
1052 sudo yum downgrade -y $RPM_INSTALL_PATH
1056 sudo yum install -y $RPM_LIST;
1059 # cleanup environment before we start
1061 # initiate baremetal deployment
1062 if [ -e /etc/opnfv-apex/network_settings.yaml ]; then
1063 if [ -n "$DEPLOY_SCENARIO" ]; then
1064 echo "Deploy Scenario set to ${DEPLOY_SCENARIO}"
1065 if [ -e /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml ]; then
1066 sudo opnfv-deploy -i /root/inventory/pod_settings.yaml \
1067 -d /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml \
1068 -n /root/network/network_settings.yaml --debug
1070 echo "File does not exist /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml"
1074 echo "Deploy scenario not set!"
1078 echo "File /etc/opnfv-apex/network_settings.yaml does not exist!"
1083 echo "--------------------------------------------------------"
1086 #######################
1088 ########################
1092 - timed: '0 3 * * *'
1094 name: 'apex-brahmaputra'
1096 - timed: '0 3 * * *'
1098 name: 'apex-gs-clean-{stream}'
1100 - timed: '0 2 * * *'