-
Notifications
You must be signed in to change notification settings - Fork 2
78 lines (65 loc) · 3.04 KB
/
run-testsystem.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
name: Run DFG-Viewer test system over ngrok
on:
# Allows you to run this workflow manually
workflow_dispatch:
jobs:
build-and-run:
name: DFG-Viewer with ngrok tunnel
runs-on: ubuntu-latest
steps:
- name: Checkout DLF 3D Viewer Repository
uses: actions/checkout@v4
- name: Checkout DFG-Viewer Repository
uses: actions/checkout@v4
with:
repository: 'markusweigelt/dfg-viewer'
ref: 'docker'
path: 'dfg-viewer'
- name: Prepare environment
working-directory: dfg-viewer/Docker
run: |
# Rename example .env file
mv .env.example .env
# overwrite image path
sed -i "s|ghcr.io/slub/dfg-viewer|ghcr.io/markusweigelt/dfg-viewer|g" .env
# overwirte trusted host pattern config with ngrok url
sed -i "s|APP_T3_CONFIG_SYS_TRUSTEDHOSTSPATTERN=""|APP_T3_CONFIG_SYS_TRUSTEDHOSTSPATTERN=".*"|g" .env
- name: Run DFG-Viewer using Docker Compose
working-directory: dfg-viewer/Docker
run: |
docker compose up -d
- name: Install 3D viewer integrations
run: |
docker exec -u root -i dfg-viewer-app-1 sh -c "\
apt-get update && apt-get install unzip \
&& wget "https://github.com/slub/dlf-3d-viewers/archive/refs/heads/main.zip" -O /tmp/dlf-3d-viewers.zip \
&& cd /var/www/html/dfg-viewer/public/fileadmin\
&& unzip /tmp/dlf-3d-viewers.zip\
&& mv dlf-3d-viewers-main dlf_3d_viewers\
&& rm /tmp/dlf-3d-viewers.zip\
&& sh dlf_3d_viewers/install.sh\
&& chown -R www-data:www-data dlf_3d_viewers"
# workaround for issue https://github.com/slub/dlf-3d-viewers/issues/93
- name: Install PLY 3D model
run: |
docker exec -u root -i dfg-viewer-app-1 sh -c "\
mkdir -p /var/www/html/dfg-viewer/public/fileadmin/models\
&& wget "https://github.com/cnr-isti-vclab/3DHOP/raw/refs/heads/master/examples/models/gargo.ply"\
&& chown -R www-data:www-data /var/www/html/dfg-viewer/public/fileadmin/models"
# installation routine of ngrok https://dashboard.ngrok.com/get-started/setup/linux
- name: Install ngrok
run: |
curl -sSL https://ngrok-agent.s3.amazonaws.com/ngrok.asc \
| sudo tee /etc/apt/trusted.gpg.d/ngrok.asc >/dev/null \
&& echo "deb https://ngrok-agent.s3.amazonaws.com buster main" \
| sudo tee /etc/apt/sources.list.d/ngrok.list \
&& sudo apt update \
&& sudo apt install ngrok
- name: Run ngrok to make DFG-Viewer available
timeout-minutes: 61
run: |
# set auth token from repository secrets
ngrok config add-authtoken ${{ secrets.NGROK_AUTH_TOKEN }}
# set timeout for ngrok command and exit without failure of the current step
timeout 60m ngrok http --url=bear-genuine-hookworm.ngrok-free.app 80 \
|| ( [[ $? -eq 124 ]] && echo "WARNING: Timeout reached, but step succeed" )