pdnsmanager/utils/make-package.sh
2019-12-27 12:22:26 +01:00

39 lines
469 B
Bash
Executable file

#!/bin/bash
mkdir "$1"
# Copy backend
rsync -a backend/src/ "$1"/backend
rm -f "$1"/backend/config/ConfigUser.php
# Copy frontend
cd frontend/
npm run build --prod
cd ..
rsync -a frontend/dist/ "$1"/frontend
cd frontend/
rm -rf dist/
cd ..
# Copy additional files
cp LICENSE "$1"
cp README.md "$1"
# Add version info
cat << EOF > "$1"/version.json
{
"version": "$2"
}
EOF
# Create archive
tar -czf "$1".tar.gz "$1"
# Remove temp data
rm -rf "$1"
exit 0