forked from Seneca-CDOT/telescope
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitpod.yml
116 lines (110 loc) · 4.19 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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
# Learn more about this file at https://www.gitpod.io/docs/references/gitpod-yml
image:
file: .gitpod.Dockerfile
tasks:
- name: Service Server
openMode: split-left
# Copying env.development and replacing 'localhost' with Gitpod urls
before: |
eval $(gp env -e WEB_URL=$(gp url 8000))
eval $(gp env -e API_HOST=$(gp url 8443))
eval $(gp env -e SSO_LOGIN_URL=$(gp url 8081))
eval $(gp env -e SUPABASE_API=$(gp url 8911))
eval $(gp env -e SERVICES="status image sso search posts feed-discovery redis elasticsearch login")
sed -r \
-e "s@(.+=)http://localhost:8000(/[^ ]*)*@\1$WEB_URL\2@g" \
-e "s@(.+=)http://localhost:8081(/[^ ]*)*@\1$SSO_LOGIN_URL\2@g" \
-e "s@(.+=)http://kong:8000(/[^ ]*)*@\1$SUPABASE_API\2@g" \
-e "s@(.+=)http://localhost([^:]*)@\1$API_HOST\2@g" \
-e "s@development\.yml@gitpod\.yml@" \
config/env.development > .env
init: |
pnpm install & \
docker-compose --env-file .env build $SERVICES & \
docker-compose --env-file .env pull
command: |
docker-compose --env-file .env up -d $SERVICES
pnpm start
- name: Frontend Server
openMode: split-right
# Update environment variables of the current terminal
before: |
eval $(gp env -e)
# Start the dev server after all services are running
# Instead of rebuilding the nginx-base frontend when environment variables change
# We build the frontend directly through 'pnpm dev' to use the latest urls
command: |
gp await-port 3000 && pnpm dev
- name: Terminal
openMode: tab-after
command: |
echo -e "\n\n\033[94m ======================================================" && echo -e "\n\033[33m💪 Services are built and run automatically in the first terminal, the second one is free" && echo -e "\033[33m💡 If you are only developing on the frontend:" && echo -e "\033[33m 1. Switch to the first terminal and terminate the prebuilds: \e[91mCTRL/CMD + c" && echo -e "\033[33m 2. Install dependencies: $ \033[92mpnpm install" && echo -e "\033[33m 3. Copy staging env: $ \033[92mcp config/env.staging > .env" && echo -e "\033[33m 4. Start the dev server: $ \033[92mpnpm dev" && echo -e "\033[33m💡 If you need to test the backend:" && echo -e "\033[33m 1. Go grab a coffee and wait, the build is only done once for each commit" && echo -e "\n\033[94m ======================================================\n\n"
# Exposing service ports
# Overriding the default notification popup when a port is open
ports:
- port: 8000
name: frontend
visibility: public
onOpen: open-preview
- port: 3000
name: web-api
visibility: public
onOpen: ignore
- port: 8443
name: micro-services
visibility: public
onOpen: ignore
- port: 6379
name: redis
onOpen: ignore
- port: 9200
name: elasticsearch
onOpen: ignore
- port: 8080
name: traefik
onOpen: ignore
- port: 8081
name: login
onOpen: ignore
- port: 8888
name: test-web-content
onOpen: ignore
- port: 7777
name: auth
onOpen: ignore
# Supabase Services
- port: 8910
name: supabase-studio
onOpen: notify
- port: 8911
name: kong-http
onOpen: ignore
- port: 8912
name: kong-https
onOpen: ignore
- port: 8913
name: postgresql
onOpen: ignore
github:
prebuilds:
# enable for the default branch (defaults to true)
master: true
# enable for all branches in this repo (defaults to false)
branches: true
# enable for pull requests coming from this repo (defaults to true)
pullRequests: true
# enable for pull requests coming from forks (defaults to false)
pullRequestsFromForks: true
# add a check to pull requests (defaults to true)
addCheck: true
# add a "Review in Gitpod" button as a comment to pull requests (defaults to false)
addComment: true
# add a "Review in Gitpod" button to the pull request's description (defaults to false)
addBadge: false
# Install recommended extension, only installed once each user
vscode:
extensions:
- editorconfig.editorconfig
- dbaeumer.vscode-eslint
- esbenp.prettier-vscode
- streetsidesoftware.code-spell-checker