Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
geosphere-deploy
Manage
Activity
Members
Plan
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cspp_geo
geosphere
geosphere-deploy
Commits
5ab8b3f7
Verified
Commit
5ab8b3f7
authored
4 years ago
by
David Hoese
Browse files
Options
Downloads
Patches
Plain Diff
Fix pvc creation when using git tag builds
parent
9a2045c3
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
ci_geosphere/gitlab-ci.yaml
+2
-4
2 additions, 4 deletions
ci_geosphere/gitlab-ci.yaml
helpers/create_pvc.sh
+4
-3
4 additions, 3 deletions
helpers/create_pvc.sh
with
6 additions
and
7 deletions
ci_geosphere/gitlab-ci.yaml
+
2
−
4
View file @
5ab8b3f7
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
helpers/create_pvc.sh
+
4
−
3
View file @
5ab8b3f7
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment