Skip to content

Commit 32c6fa1

Browse files
committed
Try to cloudbuild
1 parent 0372790 commit 32c6fa1

File tree

4 files changed

+45
-0
lines changed

4 files changed

+45
-0
lines changed

infra/app.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
runtime: python310
2+
service: backend
3+
env_variables:
4+
DEBUG: 0

infra/cloudbuild.yaml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
steps:
2+
- name: ubuntu
3+
entrypoint: bash
4+
args:
5+
- '-c'
6+
- |
7+
apt update
8+
apt install python3 python3-pip -y
9+
pip3 install poetry
10+
poetry export >| requirements.txt
11+
12+
- name: ubuntu
13+
entrypoint: bash
14+
args:
15+
- '-c'
16+
- |
17+
printenv >| .env
18+
env:
19+
- 'SECRET_KEY=${_SECRET_KEY}'
20+
- 'DATABASE_URL=${_DATABASE_URL}'
21+
- 'REDIS_URL=${_REDIS_URL}'
22+
- 'TYPESENSE_API_KEY=${_TYPESENSE_API_KEY}'
23+
- 'TYPESENSE_HOST=${_TYPESENSE_HOST}'
24+
25+
- name: python
26+
entrypoint: pip
27+
args: [ "install", "-r", "requirements.txt", "--user" ]
28+
29+
- name: python
30+
entrypoint: python
31+
args: [ "manage.py", "collectstatic", "--noinput" ]
32+
33+
- name: "gcr.io/cloud-builders/gcloud"
34+
args: [ "app", "deploy", "--appyaml=infra/app.yaml" ]

infra/dispatch.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# I'm not sure why I needed this for my DNS to work, but I'll keep it just in case
2+
dispatch:
3+
- url: "backend.sora-reader.app/*"
4+
service: backend

main.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from manga_reader.wsgi import application
2+
3+
app = application

0 commit comments

Comments
 (0)