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