-
Notifications
You must be signed in to change notification settings - Fork 0
/
cloudbuild.yaml
30 lines (27 loc) · 1.02 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
steps:
# Building a Docker image for the web UI application
- name: 'gcr.io/cloud-builders/docker'
args: ['build', '-t', 'us-central1-docker.pkg.dev/qwiklabs-gcp-00-2ad8e3085b3b/test-repository/webapp', './webapp']
# Pushing the Docker image to the Artifact Registry
- name: 'gcr.io/cloud-builders/docker'
args: ['push', 'us-central1-docker.pkg.dev/qwiklabs-gcp-00-2ad8e3085b3b/test-repository/webapp']
id: 'Push WebApp Image to Test Registry'
# Obtaining credentials for GKE
- name: 'gcr.io/cloud-builders/gcloud'
args: ['container', 'clusters', 'get-credentials', 'test-cluster', '--region', 'us-central1', '--project', '$PROJECT_ID']
# Deploying the application in GKE
- name: 'google/cloud-sdk'
entrypoint: 'bash'
args:
- '-c'
- |
kubectl apply -f app-deployment.yaml
id: 'Deploy to GKE'
# Deploying the service in GKE
- name: 'google/cloud-sdk'
entrypoint: 'bash'
args:
- '-c'
- |
kubectl apply -f app-service.yaml
id: 'Deploy App Service'