2016-07-20 15:58:37 +01:00
|
|
|
#! /bin/bash
|
|
|
|
|
2017-10-06 13:59:58 -04:00
|
|
|
# ember s apiHost=https://demo1.dev:5001
|
|
|
|
# go run edition/community.go -port=5001 -forcesslport=5002 -cert selfcert/cert.pem -key selfcert/key.pem -salt=tsu3Acndky8cdTNx3
|
|
|
|
|
2016-07-20 15:58:37 +01:00
|
|
|
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
|
2017-08-08 11:24:21 +01:00
|
|
|
cp gui/dist-prod/manifest.json embed/bindata/public
|
2016-07-22 20:56:56 +01:00
|
|
|
rm -rf embed/bindata/mail
|
|
|
|
mkdir -p embed/bindata/mail
|
2017-08-02 15:26:31 +01:00
|
|
|
cp domain/mail/*.html embed/bindata/mail
|
2016-07-22 20:56:56 +01:00
|
|
|
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."
|