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
|
2024-12-31 13:09:30 -05:00
|
|
|
# export NODE_OPTIONS=--openssl-legacy-provider
|
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..."
|
2021-08-18 19:39:51 -04:00
|
|
|
rm -rf edition/static/public
|
|
|
|
mkdir -p edition/static/public
|
|
|
|
cp -r gui/dist-prod/assets edition/static/public
|
|
|
|
cp -r gui/dist-prod/codemirror edition/static/public/codemirror
|
|
|
|
cp -r gui/dist-prod/prism edition/static/public/prism
|
|
|
|
cp -r gui/dist-prod/sections edition/static/public/sections
|
|
|
|
cp -r gui/dist-prod/tinymce edition/static/public/tinymce
|
|
|
|
cp -r gui/dist-prod/pdfjs edition/static/public/pdfjs
|
2022-03-01 20:00:33 -05:00
|
|
|
cp -r gui/dist-prod/i18n edition/static/public/i18n
|
2021-08-18 19:39:51 -04:00
|
|
|
cp gui/dist-prod/*.* edition/static
|
|
|
|
cp gui/dist-prod/favicon.ico edition/static/public
|
|
|
|
cp gui/dist-prod/manifest.json edition/static/public
|
|
|
|
|
|
|
|
rm -rf edition/static/mail
|
|
|
|
mkdir -p edition/static/mail
|
|
|
|
cp domain/mail/*.html edition/static/mail
|
|
|
|
cp core/database/templates/*.html edition/static
|
|
|
|
|
2022-03-01 20:00:33 -05:00
|
|
|
rm -rf edition/static/i18n
|
|
|
|
mkdir -p edition/static/i18n
|
|
|
|
cp -r gui/dist-prod/i18n/*.json edition/static/i18n
|
|
|
|
|
2021-08-18 19:39:51 -04:00
|
|
|
rm -rf edition/static/scripts
|
|
|
|
mkdir -p edition/static/scripts
|
|
|
|
mkdir -p edition/static/scripts/mysql
|
|
|
|
mkdir -p edition/static/scripts/postgresql
|
|
|
|
mkdir -p edition/static/scripts/sqlserver
|
|
|
|
cp -r core/database/scripts/mysql/*.sql edition/static/scripts/mysql
|
|
|
|
cp -r core/database/scripts/postgresql/*.sql edition/static/scripts/postgresql
|
|
|
|
cp -r core/database/scripts/sqlserver/*.sql edition/static/scripts/sqlserver
|
|
|
|
|
|
|
|
rm -rf edition/static/onboard
|
|
|
|
mkdir -p edition/static/onboard
|
|
|
|
cp -r domain/onboard/*.json edition/static/onboard
|
2019-01-07 14:43:56 +00:00
|
|
|
|
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
|
2021-11-19 08:34:19 -05:00
|
|
|
echo "Compiling for Windows AMD..."
|
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
|
2021-11-19 08:34:19 -05:00
|
|
|
echo "Compiling for Linux AMD..."
|
|
|
|
env GOOS=linux GOARCH=amd64 go build -mod=vendor -trimpath -o bin/documize-community-linux-amd64 ./edition/community.go
|
|
|
|
echo "Compiling for Linux 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
|
2021-11-19 08:34:19 -05:00
|
|
|
echo "Compiling for Linux 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
|
2021-11-19 08:34:19 -05:00
|
|
|
echo "Compiling for FreeBSD ARM64..."
|
|
|
|
env GOOS=freebsd GOARCH=arm64 go build -mod=vendor -trimpath -o bin/documize-community-freebsd-arm64 ./edition/community.go
|
|
|
|
echo "Compiling for FreeBSD AMD64..."
|
|
|
|
env GOOS=freebsd GOARCH=amd64 go build -mod=vendor -trimpath -o bin/documize-community-freebsd-amd64 ./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
|