-
-
Notifications
You must be signed in to change notification settings - Fork 9
/
.gitpod.yml
100 lines (95 loc) · 3.33 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
## Learn more about this file at 'https://www.gitpod.io/docs/references/gitpod-yml'
##
## This '.gitpod.yml' file when placed at the root of a project instructs
## Gitpod how to prepare & build the project, start development environments
## and configure continuous prebuilds. Prebuilds when enabled builds a project
## like a CI server so you can start coding right away - no more waiting for
## dependencies to download and builds to finish when reviewing pull-requests
## or hacking on something new.
##
tasks:
- name: Initial Setup
init: |
APP_URL=$(gp url 8080)
SIGNALING_HOST=$(gp url 9000 | sed 's/https:\/\///g')
SIGNALING_PORT=443
cp .env.example .env
sed -i "s|APP_URL=.*|APP_URL=$APP_URL|g" .env
sed -i "s|SIGNALING_HOST=.*|SIGNALING_HOST=$SIGNALING_HOST|g" .env
sed -i "s|SIGNALING_PORT=.*|SIGNALING_PORT=$SIGNALING_PORT|g" .env
sed -i "s|postgresql://postgres:postgres@postgres:5432/goodtok|postgresql://postgres:postgres@localhost:5432/goodtok|g" .env
sed -i "s|DOCKER_HOST_ADDRESS=.*|DOCKER_HOST_ADDRESS=$(gp url 5062 | sed 's|https://||')|g" .env
npm install
npm run build
touch /workspace/.init_done
exit
command: echo "Initial Setup Complete"
- name: Start API Server
before: |
while [ ! -f /workspace/.init_done ]; do sleep 2; done
command: |
gp ports await 5432 # Wait for postgres to be ready
npm run start:apiserver
- name: Start Front Office
before: |
while [ ! -f /workspace/.init_done ]; do sleep 2; done
API_ENDPOINT=$(gp url 6789)/v1
sed -i "s|http://localhost:6789/v1|$API_ENDPOINT|g" /workspace/goodtok/mods/frontoffice/index.html
command: npm run start:frontoffice
- name: Start Demo Widget
before: |
while [ ! -f /workspace/.init_done ]; do sleep 2; done
API_ENDPOINT=$(gp url 6789)/v1
KEY=$(echo -n "{\"gtid\":\"g-7b7c46fb05\",\"server\":\"$API_ENDPOINT\"}" | base64 -w 0)
sed -i "s|key=[^&\"]*|key=$KEY|g" /workspace/goodtok/mods/widget/index.html
command: npm run start:widget
- name: Start Docker Containers
before: |
while [ ! -f /workspace/.init_done ]; do sleep 2; done
command: |
npm run start:services
gp ports await 5432
sleep 10 # Check for the port only is flaky, so we wait a bit more
npm run db:migrate
exit
ports:
- name: Front Office
description: The dahsboard for the Goodtok platform
port: 8080
visibility: public
onOpen: open-browser
- name: Demo Widget
description: A demo of the video widget
port: 8181
visibility: public
onOpen: open-browser
- name: Mailhog Web UI
description: Mailhog SMTP server for testing
port: 8025
visibility: public
onOpen: open-browser
- name: Mailhog SMTP Server
description: Mailhog SMTP server for testing
port: 1025
visibility: private
onOpen: ignore
- name: API Server
description: The Goodtok API server
port: 6789
visibility: public
onOpen: ignore
- name: PeerJS
description: PeerJS signaling server
port: 9000
visibility: public
onOpen: ignore
- name: PostgreSQL
description: PostgreSQL database
port: 5432
visibility: private
onOpen: ignore
- name: Adminer
description: Adminer database management tool
port: 8282
visibility: public
onOpen: ignore