feat: initial commit
This commit is contained in:
1 parent
353f62e257
commit
c6852c6f1b
62 files changed
+5911
-2
No files matched your search
@@ -0,0 +1,47 @@
|
||||
#!/bin/sh
|
||||
# Build the LPRA server (for the local host OS *and* Linux) and cross-compile
|
||||
# the Linux agent binaries served at /download/.
|
||||
set -eu
|
||||
|
||||
cd "$(dirname "$0")"
|
||||
|
||||
VERSION="${VERSION:-$(cat VERSION.txt 2>/dev/null || echo 0.0.0)}"
|
||||
PKG="github.com/x-grk/longpolling-remote-access"
|
||||
LDFLAGS="-s -w -X $PKG/internal/server.Version=$VERSION -X $PKG/internal/agent.Version=$VERSION"
|
||||
echo ">> version $VERSION"
|
||||
|
||||
mkdir -p dist bin
|
||||
|
||||
echo ">> building server (local: $(go env GOOS)/$(go env GOARCH))"
|
||||
go build -trimpath -ldflags "$LDFLAGS" -o bin/lpra-server ./cmd/server
|
||||
|
||||
echo ">> building server linux/amd64"
|
||||
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -trimpath -ldflags "$LDFLAGS" \
|
||||
-o bin/lpra-server-linux-amd64 ./cmd/server
|
||||
|
||||
echo ">> building server linux/arm64"
|
||||
GOOS=linux GOARCH=arm64 CGO_ENABLED=0 go build -trimpath -ldflags "$LDFLAGS" \
|
||||
-o bin/lpra-server-linux-arm64 ./cmd/server
|
||||
|
||||
echo ">> building agent linux/amd64"
|
||||
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -trimpath -ldflags "$LDFLAGS" \
|
||||
-o dist/agent-linux-amd64 ./cmd/agent
|
||||
|
||||
echo ">> building agent linux/arm64"
|
||||
GOOS=linux GOARCH=arm64 CGO_ENABLED=0 go build -trimpath -ldflags "$LDFLAGS" \
|
||||
-o dist/agent-linux-arm64 ./cmd/agent
|
||||
|
||||
echo ">> building agent darwin/arm64 + amd64"
|
||||
GOOS=darwin GOARCH=arm64 CGO_ENABLED=0 go build -trimpath -ldflags "$LDFLAGS" \
|
||||
-o bin/agent-darwin-arm64 ./cmd/agent
|
||||
GOOS=darwin GOARCH=amd64 CGO_ENABLED=0 go build -trimpath -ldflags "$LDFLAGS" \
|
||||
-o bin/agent-darwin-amd64 ./cmd/agent
|
||||
|
||||
echo
|
||||
echo "Done."
|
||||
echo " server (local): bin/lpra-server"
|
||||
echo " server (Linux): bin/lpra-server-linux-amd64, bin/lpra-server-linux-arm64"
|
||||
echo " agents (Linux): dist/agent-linux-amd64, dist/agent-linux-arm64"
|
||||
echo
|
||||
echo "On the Linux host copy the matching server binary to /opt/lpra/lpra-server,"
|
||||
echo "e.g.: cp bin/lpra-server-linux-amd64 /opt/lpra/lpra-server"
|
||||
Reference in new issue
Block a user