-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpackage-app.sh
More file actions
executable file
·36 lines (32 loc) · 1.36 KB
/
package-app.sh
File metadata and controls
executable file
·36 lines (32 loc) · 1.36 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
#!/usr/bin/env bash
# Build and package stirlingmerge for production deployment
# Usage: ./package-app.sh
set -e
APP=stirlingmerge
VERSION=$(grep -oP '(?<=<version>)[^<]+' stirlingmerge/appinfo/info.xml)
OUTFILE="${APP}-${VERSION}.tar.gz"
echo "Building JS assets..."
docker run --rm \
-v "$(pwd)/stirlingmerge:/app" \
-w /app \
node:20-alpine \
sh -c "npm install --legacy-peer-deps 2>/dev/null && npm run build"
echo "Packaging ${OUTFILE}..."
tar -czf "$OUTFILE" \
--exclude="${APP}/node_modules" \
--exclude="${APP}/src" \
--exclude="${APP}/package.json" \
--exclude="${APP}/package-lock.json" \
--exclude="${APP}/webpack.config.js" \
--exclude="${APP}/composer.json" \
"${APP}/"
echo "Done: ${OUTFILE} ($(du -sh "$OUTFILE" | cut -f1))"
echo ""
echo "Install on target NC server:"
echo " docker cp ${OUTFILE} <nc-container>:/var/www/html/apps/"
echo " docker exec <nc-container> tar -xzf /var/www/html/apps/${OUTFILE} -C /var/www/html/apps/"
echo " docker exec --user www-data <nc-container> php occ app:enable ${APP}"
echo " docker exec --user www-data <nc-container> php occ config:app:set ${APP} stirling_url --value='http://STIRLING_HOST:8080'"
echo " docker exec --user www-data <nc-container> php occ config:app:set ${APP} stirling_api_key --value='YOUR_KEY'"
echo ""
echo "Or configure via: Admin settings → Additional settings → Merge to PDF"