2016-07-20 15:58:37 +01:00
|
|
|
#! /bin/bash
|
|
|
|
|
|
|
|
NOW=$(date)
|
|
|
|
echo "Build process started $NOW"
|
|
|
|
|
|
|
|
echo "Building Ember assets..."
|
2017-07-19 14:48:33 +01:00
|
|
|
cd gui
|
2017-05-04 12:31:52 +01:00
|
|
|
ember b -o dist-prod/ --environment=production
|
2016-07-20 15:58:37 +01:00
|
|
|
|
|
|
|
echo "Copying Ember assets..."
|
|
|
|
cd ..
|
2016-07-22 20:56:56 +01:00
|
|
|
rm -rf embed/bindata/public
|
|
|
|
mkdir -p embed/bindata/public
|
2017-07-19 14:48:33 +01:00
|
|
|
cp -r gui/dist-prod/assets embed/bindata/public
|
|
|
|
cp -r gui/dist-prod/codemirror embed/bindata/public/codemirror
|
|
|
|
cp -r gui/dist-prod/tinymce embed/bindata/public/tinymce
|
|
|
|
cp -r gui/dist-prod/sections embed/bindata/public/sections
|
|
|
|
cp gui/dist-prod/*.* embed/bindata
|
|
|
|
cp gui/dist-prod/favicon.ico embed/bindata/public
|
2016-07-22 20:56:56 +01:00
|
|
|
rm -rf embed/bindata/mail
|
|
|
|
mkdir -p embed/bindata/mail
|
|
|
|
cp core/api/mail/*.html embed/bindata/mail
|
|
|
|
cp core/database/templates/*.html embed/bindata
|
|
|
|
rm -rf embed/bindata/scripts
|
|
|
|
mkdir -p embed/bindata/scripts
|
|
|
|
cp -r core/database/scripts/autobuild/*.sql embed/bindata/scripts
|
2016-07-20 15:58:37 +01:00
|
|
|
|
|
|
|
echo "Generating in-memory static assets..."
|
|
|
|
go get -u github.com/jteeuwen/go-bindata/...
|
|
|
|
go get -u github.com/elazarl/go-bindata-assetfs/...
|
2016-07-22 20:56:56 +01:00
|
|
|
cd embed
|
2016-07-20 15:58:37 +01:00
|
|
|
go generate
|
|
|
|
|
|
|
|
echo "Compiling app..."
|
2016-07-22 20:56:56 +01:00
|
|
|
cd ..
|
2016-07-20 15:58:37 +01:00
|
|
|
for arch in amd64 ; do
|
|
|
|
for os in darwin linux windows ; do
|
|
|
|
if [ "$os" == "windows" ] ; then
|
|
|
|
echo "Compiling documize-community-$os-$arch.exe"
|
2017-07-19 18:47:01 +01:00
|
|
|
env GOOS=$os GOARCH=$arch go build -gcflags=-trimpath=$GOPATH -asmflags=-trimpath=$GOPATH -o bin/documize-community-$os-$arch.exe ./edition/community.go
|
2016-07-20 15:58:37 +01:00
|
|
|
else
|
|
|
|
echo "Compiling documize-community-$os-$arch"
|
2017-07-19 18:47:01 +01:00
|
|
|
env GOOS=$os GOARCH=$arch go build -gcflags=-trimpath=$GOPATH -asmflags=-trimpath=$GOPATH -o bin/documize-community-$os-$arch ./edition/community.go
|
2016-07-20 15:58:37 +01:00
|
|
|
fi
|
|
|
|
done
|
|
|
|
done
|
|
|
|
|
|
|
|
echo "Finished."
|