DEVOPS: scripting for deployment to gcloud storage

This commit is contained in:
Jeremy Wall 2020-11-30 12:29:31 -05:00
parent a55d21e306
commit 7a91bb42ba
2 changed files with 67 additions and 0 deletions

18
src/Makefile Normal file
View File

@ -0,0 +1,18 @@
output := dist/dynamicbible/
test:
npm run-script test-headless
# For some reason karma is unable to connect to the browser here.
# I don't want to debug so not using test as a dependency.
build: test
npm run-script build
deploy-prod: build
gsutil -m rsync -d -r ${output} gs://dynamicbible.com
deploy-staging: build
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

49
src/gcloud/buckets.yaml Normal file
View File

@ -0,0 +1,49 @@
---
resources:
- name: staging.dynamicbible.com
type: storage.v1.bucket
properties:
bucket: staging.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
# defaultObjectAcl:
# - entity: allUsers
# role: READER
outputs:
#- name: dynamicbible.comselfLink
# value: "https://console.cloud.google.com/storage/browser/dynamicbible.com"
#- name: dynamicbible.comgsLink
# value: "gs://dynamicbible.com"
- name: staging.dynamicbible.comselfLink
value: "https://console.cloud.google.com/storage/browser/staging.dynamicbible.com"
- name: staging.dynamicbible.comgsLink
value: "gs://staging.dynamicbible.com"