Skip to content
Snippets Groups Projects
Verified Commit 3dea5303 authored by David Hoese's avatar David Hoese
Browse files

Add debug information to namespace get_namespace.sh

parent 92b6a470
No related branches found
No related tags found
No related merge requests found
......@@ -4,20 +4,35 @@ GEOSPHERE_NAMESPACE="${GEOSPHERE_NAMESPACE:-"geosphere"}"
GEOSPHERE_TEST_NAMESPACE="${GEOSPHERE_TEST_NAMESPACE:-"geosphere-test"}"
TESTS_NAMESPACE="${TESTS_NAMESPACE:-"geosphere-ci-tests"}"
debug() {
>&2 echo "DEBUG: $@"
}
error() {
>&2 echo "ERROR: $@"
}
if [[ -n "$CI_COMMIT_TAG" ]]; then
debug "Tag detected: $CI_COMMIT_TAG"
if [[ $CI_COMMIT_TAG =~ $GEOSPHERE_TAG_REGEX ]]; then
ns="${GEOSPHERE_NAMESPACE}";
debug "geosphere tag matched"
ns="${GEOSPHERE_NAMESPACE}"
elif [[ $CI_COMMIT_TAG =~ $GEOSPHERE_TEST_TAG_REGEX ]]; then
ns="${GEOSPHERE_TEST_NAMESPACE}";
debug "geosphere-test tag matched"
ns="${GEOSPHERE_TEST_NAMESPACE}"
elif [[ $CI_COMMIT_TAG =~ $GCP_TAG_REGEX ]]; then
ns="${GCP_NAMESPACE}";
debug "gcp tag matched"
ns="${GCP_NAMESPACE}"
fi
elif [[ $CI_PROJECT_NAME =~ $TESTS_PROJECT_NAME ]]; then
ns="${TESTS_NAMESPACE}";
debug "Tests project name matched"
ns="${TESTS_NAMESPACE}"
else
debug "Could not determine namespace | $CI_COMMIT_TAG | $CI_PROJECT_NAME"
fi
if [[ -z $ns ]]; then
echo "ERROR: Kubernetes jobs don't run unless in master branch or tagged"
error "Kubernetes jobs don't run unless in master branch or tagged"
exit 1
fi
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment