Added: create-bundle script

This commit is contained in:
Christoph Wiechert
2017-05-07 21:43:30 +02:00
parent 747ada10e5
commit 5b2ffa911c
4 changed files with 35 additions and 3 deletions

View File

@@ -1,8 +1,10 @@
.idea
data
tmp
temp
node_modules
app/node_modules
npm-debug.log
scripts
docs
_releases

1
.gitignore vendored
View File

@@ -3,3 +3,4 @@ data
temp
node_modules
npm-debug.log
_releases

32
scripts/create-bundle.sh Executable file
View File

@@ -0,0 +1,32 @@
#!/usr/bin/env bash
set -e
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd $DIR
# Get the current tag or use commit hash if there's none
NAME=$(git describe --exact-match --tags $(git log -n1 --pretty='%h') 2>/dev/null || git log -n1 --pretty='%h')
echo "Building app"
cd $DIR/../app
npm install
npm run build
echo "Bundling to _releases/psitransfer-$NAME.tar.gz"
cd $DIR/..
mkdir -p _releases
tar -czf _releases/psitransfer-$NAME.tar.gz --transform "s~^~psitransfer-$NAME/~" \
LICENSE \
README.md \
Dockerfile \
.dockerignore \
app.js \
config.js \
package.json \
docs \
lib \
public
echo "DONE"

View File

@@ -1,3 +0,0 @@
#!/usr/bin/env bash
# tar -czf psitransfer-1.0.0-rc.1.tar.gz --transform 's~^~psitransfer-1.0.0-rc.1/~' LICENSE README.md app.js config.* data lib package.json public