-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathclouddeploy.yaml
74 lines (74 loc) · 1.58 KB
/
clouddeploy.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
steps:
- id: venv
name: gcr.io/$PROJECT_ID/python-cloudbuild
waitFor:
- "-"
entrypoint: /bin/bash
args:
- -c
- "virtualenv /workspace/venv"
- id: python_packages
name: gcr.io/$PROJECT_ID/python-cloudbuild
waitFor:
- venv
entrypoint: venv/bin/pip
args:
- install
- -q
- -r
- requirements.txt
- id: pylint
name: gcr.io/$PROJECT_ID/python-cloudbuild
waitFor:
- python_packages
entrypoint: venv/bin/pylint
args:
- "src"
- "tests"
- id: black
name: gcr.io/$PROJECT_ID/python-cloudbuild
waitFor:
- python_packages
entrypoint: venv/bin/black
args:
- --check
- src
- tests
- id: pytest
name: gcr.io/$PROJECT_ID/python-cloudbuild
waitFor:
- python_packages
entrypoint: venv/bin/pytest
args:
- -vv
- id: bot-build
name: gcr.io/cloud-builders/gcloud
waitFor:
- "-"
args:
- builds
- submit
- .
- --tag
- gcr.io/$PROJECT_ID/bot
- id: bot-deploy
name: gcr.io/cloud-builders/gcloud
waitFor:
- pytest
- pylint
- black
- bot-build
entrypoint: /bin/bash
args:
- "-c"
- |
gcloud run deploy \
bot \
--image=gcr.io/$PROJECT_ID/bot \
--allow-unauthenticated \
--memory=128Mi \
--platform=managed \
--region=us-central1 \
# s/: *'/=/g --> change ": '" for "="
# s/' *$// --> remove last single quote of the line
# paste -sd ',' - --> join lines using commas