Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
H
holi-app-volunteering
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Operate
Terraform modules
Analyze
Contributor analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
app
holi-app-volunteering
Commits
cf600155
Commit
cf600155
authored
5 months ago
by
Ole Langbehn
Browse files
Options
Downloads
Patches
Plain Diff
fix(ci): quote all environment variables in scripts
parent
a7c4540c
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
.gitlab-ci.yml
+9
-9
9 additions, 9 deletions
.gitlab-ci.yml
with
9 additions
and
9 deletions
.gitlab-ci.yml
+
9
−
9
View file @
cf600155
...
@@ -29,15 +29,15 @@ variables:
...
@@ -29,15 +29,15 @@ variables:
#when: on_failure
#when: on_failure
expire_in
:
1 week
expire_in
:
1 week
script
:
script
:
-
terraform/environments/scripts/create-or-update-env.sh $ENVIRONMENT_ID
$CI_COMMIT_SHA
-
terraform/environments/scripts/create-or-update-env.sh
"
$ENVIRONMENT_ID
" "
$CI_COMMIT_SHA
"
-
echo "$(terraform/environments/scripts/get-output.sh api_domain)" > $API_DOMAIN_PATH
-
echo "$(terraform/environments/scripts/get-output.sh api_domain)" >
"
$API_DOMAIN_PATH
"
resource_group
:
$ENVIRONMENT_ID
# never execute terraform in parallel on the same environment
resource_group
:
$ENVIRONMENT_ID
# never execute terraform in parallel on the same environment
interruptible
:
false
interruptible
:
false
.smoketest
:
.smoketest
:
image
:
'
europe-north1-docker.pkg.dev/holi-shared/docker/holi-docker/holi-k6-builder'
image
:
'
europe-north1-docker.pkg.dev/holi-shared/docker/holi-docker/holi-k6-builder'
script
:
script
:
-
API_DOMAIN=$(cat $API_DOMAIN_PATH)
-
API_DOMAIN=$(cat
"
$API_DOMAIN_PATH
"
)
-
terraform/environments/scripts/wait-for-ssl.sh "https://${API_DOMAIN}"
-
terraform/environments/scripts/wait-for-ssl.sh "https://${API_DOMAIN}"
-
BASE_URL="https://${API_DOMAIN}/graphql" k6 run smoketest/main.js
-
BASE_URL="https://${API_DOMAIN}/graphql" k6 run smoketest/main.js
# TODO should/could we roll back the service to the last working revision on test failure?
# TODO should/could we roll back the service to the last working revision on test failure?
...
@@ -80,10 +80,10 @@ build_docker:
...
@@ -80,10 +80,10 @@ build_docker:
# this could be fetched via terraform output ("gcr_location" in infra project), but then we would need an extra job for terraform
# this could be fetched via terraform output ("gcr_location" in infra project), but then we would need an extra job for terraform
GCR_IMAGE
:
europe-north1-docker.pkg.dev/holi-shared/docker/holi-volunteering-api
GCR_IMAGE
:
europe-north1-docker.pkg.dev/holi-shared/docker/holi-volunteering-api
script
:
script
:
-
docker pull $GCR_IMAGE ||
true
# Allows us to use --cache-from, we need to tag with latest in the next command for this to work
-
docker pull
"
$GCR_IMAGE
"
||
true
# Allows us to use --cache-from, we need to tag with latest in the next command for this to work
-
docker build --cache-from $GCR_IMAGE -t $GCR_IMAGE:latest -t $GCR_IMAGE
:
$CI_COMMIT_SHA -t $GCR_IMAGE
:
$CI_COMMIT_REF_SLUG .
-
docker build --cache-from
"
$GCR_IMAGE
"
-t
"
$GCR_IMAGE
"
:latest -t
"
$GCR_IMAGE
":"
$CI_COMMIT_SHA
"
-t
"
$GCR_IMAGE
":"
$CI_COMMIT_REF_SLUG
"
.
-
docker push $GCR_IMAGE
:
$CI_COMMIT_SHA
# this is the tag that is used for deployment
-
docker push
"
$GCR_IMAGE
":"
$CI_COMMIT_SHA
"
# this is the tag that is used for deployment
-
docker push $GCR_IMAGE
:
$CI_COMMIT_REF_SLUG
# just for easyly knowing which is the last image for a branch
-
docker push
"
$GCR_IMAGE
":"
$CI_COMMIT_REF_SLUG
"
# just for easyly knowing which is the last image for a branch
## review environments
## review environments
...
@@ -131,9 +131,9 @@ review_destroy:
...
@@ -131,9 +131,9 @@ review_destroy:
expire_in
:
1 week
expire_in
:
1 week
script
:
script
:
# branch may have been deleted, so we clone and checkout main
# branch may have been deleted, so we clone and checkout main
-
git clone $CI_REPOSITORY_URL main-clone
-
git clone
"
$CI_REPOSITORY_URL
"
main-clone
-
cd main-clone
-
cd main-clone
-
terraform/environments/scripts/destroy-env.sh $CI_ENVIRONMENT_SLUG
-
terraform/environments/scripts/destroy-env.sh
"
$CI_ENVIRONMENT_SLUG
"
# can't use rules here: https://gitlab.com/gitlab-org/gitlab/-/issues/34077
# can't use rules here: https://gitlab.com/gitlab-org/gitlab/-/issues/34077
when
:
manual
when
:
manual
allow_failure
:
true
allow_failure
:
true
...
...
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