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
a267e99f
Verified
Commit
a267e99f
authored
4 years ago
by
David Hoese
Browse files
Options
Downloads
Patches
Plain Diff
Make sure GCP deployments only run when tagged
parent
62947d57
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
.gitlab-ci.yml
+0
-1
0 additions, 1 deletion
.gitlab-ci.yml
ci_gcp/gitlab-ci.yaml
+11
-22
11 additions, 22 deletions
ci_gcp/gitlab-ci.yaml
ci_gcp/values-geosphere-rabbit.yaml
+13
-0
13 additions, 0 deletions
ci_gcp/values-geosphere-rabbit.yaml
helpers/get_namespace.sh
+12
-1
12 additions, 1 deletion
helpers/get_namespace.sh
with
36 additions
and
24 deletions
.gitlab-ci.yml
+
0
−
1
View file @
a267e99f
...
...
@@ -3,7 +3,6 @@ stages:
-
build prereqs
-
test
-
create storage
-
test
-
deploy rabbit
-
deploy GRB
-
deploy G2G
...
...
This diff is collapsed.
Click to expand it.
ci_gcp/gitlab-ci.yaml
+
11
−
22
View file @
a267e99f
...
...
@@ -4,10 +4,8 @@
environment
:
name
:
gcp
extends
:
.helm_based_job
image
:
gitlab.ssec.wisc.edu:5555/cspp_geo/geosphere/gcloud-kubectl-helm/gcloud-kubectl-helm:6d3e308b
variables
:
KUBECONFIG
:
"
/root/.kube/config"
before_script
:
-
export KUBECONFIG="/root/.kube/config"
-
gcloud --verbosity=debug auth activate-service-account "${GEOSPHERE_DEPLOY_GCP_SA_EMAIL}" --key-file="${GEOSPHERE_DEPLOY_GCP_SA_KEY}"
# If this produces a warning about not having permission make sure the SA
# has the project "Viewer" role. If it still produces a warning then try
...
...
@@ -18,6 +16,10 @@
-
helm registry login -u ${CI_REGISTRY_USER} -p ${CI_JOB_TOKEN} ${CI_REGISTRY}
-
helm repo add stable https://kubernetes-charts.storage.googleapis.com
-
helm repo update
rules
:
-
if
:
$CI_COMMIT_TAG !~ /$GCP_TAG_REGEX/
when
:
never
-
when
:
on_success
test gcp connection
:
extends
:
.gcloud_base
...
...
@@ -44,10 +46,6 @@ gstest deploy grb:
-
helm upgrade -v 2 --install --namespace $ns -f ../../ci_gcp/values-grb-g16.yaml cspp-geo-grb cspp-geo-grb/
dependencies
:
-
get_chart_grb
rules
:
-
if
:
'
$CI_COMMIT_BRANCH
!=
"gcp"'
when
:
never
-
when
:
on_success
gs create geotiff storage
:
extends
:
.gcloud_base
...
...
@@ -58,12 +56,11 @@ gs create geotiff storage:
# this job doesn't actually need any artifacts from previous jobs
dependencies
:
[]
rules
:
-
if
:
'
$CI_COMMIT_
BRANCH
!=
"gcp"'
-
if
:
$CI_COMMIT_
TAG !~ /$GCP_TAG_REGEX/
when
:
never
-
when
:
on_success
# this will always be true for tags
-
changes
:
-
ci_g
eosphere
/geotiff-pvc.yaml
-
ci_g
cp
/geotiff-pvc.yaml
-
if
:
$CREATE_STORAGE
gs create shapefile storage
:
...
...
@@ -75,13 +72,11 @@ gs create shapefile storage:
# this job doesn't actually need any artifacts from previous jobs
dependencies
:
[]
rules
:
-
if
:
"
$CI_COMMIT_TAG
==
null"
when
:
never
-
if
:
'
$kubekorner_k3s_config
==
null'
-
if
:
$CI_COMMIT_TAG !~ /$GCP_TAG_REGEX/
when
:
never
# this will always be true for tags
-
changes
:
-
ci_g
eosphere
/shapefiles-pvc.yaml
-
ci_g
cp
/shapefiles-pvc.yaml
-
if
:
$CREATE_STORAGE
gs deploy rabbit
:
...
...
@@ -92,16 +87,10 @@ gs deploy rabbit:
stage
:
deploy rabbit
script
:
-
./helpers/deploy_rabbitmq.sh ci_geosphere
-
cp ${kubekorner_k3s_config} .
-
kubeconfig=$(basename ${kubekorner_k3s_config})
-
|-
kubectl get secret --kubeconfig "${kubeconfig}" geosphere-rabbit-rabbitmq --namespace=geosphere -oyaml | grep -v '^\s*namespace:\s' | grep -v "[Hh]elm" | grep -v "[tT]ime" | grep -v "selfLink" | grep -v "uid" | grep -v "resourceVersion" | sed 's/ name: .*/ name: geosphere-rabbit-rabbitmq-production/' | kubectl_stdin apply --kubeconfig "${kubeconfig}" --namespace=geosphere-test -f -
# this job doesn't actually need any artifacts from previous jobs
dependencies
:
[]
rules
:
-
if
:
"
$CI_COMMIT_TAG
==
null"
when
:
never
-
if
:
'
$kubekorner_k3s_config
==
null'
-
if
:
$CI_COMMIT_TAG !~ /$GCP_TAG_REGEX/
when
:
never
# no need to build if another project triggered us
-
if
:
$CI_PIPELINE_SOURCE == "pipeline"
...
...
@@ -122,7 +111,7 @@ gstest deploy client:
dependencies
:
-
get_chart_client_test
rules
:
-
if
:
'
$CI_COMMIT_
BRANCH
!=
"gcp"'
-
if
:
$CI_COMMIT_
TAG !~ /$GCP_TAG_REGEX/
when
:
never
-
when
:
on_success
This diff is collapsed.
Click to expand it.
ci_gcp/values-geosphere-rabbit.yaml
0 → 100644
+
13
−
0
View file @
a267e99f
#rabbitmq:
# configuration: |-
# ## Clustering
# cluster_formation.peer_discovery_backend = rabbit_peer_discovery_k8s
# cluster_formation.k8s.host = kubernetes.default.svc.cluster.local
# cluster_formation.node_cleanup.interval = 10
# cluster_formation.node_cleanup.only_log_warning = true
# cluster_partition_handling = autoheal
# # queue master locator
# queue_master_locator=min-masters
# # enable guest user
# loopback_users.guest = false
rbacEnabled
:
false
This diff is collapsed.
Click to expand it.
helpers/get_namespace.sh
+
12
−
1
View file @
a267e99f
...
...
@@ -12,9 +12,20 @@ error() {
>
&2
echo
"ERROR:
$@
"
}
test_namespace
()
{
if
[[
$CI_ENVIRONMENT_NAME
==
"gcp"
]]
;
then
echo
"
${
GCP_NAMESPACE
}
"
else
echo
"
${
TESTS_NAMESPACE
}
"
fi
}
if
[[
-n
"
$CI_COMMIT_TAG
"
]]
;
then
debug
"Tag detected:
$CI_COMMIT_TAG
"
if
[[
$CI_COMMIT_TAG
=
~
$GEOSPHERE_TAG_REGEX
]]
;
then
if
[[
$CI_JOB_STAGE
==
"test"
]]
;
then
debug
"Ignoring tag because we are in the 'test' stage"
ns
=
$(
test_namespace
)
elif
[[
$CI_COMMIT_TAG
=
~
$GEOSPHERE_TAG_REGEX
]]
;
then
debug
"geosphere tag matched"
ns
=
"
${
GEOSPHERE_NAMESPACE
}
"
elif
[[
$CI_COMMIT_TAG
=
~
$GEOSPHERE_TEST_TAG_REGEX
]]
;
then
...
...
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