Add a manual production deployment to storage bucket

This commit is contained in:
Jeremy Wall 2020-12-13 19:06:56 -05:00
parent 3cd46dc3a2
commit 7091354419
3 changed files with 37 additions and 24 deletions

View File

@ -34,3 +34,14 @@ deploy-staging:
- if: '$CI_COMMIT_BRANCH == "main"'
when: on_success
allow_failure: false
deploy-prod:
stage: prod
image: google/cloud-sdk
script:
- cd ./src
- make deploy-prod
rules:
- if: '$CI_COMMIT_BRANCH == "main"'
when: manual
allow_failure: false

View File

@ -19,4 +19,4 @@ deploy-staging: authorize-service-account
gsutil -m rsync -d -r ${output} gs://staging.dynamicbible.com
update-bucket-configs: gcloud/buckets.yaml
gcloud deployment-manager deployments update dynamicbible-buckets --config gcloud/buckets.yaml
gcloud deployment-manager deployments update --format=json dynamicbible-buckets --config gcloud/buckets.yaml

View File

@ -1,24 +1,26 @@
---
resources:
#- name: dynamicbible.com
# type: storage.v1.bucket
# properties:
# bucket: dynamicbible.com
# project: "dynamicbible-7c6cf"
# location: "us-east1"
# website:
# notFoundPage: 404.html
# mainPageSuffix: index.html
# acl:
# - entity: "project-owners-dynamicbible-7c6cf"
# role: OWNER
# - entity: "project-editors-dynamicbible-7c6cf"
# role: WRITER
# - entity: "project-viewers-dynamicbible-7c6cf"
# role: READER
# defaultObjectAcl:
# - entity: allUsers
# role: READER
- name: dynamicbible.com
type: storage.v1.bucket
properties:
bucket: dynamicbible.com
project: "dynamicbible-7c6cf"
location: "us-east1"
website:
notFoundPage: 404.html
mainPageSuffix: index.html
acl:
- entity: "project-owners-dynamicbible-7c6cf"
role: OWNER
- entity: "project-editors-dynamicbible-7c6cf"
role: WRITER
- entity: "project-viewers-dynamicbible-7c6cf"
role: READER
- entity: "user-$(ref.gitlab-service-account.email)"
role: WRITER
defaultObjectAcl:
- entity: allUsers
role: READER
- name: staging.dynamicbible.com
type: storage.v1.bucket
properties:
@ -51,10 +53,10 @@ resources:
parent: $(ref.gitlab-service-account.name)
name: gitlab-service-account-key
outputs:
#- name: dynamicbible.comselfLink
# value: "https://console.cloud.google.com/storage/browser/dynamicbible.com"
#- name: dynamicbible.comgsLink
# value: "gs://dynamicbible.com"
- name: dynamicbible.comselfLink
value: "https://console.cloud.google.com/storage/browser/dynamicbible.com"
- name: dynamicbible.comgsLink
value: "gs://dynamicbible.com"
- name: gitlab-service-account-id
value: $(ref.gitlab-service-account.uniqueId)
- name: gitlab-service-account-email