forked from openfrontio/OpenFrontIO
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcloudbuild.yaml
More file actions
38 lines (38 loc) · 1.15 KB
/
cloudbuild.yaml
File metadata and controls
38 lines (38 loc) · 1.15 KB
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
steps:
# Build the Docker image
- name: "gcr.io/cloud-builders/docker"
args:
[
"build",
"-t",
"us-central1-docker.pkg.dev/$PROJECT_ID/openfrontio/game-server:${TAG_NAME}-${SHORT_SHA}",
"--build-arg",
"GAME_ENV=${_GAME_ENV}",
".",
]
# Push the image to Artifact Registry
- name: "gcr.io/cloud-builders/docker"
args:
[
"push",
"us-central1-docker.pkg.dev/$PROJECT_ID/openfrontio/game-server:${TAG_NAME}-${SHORT_SHA}",
]
# Update the GCE instance with the new container image
- name: "gcr.io/cloud-builders/gcloud"
args:
- "compute"
- "instances"
- "update-container"
- "${_INSTANCE_NAME}"
- "--container-image"
- "us-central1-docker.pkg.dev/$PROJECT_ID/openfrontio/game-server:${TAG_NAME}-${SHORT_SHA}"
- "--zone=us-central1-a"
substitutions:
_INSTANCE_NAME: "openfrontio-dev-instance"
_GAME_ENV: "preprod" # Default to preprod
TAG_NAME: "dev"
options:
substitutionOption: "ALLOW_LOOSE"
logging: CLOUD_LOGGING_ONLY
images:
- "us-central1-docker.pkg.dev/$PROJECT_ID/openfrontio/game-server:${TAG_NAME}-${SHORT_SHA}"