-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcloudbuild.yaml
46 lines (41 loc) · 1.26 KB
/
cloudbuild.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
steps:
- id: "build container image"
name: 'gcr.io/cloud-builders/docker'
args: ['build', '-t', 'gcr.io/$PROJECT_ID/goquizbox', '.']
- id: "push container image"
name: 'gcr.io/cloud-builders/docker'
args: ['push', 'gcr.io/$PROJECT_ID/goquizbox']
# - id: 'goose run migrations'
# name: 'golang:1.19.5'
# entrypoint: 'sh'
# args:
# - '-c'
# - |
# go install github.com/pressly/goose/v3/cmd/goose@latest
# echo "Running goose migrations"
# goose -dir migrations postgres "postgres://eutychus:[email protected]/goquizbox" up
- id: 'goose run migrations'
name: 'ektowett/client:v0.1.1'
entrypoint: 'sh'
args:
- '-c'
- |
curl -fsSL \
https://raw.githubusercontent.com/pressly/goose/master/install.sh |\
sh
goose -dir migrations postgres "postgres://eutychus:[email protected]/goquizbox" up
- id: "initiate cloudrun deployment"
name: 'gcr.io/google.com/cloudsdktool/cloud-sdk'
entrypoint: gcloud
args:
- 'run'
- 'deploy'
- 'goquizbox'
- '--image'
- 'gcr.io/$PROJECT_ID/goquizbox'
- '--region'
- 'europe-west1'
- '--update-env-vars'
- 'DB_NAME=goquizbox,DB_USER=eutychus,DB_PASSWORD=FZYxPMt2dEGTNZ8G,DB_HOST=35.233.7.52,ENV=live'
images:
- 'gcr.io/$PROJECT_ID/goquizbox'