This repository has been archived by the owner on Sep 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 84
/
Copy path.gitpod.yml
77 lines (65 loc) · 2.15 KB
/
.gitpod.yml
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
75
76
77
image:
file: .gitpod.dockerfile
# List the start up tasks. Learn more https://www.gitpod.io/docs/config-start-tasks/
tasks:
# modify .bashrc here.
# `PGHOSTADDR` is set to the Postgres server running on Gitpod. pyscopg2 picks up this
# variable and connects to that DB instead of the one we specify through data sources
# for some reason. So we unset this.
# See `DATABASE_URL_CG_DB` in `.gitpod.env` for the credentials to the Postgres server
# running inside Gitpod.
- before: printf 'unset PGHOSTADDR\n' >> $HOME/.bashrc && exit
# the backend server
- name: API Server
init: |
pip install wheel
pip install -r requirements/dev.txt
# notify that backend requirements have finished installing
gp sync-done backend-reqs
command: |
cp .gitpod.env .env.local
# get the URL for port 5000 exposed through Gitpod and use it as the WEBAPP_URL
# TODO: links to "View KPI", etc. won't work since they are on port 3000
sed -i "s~CHAOSGENIUS_WEBAPP_URL_HERE~`gp url 5000`~g" ".env.local"
# start postgres server
pg_start
# apply migrations
flask db upgrade
# notify that backend has been setup completely
gp sync-done backend-setup
bash dev_server.sh
- name: Webapp
init: |
cd frontend
npm install
command: |
cd frontend
# BASE_URL is set to port 5000 exposed through gitpod
REACT_APP_BASE_URL=`gp url 5000` npm start
- name: Redis
command: redis-server
- name: Workers and Scheduler
# TODO: is the await needed here?
init: gp sync-await backend-reqs
command: |
# wait all of backend setup (incl. migrations, env vars) to be completed
gp sync-await backend-setup
bash dev_workers.sh
ports:
# webapp
- port: 3000
onOpen: open-browser
visibility: "public"
# backend server
- port: 5000
visibility: "public"
vscode:
extensions:
- "ms-python.python"
- "samuelcolvin.jinjahtml"
github:
prebuilds:
# add a check to pull requests (defaults to true)
addCheck: false
# add a "Review in Gitpod" button as a comment to pull requests (defaults to false)
addComment: true