forked from fonoster/fonoster
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitpod.yml
69 lines (65 loc) 路 2.39 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
# 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 3000)
WEBUI_TEST_PHONE_SERVER=$(gp url 5062 | sed 's/http/ws/g')
cp .env.example .env
sed -i "s|REDIS_HOST=.*|REDIS_HOST=localhost|g" .env
sed -i "s|LOGS_DRIVER_HOST=.*|LOGS_DRIVER_HOST=localhost|g" .env
sed -i "s|LOGS_AGGREGRATOR_HOST=.*|LOGS_AGGREGRATOR_HOST=localhost|g" .env
sed -i "s|APISERVER_RBAC_CONFIG=.*|APISERVER_RBAC_CONFIG=/workspace/fonoster/mods/apiserver/etc/rbac.json|g" .env
sed -i "s|APISERVER_ENDPOINT=.*|APISERVER_ENDPOINT=localhost:50052|g" .env
sed -i "s|WEBUI_APISERVER_ENDPOINT=.*|WEBUI_APISERVER_ENDPOINT=localhost:50052|g" .env
sed -i "s|NEXTAUTH_URL=.*|NEXTAUTH_URL=$APP_URL|g" .env
sed -i "s|WEBUI_APP_URL=.*|WEBUI_APP_URL=$APP_URL|g" .env
sed -i "s|WEBUI_TEST_PHONE_SERVER=.*|WEBUI_TEST_PHONE_SERVER=$WEBUI_TEST_PHONE_SERVER|g" .env
sed -i "s|DOCKER_HOST_ADDRESS=.*|DOCKER_HOST_ADDRESS=$(gp url 5062 | sed 's|https://||')|g" .env
npm install
npm run build
mkdir ~/.fonoster
npm run gen:config
mv config ~/.fonoster/config
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: |
npm run start:apiserver
- name: Start Web UI
before: |
while [ ! -f /workspace/.init_done ]; do sleep 2; done
command: |
npm run start:webui
- name: Start Docker Containers
before: |
while [ ! -f /workspace/.init_done ]; do sleep 2; done
command: |
npm run start:services
exit
ports:
- port: 50052
onOpen: ignore
visibility: public
- port: 5060
onOpen: ignore
- port: 5061
onOpen: ignore
- port: 5062
onOpen: ignore
visibility: public
- port: 5063
onOpen: ignore
- port: 3000
onOpen: open-preview
visibility: public