File tree Expand file tree Collapse file tree 2 files changed +21
-15
lines changed Expand file tree Collapse file tree 2 files changed +21
-15
lines changed Original file line number Diff line number Diff line change 10
10
# limitations under the License.
11
11
12
12
steps :
13
- - id : " Docker build"
14
- name : " gcr.io/cloud-builders/docker"
15
- args :
16
- ["build", "-t", "${_AR_REPO_URL}/filesystem-e2e-test:${BUILD_ID}", "."]
17
- - id : " Docker push to Artifact Registry"
18
- name : " gcr.io/cloud-builders/docker"
19
- args : ["push", "${_AR_REPO_URL}/filesystem-e2e-test:${BUILD_ID}"]
20
13
- id : " Deploy to Cloud Run"
21
14
name : " gcr.io/cloud-builders/gcloud:latest"
22
15
args :
23
16
- beta
24
17
- run
25
18
- deploy
26
19
- ${_SERVICE_NAME}
27
- - --image=${_AR_REPO_URL}/filesystem-e2e-test:${BUILD_ID}
20
+ - --source=.
28
21
- --execution-environment=gen2
29
22
- --vpc-connector=${_CONNECTOR}
30
23
- --update-env-vars=FILESTORE_IP_ADDRESS=${_FILESTORE_IP_ADDRESS},FILE_SHARE_NAME=${_FILESHARE}
31
24
- --region=${_DEPLOY_REGION}
32
25
- --no-allow-unauthenticated
33
26
34
27
substitutions :
28
+ _SERVICE_NAME : filesystem
35
29
_DEPLOY_REGION : us-central1
36
30
_FILESHARE : vol1
37
- _AR_REPO_URL : us-central1-docker.pkg.dev/${PROJECT_ID}/cloud-run-source-deploy
38
-
39
- options :
40
- dynamic_substitutions : true
31
+ _CONNECTOR : my-run-connector
32
+ _FILESTORE_IP_ADDRESS : 0.0.0.0
Original file line number Diff line number Diff line change 27
27
# Unique suffix to create distinct service names
28
28
SUFFIX = uuid .uuid4 ().hex
29
29
PROJECT = os .environ ['GOOGLE_CLOUD_PROJECT' ]
30
+ region = 'us-central1'
30
31
31
32
32
33
@pytest .fixture
@@ -58,10 +59,23 @@ def deployed_service():
58
59
'services' ,
59
60
'delete' ,
60
61
service_name ,
61
- '--region=us-central1 ' ,
62
+ f '--region={ region } ' ,
62
63
'--platform=managed' ,
63
64
'--quiet' ,
64
- "--async" ,
65
+ '--project' ,
66
+ PROJECT ,
67
+ ]
68
+ )
69
+
70
+ subprocess .check_call (
71
+ [
72
+ 'gcloud' ,
73
+ 'artifacts' ,
74
+ 'docker' ,
75
+ 'images' ,
76
+ 'delete' ,
77
+ f'{ region } -docker.pkg.dev/{ PROJECT } /cloud-run-source-deploy/{ service_name } ' ,
78
+ '--quiet' ,
65
79
'--project' ,
66
80
PROJECT ,
67
81
]
@@ -79,7 +93,7 @@ def service_url_auth_token(deployed_service):
79
93
'services' ,
80
94
'describe' ,
81
95
deployed_service ,
82
- '--region=us-central1 ' ,
96
+ f '--region={ region } ' ,
83
97
'--platform=managed' ,
84
98
'--format=value(status.url)' ,
85
99
'--project' ,
You can’t perform that action at this time.
0 commit comments