27 lines
446 B
Bash
Executable File
27 lines
446 B
Bash
Executable File
#!/usr/bin/bash
|
|
|
|
set -e -u -o pipefail
|
|
|
|
# Build frontend
|
|
|
|
cd frontend
|
|
npm install
|
|
npm run build
|
|
(cd dist/assets && mv *.js ucs.js && mv *.css ucs.css)
|
|
cd ..
|
|
|
|
# Build backend
|
|
|
|
cd backend
|
|
npm install
|
|
cp ../frontend/dist/assets/* public/
|
|
|
|
# Bundle
|
|
|
|
PACKAGE="ucs-$(cat package.json | jq -r .version).tar.gz"
|
|
|
|
tar czvf "$PACKAGE" package.json package-lock.json node_modules/ src/ config/ public/
|
|
cd ..
|
|
mv backend/"$PACKAGE" .
|
|
echo "$PACKAGE created."
|