-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathdev.sh
More file actions
executable file
·93 lines (83 loc) · 2.24 KB
/
Copy pathdev.sh
File metadata and controls
executable file
·93 lines (83 loc) · 2.24 KB
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
#!/usr/bin/env bash
# Run one or more extensions in watch+serve mode for local development.
#
# Usage:
# ./dev.sh # serve all active extensions
# ./dev.sh ifc-js draw-io jupyter # serve specific extensions
#
# Extension JS is served over HTTPS using the traefik self-signed certs
# generated by `docker compose up` in ../web. On first run per browser
# session, open each https://localhost:92XX URL and accept the cert.
#
# Port map:
# ifc-js 9210
# cernbox-integration 9211
# codimd 9212
# data-repositories 9213
# draw-io 9214
# jupyter 9215
# lightweight-accounts 9216
# ms-tracing 9217
# ndmspc-reader 9218
# old-web-redirector 9219
# open-in-swan 9220
# otg 9221
# rootjs 9222
# search-in-folder 9223
# tours 9224
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
CERTS_DIR="$SCRIPT_DIR/../web/dev/docker/traefik/certificates"
if [[ ! -f "$CERTS_DIR/server.key" ]]; then
echo "ERROR: TLS certs not found at $CERTS_DIR"
echo "Run 'docker compose up traefik' in ../web first to generate them."
exit 1
fi
export OWNCLOUD_CERTS_DIR="$CERTS_DIR"
ALL_EXTENSIONS=(
ifc-js
cernbox-integration
codimd
data-repositories
draw-io
jupyter
lightweight-accounts
ms-tracing
ndmspc-reader
old-web-redirector
open-in-swan
otg
rootjs
search-in-folder
tours
)
if [[ $# -gt 0 ]]; then
EXTENSIONS=("$@")
else
EXTENSIONS=("${ALL_EXTENSIONS[@]}")
fi
PIDS=()
cleanup() {
echo ""
echo "Stopping extension servers..."
for pid in "${PIDS[@]}"; do
kill "$pid" 2>/dev/null || true
done
}
trap cleanup EXIT INT TERM
for ext in "${EXTENSIONS[@]}"; do
dir="$SCRIPT_DIR/$ext"
if [[ ! -d "$dir" ]]; then
echo "WARNING: $ext not found, skipping"
continue
fi
echo "Starting $ext..."
(cd "$dir" && pnpm build:w) &
PIDS+=($!)
done
echo ""
echo "Extensions running. Web config: ../web/dev/docker/ocis.web.local.config.json"
echo "Start OCIS with (from ../web):"
echo " OCIS_WEB_CONFIG=./dev/docker/ocis.web.local.config.json docker compose -f docker-compose.yml -f docker-compose.local.yml up ocis traefik tika"
echo ""
wait