-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcloudbuild-dev.yaml
More file actions
23 lines (20 loc) · 924 Bytes
/
cloudbuild-dev.yaml
File metadata and controls
23 lines (20 loc) · 924 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
steps:
# Step 1: Compile the Go Application
- name: 'gcr.io/cloud-builders/go'
env: ['GOPATH=/gopath']
args: ['build', '-o', 'main', 'main.go']
# Step 2: Build the Docker image for the Go application
- name: 'gcr.io/cloud-builders/docker'
args: ['build', '-t', '<your-region>-docker.pkg.dev/$PROJECT_ID/my-repository/hello-cloudbuild-dev:<version>', '.']
# Step 3: Push the Docker image to Artifact Registry
- name: 'gcr.io/cloud-builders/docker'
args: ['push', '<your-region>-docker.pkg.dev/$PROJECT_ID/my-repository/hello-cloudbuild-dev:<version>']
# Step 4: Apply the production deployment YAML file to the production namespace
- name: 'gcr.io/cloud-builders/kubectl'
id: 'Deploy'
args: ['-n', 'dev', 'apply', '-f', 'dev/deployment.yaml']
env:
- 'CLOUDSDK_COMPUTE_REGION=<your-zone>'
- 'CLOUDSDK_CONTAINER_CLUSTER=hello-cluster'
options:
logging: CLOUD_LOGGING_ONLY