Skip to content

Commit 4062054

Browse files
authored
ci: Add deployment preview to pull requests via Uffizzi integration (#2364)
1 parent 2238887 commit 4062054

File tree

3 files changed

+130
-0
lines changed

3 files changed

+130
-0
lines changed

docker-compose.uffizzi.yml

+75
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
version: '3'
2+
3+
# uffizzi integration
4+
x-uffizzi:
5+
ingress:
6+
service: nginx
7+
port: 8081
8+
continuous_previews:
9+
deploy_preview_when_pull_request_is_opened: true
10+
delete_preview_when_pull_request_is_closed: true
11+
share_to_github: true
12+
13+
services:
14+
15+
postgres:
16+
image: postgres
17+
environment:
18+
- POSTGRES_USER=postgres
19+
- POSTGRES_PASSWORD=password
20+
- POSTGRES_DB=postgres
21+
ports:
22+
- "5432:5432"
23+
deploy:
24+
resources:
25+
limits:
26+
memory: 1000M
27+
volumes:
28+
- postgres_data:/var/lib/postgresql
29+
30+
parse:
31+
image: parseplatform/parse-server:latest
32+
environment:
33+
- PARSE_SERVER_APPLICATION_ID=parse
34+
- PARSE_SERVER_MASTER_KEY=parse@master123!
35+
- PARSE_SERVER_DATABASE_URI=postgresql://postgres:password@localhost:5432/postgres
36+
- PARSE_SERVER_MOUNT_PATH=/parse
37+
- PORT=1337
38+
ports:
39+
- '1337:1337'
40+
deploy:
41+
resources:
42+
limits:
43+
memory: 1000M
44+
45+
dashboard:
46+
build:
47+
context: .
48+
dockerfile: ./Dockerfile
49+
ports:
50+
- "4040:4040"
51+
environment:
52+
- PARSE_DASHBOARD_MASTER_KEY=parse@master123!
53+
- PARSE_DASHBOARD_APP_ID=parse
54+
- PARSE_DASHBOARD_APP_NAME=MyParseApp
55+
- PARSE_DASHBOARD_USER_ID=admin
56+
- PARSE_DASHBOARD_USER_PASSWORD=password
57+
- MOUNT_PATH=/dashboard
58+
- PARSE_DASHBOARD_ALLOW_INSECURE_HTTP=1
59+
entrypoint: /bin/sh
60+
command:
61+
- "-c"
62+
- "PARSE_DASHBOARD_SERVER_URL=$$UFFIZZI_URL/parse node Parse-Dashboard/index.js"
63+
deploy:
64+
resources:
65+
limits:
66+
memory: 1000M
67+
68+
nginx:
69+
image: nginx:alpine
70+
volumes:
71+
- ./nginx-uffizzi:/etc/nginx
72+
- ./nginx-uffizzi/html:/usr/share/nginx/html
73+
74+
volumes:
75+
postgres_data:

nginx-uffizzi/html/index.html

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<!doctype html>
2+
3+
<html>
4+
5+
<head>
6+
7+
<title>Parse Dashboard Preview</title>
8+
9+
</head>
10+
11+
<body>
12+
13+
<h1>Endpoint:</h1>
14+
15+
<a href="/dashboard/"><b>Click to Visit Parse Dashboard</b></a>
16+
17+
</body>
18+
19+
</html>

nginx-uffizzi/nginx.conf

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
events {
2+
worker_connections 1024; #default
3+
}
4+
5+
http {
6+
7+
server {
8+
9+
listen 8081;
10+
11+
location / {
12+
root /usr/share/nginx/html;
13+
index index.html index.htm;
14+
}
15+
16+
location /dashboard {
17+
proxy_set_header X-Real-IP $remote_addr;
18+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
19+
proxy_set_header X-NginX-Proxy true;
20+
proxy_pass http://localhost:4040/dashboard/;
21+
proxy_ssl_session_reuse off;
22+
proxy_set_header Host $http_host;
23+
proxy_redirect off;
24+
}
25+
26+
location /parse {
27+
proxy_set_header X-Forwarded-For $remote_addr;
28+
proxy_set_header Host $host;
29+
proxy_set_header X-Real-IP $remote_addr;
30+
keepalive_requests 10;
31+
keepalive_timeout 75s;
32+
proxy_pass http://localhost:1337/parse/;
33+
proxy_http_version 1.1;
34+
}
35+
}
36+
}

0 commit comments

Comments
 (0)