Added build package script

This commit is contained in:
Lukas Metzger 2018-04-29 20:50:50 +02:00
parent 2df4ce991a
commit 67d3981694
3 changed files with 45 additions and 0 deletions

View file

@ -22,3 +22,4 @@ script:
- .travis/frontend-build.sh
- .travis/backend-lint.sh
- .travis/backend-test.sh
- .travis/build-package.sh

12
.travis/build-package.sh Executable file
View file

@ -0,0 +1,12 @@
#!/bin/bash
if test $TRAVIS_TAG
then
utils/make-package.sh pdnsmanager-$TRAVIS_TAG
else
utils/make-package.sh pdnsmanager-$TRAVIS_COMMIT
fi
exit 0

32
utils/make-package.sh Executable file
View file

@ -0,0 +1,32 @@
#!/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"
# Create archive
tar -czf "$1".tar.gz "$1"
# Remove temp data
rm -rf "$1"
exit 0