-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcloudbuild.yaml
55 lines (48 loc) · 2.13 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
47
48
49
50
51
52
53
54
55
# Build from GCP CloudBuild samples - github.com/GoogleCloudPlatform/cloud-build-samples/tree/main/python-example-flask
# [START cloudbuild_python_yaml]
# [START cloudbuild_python_dependencies_yaml]
steps:
# Install dependencies
- name: python
entrypoint: pip
args: ['install', '-r', 'requirements.txt', '--user']
id: 'install python dependencies'
# [END cloudbuild_python_dependencies_yaml]
# [START cloudbuild_python_tests_yaml]
# Run unit tests
#- name: python
# entrypoint: python
# args: ["-m", "pytest", "--junitxml=${SHORT_SHA}_test_log.xml"]
# [END cloudbuild_python_tests_yaml]
# [START cloudbuild_python_deploy_yaml]
- name: 'gcr.io/cloud-builders/gcloud'
args: ['app', 'deploy', 'app.yaml', '--project=personal-web-264205', '--version=$SHORT_SHA']
timeout: '1600s'
id: 'deploy to app engine'
# [END cloudbuild_python_deploy_yaml]
# [START cloudbuild_python_image_yaml]
# Docker Build
#- name: 'gcr.io/cloud-builders/docker'
# args: ['build', '-t',
# 'australia-southeast1-docker.pkg.dev/${PROJECT_ID}/${_ARTIFACT_REGISTRY_REPO}/myimage:${SHORT_SHA}', '.']
# [END cloudbuild_python_image_yaml]
# [START cloudbuild_python_push_yaml]
# Docker push to Google Artifact Registry
#- name: 'gcr.io/cloud-builders/docker'
# args: ['push', 'australia-southeast1-docker.pkg.dev/${PROJECT_ID}/${_ARTIFACT_REGISTRY_REPO}/myimage:${SHORT_SHA}']
# [END cloudbuild_python_push_yaml]
# [START cloudbuild_python_deploy_yaml]
# Deploy to Cloud Run
#- name: google/cloud-sdk
# args: ['gcloud', 'run', 'deploy', 'personalweb-${SHORT_SHA}',
# '--image=australia-southeast1-docker.pkg.dev/${PROJECT_ID}/${_ARTIFACT_REGISTRY_REPO}/myimage:${SHORT_SHA}',
# '--region', 'australia-southeast1', '--platform', 'managed',
# '--allow-unauthenticated']
# [END cloudbuild_python_deploy_yaml]
substitutions:
_ARTIFACT_REGISTRY_REPO: pw-artifacts
_BUCKET_NAME: pw-testlogs
# Store images in Google Artifact Registry
images:
# - australia-southeast1-docker.pkg.dev/${PROJECT_ID}/${_ARTIFACT_REGISTRY_REPO}/myimage:${SHORT_SHA}
# [END cloudbuild_python_yaml]