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

Fix pvc creation when using git tag builds

parent 9a2045c3
No related branches found
Tags v20200813_2122
No related merge requests found
......@@ -11,8 +11,6 @@ gs create geotiff storage:
extends: .helm_based_job
stage: create storage
script:
- echo "$CI_COMMIT_BRANCH"
- echo "$CI_COMMIT_TAG"
- ns=$(./helpers/get_namespace.sh)
# copy secret kubeconfig to the mounted (pwd) directory
- cp $kubekorner_k3s_config .
......@@ -25,6 +23,7 @@ gs create geotiff storage:
when: never
- if: '$kubekorner_k3s_config == null'
when: never
# this will always be true for tags
- changes:
- ci_geosphere/geotiff-pvc.yaml
- if: $CREATE_STORAGE
......@@ -33,8 +32,6 @@ gs create shapefile storage:
extends: .helm_based_job
stage: create storage
script:
- echo "$CI_COMMIT_BRANCH"
- echo "$CI_COMMIT_TAG"
- ns=$(./helpers/get_namespace.sh)
# copy secret kubeconfig to the mounted (pwd) directory
- cp $kubekorner_k3s_config .
......@@ -47,6 +44,7 @@ gs create shapefile storage:
when: never
- if: '$kubekorner_k3s_config == null'
when: never
# this will always be true for tags
- changes:
- ci_geosphere/shapefiles-pvc.yaml
- if: $CREATE_STORAGE
......
......@@ -22,10 +22,11 @@ else
fi
# If another project started this build then we know the provided definition
# didn't change. Let's make sure it exists on the cluster and if so, don't
# If another project started this build or we don't know if the file changed
# (git tag) then we know the provided definition didn't change (or probably
# didn't). Let's make sure it exists on the cluster and if so, don't
# try to recreate it.
if [[ $CI_PIPELINE_SOURCE == "pipeline" ]]; then
if [[ $CI_PIPELINE_SOURCE == "pipeline" ]] || [[ $CI_COMMIT_TAG != null ]]; then
pvc_exists=$(kubectl $EXTRA_ARGS get pvc $pvc_name -o jsonpath="{.metadata.name}" || echo "")
if [[ "$pvc_exists" != "" ]]; then
# it exists
......
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