-
Notifications
You must be signed in to change notification settings - Fork 9
/
package.sh
executable file
·51 lines (41 loc) · 1.15 KB
/
package.sh
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/bin/sh
set -e
go get github.com/benbjohnson/ego/cmd/ego
go get github.com/FinalLevel/go-i18n/goi18n
(cd translation
$GOPATH/bin/goi18n *.all.json *.untranslated.json
$GOPATH/bin/goi18n *.all.json
)
go generate
go build -o $1
(cd public && bower install)
node_modules/.bin/uglifyjs ./public/bower_components/crypto-js/crypto-js.js -c -o ./public/bower_components/crypto-js/crypto-js.min.js
for i in `find public/bower_components/ -name "*.min.js"`
do
gzip -c $i > $i.gz
done
rm -f public/css/*.min.css
for i in `ls public/css/*.css`
do
minVer=`echo $i | sed 's/\.css/.min.css/'`
node_modules/.bin/minify $i --output $minVer
gzip -c $i > $i.gz
gzip -c $minVer > $minVer.gz
done
for i in `ls public/js/*.js | grep -v '.min.'`
do
minVer=`echo $i | sed 's/\.js/.min.js/'`
rm -f $minVer
node_modules/.bin/uglifyjs $i -c -o $minVer
gzip -c $i > $i.gz
gzip -c $minVer > $minVer.gz
done
release=1
githash=`git rev-parse --short HEAD`
gitnum=`git rev-list v$release..HEAD --count`
ver=${release}.${gitnum}-${githash}
mkdir -p pkgs
rm -f pkgs/*
archive=pkgs/$1.$branch$ver.tar
tar -cf $archive $1 translation public
gzip $archive