-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcloudbuild.yaml
41 lines (39 loc) · 1.25 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
steps:
# # Step 1: Clone the Git repository into a subdirectory
# - name: 'gcr.io/cloud-builders/git'
# args: ['clone', 'https://github.com/pybase-net/python-tools.git', '/workspace/repo']
#
# # Step 2: Build the Docker image from the cloned repository
# - name: 'gcr.io/cloud-builders/docker'
# args: [
# 'build',
# '-t', 'gcr.io/$PROJECT_ID/python-tools:latest',
# '.'
# ]
# dir: '/workspace/repo'
#
# # Step 3: Push the Docker image with the commit SHA tag
# - name: 'gcr.io/cloud-builders/docker'
# args: [
# 'push', 'gcr.io/$PROJECT_ID/python-tools:latest'
# ]
#
# # Step 4: Push the Docker image with the latest tag
# - name: 'gcr.io/cloud-builders/docker'
# args: [
# 'push', 'gcr.io/$PROJECT_ID/python-tools:latest'
# ]
# Step 5: Optionally, deploy the image to Cloud Run or another service
- name: 'gcr.io/cloud-builders/gcloud'
args: [
'run', 'deploy', 'python-tools-service',
'--image', 'gcr.io/$PROJECT_ID/python-tools:latest',
'--platform', 'managed',
'--region', 'us-central1',
'--network', 'default',
'--subnet', 'default',
'--allow-unauthenticated',
'--set-env-vars', 'REDISHOST=10.118.224.27'
]
images:
- 'gcr.io/$PROJECT_ID/python-tools:latest'