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
|
2019-01-07 14:43:56 +00:00
|
|
|
ember build ---environment=production --output-path dist-prod --suppress-sizes true
|
|
|
|
cd ..
|
2016-07-20 15:58:37 +01:00
|
|
|
|
|
|
|
echo "Copying Ember assets..."
|
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
|
2019-01-07 14:43:56 +00:00
|
|
|
cp -r gui/dist-prod/prism embed/bindata/public/prism
|
2017-07-19 14:48:33 +01:00
|
|
|
cp -r gui/dist-prod/sections embed/bindata/public/sections
|
2019-01-07 14:43:56 +00:00
|
|
|
cp -r gui/dist-prod/tinymce embed/bindata/public/tinymce
|
2019-04-19 15:09:12 +01:00
|
|
|
cp -r gui/dist-prod/pdfjs embed/bindata/public/pdfjs
|
2017-07-19 14:48:33 +01:00
|
|
|
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
|
2019-01-07 14:43:56 +00:00
|
|
|
|
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
|
2019-01-07 14:43:56 +00:00
|
|
|
|
2016-07-22 20:56:56 +01:00
|
|
|
rm -rf embed/bindata/scripts
|
|
|
|
mkdir -p embed/bindata/scripts
|
2018-09-14 12:50:30 +01:00
|
|
|
mkdir -p embed/bindata/scripts/mysql
|
2018-09-26 17:59:56 +01:00
|
|
|
mkdir -p embed/bindata/scripts/postgresql
|
2019-03-29 16:42:49 +00:00
|
|
|
mkdir -p embed/bindata/scripts/sqlserver
|
2018-09-14 12:50:30 +01:00
|
|
|
cp -r core/database/scripts/mysql/*.sql embed/bindata/scripts/mysql
|
2018-09-26 17:59:56 +01:00
|
|
|
cp -r core/database/scripts/postgresql/*.sql embed/bindata/scripts/postgresql
|
2019-03-29 16:42:49 +00:00
|
|
|
cp -r core/database/scripts/sqlserver/*.sql embed/bindata/scripts/sqlserver
|
2016-07-20 15:58:37 +01:00
|
|
|
|
2019-06-24 17:01:56 +01:00
|
|
|
rm -rf embed/bindata/onboard
|
|
|
|
mkdir -p embed/bindata/onboard
|
|
|
|
cp -r domain/onboard/*.json embed/bindata/onboard
|
|
|
|
|
2016-07-20 15:58:37 +01:00
|
|
|
echo "Generating in-memory static assets..."
|
2021-03-16 13:58:27 -04:00
|
|
|
export PATH=$PATH:~/go/bin
|
2018-02-07 19:16:23 +00:00
|
|
|
# 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
|
|
|
|
|
2016-07-22 20:56:56 +01:00
|
|
|
cd ..
|
2019-05-15 16:45:26 +01:00
|
|
|
echo "Compiling for Linux..."
|
2020-02-15 15:42:54 +00:00
|
|
|
env GOOS=linux GOARCH=amd64 go build -mod=vendor -trimpath -o bin/documize-community-linux-amd64 ./edition/community.go
|
2021-03-28 16:03:47 -04:00
|
|
|
echo "Compiling for macOS Intel..."
|
2020-02-15 15:42:54 +00:00
|
|
|
env GOOS=darwin GOARCH=amd64 go build -mod=vendor -trimpath -o bin/documize-community-darwin-amd64 ./edition/community.go
|
2021-03-28 16:03:47 -04:00
|
|
|
echo "Compiling for macOS ARM..."
|
|
|
|
env GOOS=darwin GOARCH=arm64 go build -mod=vendor -trimpath -o bin/documize-community-darwin-arm64 ./edition/community.go
|
2019-05-15 16:45:26 +01:00
|
|
|
echo "Compiling for Windows..."
|
2020-02-15 15:42:54 +00:00
|
|
|
env GOOS=windows GOARCH=amd64 go build -mod=vendor -trimpath -o bin/documize-community-windows-amd64.exe ./edition/community.go
|
2019-05-15 16:45:26 +01:00
|
|
|
echo "Compiling for ARM..."
|
2020-02-15 15:42:54 +00:00
|
|
|
env GOOS=linux GOARCH=arm go build -mod=vendor -trimpath -o bin/documize-community-linux-arm ./edition/community.go
|
2019-05-15 16:45:26 +01:00
|
|
|
echo "Compiling for ARM64..."
|
2020-02-15 15:42:54 +00:00
|
|
|
env GOOS=linux GOARCH=arm64 go build -mod=vendor -trimpath -o bin/documize-community-linux-arm64 ./edition/community.go
|
2016-07-20 15:58:37 +01:00
|
|
|
|
|
|
|
echo "Finished."
|
2017-12-18 09:54:09 +00:00
|
|
|
|
|
|
|
# CGO_ENABLED=0 GOOS=linux go build -a -ldflags="-s -w" -installsuffix cgo
|
|
|
|
# go build -ldflags '-d -s -w' -a -tags netgo -installsuffix netgo test.go
|
2018-05-02 14:52:23 +01:00
|
|
|
# ldd test
|
2019-09-05 10:37:40 +01:00
|
|
|
|
2019-09-06 11:12:42 +01:00
|
|
|
# https://stackoverflow.com/questions/55664630/how-do-i-migrate-from-dep-to-go-modules
|