Extract export_logs func to lib

Signed-off-by: irbekrm <irbekrm@gmail.com>
This commit is contained in:
irbekrm 2021-07-12 15:43:57 +01:00
parent f7c2f11882
commit 073f0dd2b8
3 changed files with 10 additions and 8 deletions

View File

@ -22,11 +22,6 @@ set -o pipefail
# This is intended to be run in a CI environment and *not* for development.
# It is not optimised for quick, iterative development.
export_logs() {
echo "Exporting cluster logs to artifacts..."
"${SCRIPT_ROOT}/cluster/export-logs.sh"
}
SCRIPT_ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )" > /dev/null && pwd )"
export REPO_ROOT="${SCRIPT_ROOT}/.."
source "${SCRIPT_ROOT}/lib/lib.sh"
@ -39,13 +34,14 @@ if [[ "$IS_OPENSHIFT" == "true" ]] ; then
export SERVICE_IP_PREFIX="172.30.0"
fi
# When running in our CI environment the Docker network's subnet choice will cause issues with routing
# This works this around till we have a way to properly patch this.
# When running in our CI environment the Docker network's subnet choice will
# cause issues with routing. This works this around till we have a way to
# properly patch this.
if ! docker network inspect kind ; then
docker network create --driver=bridge --subnet=192.168.0.0/16 --gateway 192.168.0.1 kind
fi
# Wait for the network to be created so kind does not overwrite it
# Wait for the network to be created so kind does not overwrite it.
while ! docker network inspect kind ; do
sleep 100ms
done

View File

@ -24,6 +24,7 @@ set -o pipefail
SCRIPT_ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )" > /dev/null && pwd )"
export REPO_ROOT="${SCRIPT_ROOT}/.."
source "${SCRIPT_ROOT}/lib/lib.sh"
# Ensure a running Kubernetes cluster
"${SCRIPT_ROOT}/ci-cluster.sh"

View File

@ -110,3 +110,8 @@ load_image() {
fi
kind load docker-image --name "$KIND_CLUSTER_NAME" "$IMAGE_NAME"
}
export_logs() {
echo "Exporting cluster logs to artifacts..."
"${SCRIPT_ROOT}/cluster/export-logs.sh"
}