From f1da7d9bd1719ae70aad751f3650e54900a48a2b Mon Sep 17 00:00:00 2001 From: Niels de Vos Date: Mon, 22 Jun 2020 15:20:33 +0200 Subject: [PATCH] ci: move minikube variables to build.env Signed-off-by: Niels de Vos --- .travis.yml | 3 --- build.env | 5 +++++ scripts/travis-functest.sh | 10 ++++++++++ scripts/travis-helmtest.sh | 3 +++ 4 files changed, 18 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index eec76c25e..f7d6999f4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -23,9 +23,6 @@ env: - TEST_COVERAGE=stdout - GO_METALINTER_THREADS=1 - GO_COVER_DIR=_output - - VM_DRIVER=none - - MINIKUBE_VERSION=v1.6.0 - - CHANGE_MINIKUBE_NONE_USER=true - KUBECONFIG=$HOME/.kube/config # set CEPH_CSI_RUN_ALL_TESTS to non-empty to run all tests - CEPH_CSI_RUN_ALL_TESTS=true diff --git a/build.env b/build.env index 0d1915c67..6156754bb 100644 --- a/build.env +++ b/build.env @@ -19,3 +19,8 @@ GOSEC_VERSION=2.0.0 # helm chart generation, testing and publishing HELM_VERSION=v3.1.2 + +# minikube settings +MINIKUBE_VERSION=v1.6.0 +VM_DRIVER=none +CHANGE_MINIKUBE_NONE_USER=true diff --git a/scripts/travis-functest.sh b/scripts/travis-functest.sh index 569dcdaf1..c189d22e4 100755 --- a/scripts/travis-functest.sh +++ b/scripts/travis-functest.sh @@ -11,6 +11,16 @@ export KUBE_VERSION=$1 kube_version() { echo "${KUBE_VERSION}" | sed 's/^v//' | cut -d'.' -f"${1}" } + +# configure global environment variables +# shellcheck source=build.env +source "$(dirname "${0}")/../build.env" +cat << EOF | sudo tee -a /etc/environment +MINIKUBE_VERSION=${MINIKUBE_VERSION} +VM_DRIVER=${VM_DRIVER} +CHANGE_MINIKUBE_NONE_USER=${CHANGE_MINIKUBE_NONE_USER} +EOF + sudo scripts/minikube.sh up sudo scripts/minikube.sh deploy-rook sudo scripts/minikube.sh create-block-pool diff --git a/scripts/travis-helmtest.sh b/scripts/travis-helmtest.sh index d8d96dac0..d10b29e0c 100755 --- a/scripts/travis-helmtest.sh +++ b/scripts/travis-helmtest.sh @@ -16,6 +16,9 @@ kube_version() { source "$(dirname "${0}")/../build.env" cat << EOF | sudo tee -a /etc/environment HELM_VERSION=${HELM_VERSION} +MINIKUBE_VERSION=${MINIKUBE_VERSION} +VM_DRIVER=${VM_DRIVER} +CHANGE_MINIKUBE_NONE_USER=${CHANGE_MINIKUBE_NONE_USER} EOF # helm is installed from this shell, not a new one that reads /etc/environment