mirror of
https://github.com/DJSundog/wg-portal.git
synced 2024-11-27 00:53:51 -05:00
WIP: use gox for cross platform compiling
This commit is contained in:
parent
9b10d099b6
commit
4fe4d93e0d
33
.travis.yml
33
.travis.yml
@ -1,4 +1,33 @@
|
||||
language: go
|
||||
|
||||
sudo: false
|
||||
go:
|
||||
- 1.15.x
|
||||
- tip # Latest go version
|
||||
|
||||
before_install:
|
||||
# gox simplifies building for multiple architectures
|
||||
- go get github.com/mitchellh/gox
|
||||
|
||||
install:
|
||||
- # skip
|
||||
|
||||
script:
|
||||
- go get -t -v ./...
|
||||
- diff -u <(echo -n) <(gofmt -d .)
|
||||
- go vet $(go list ./... | grep -v /vendor/)
|
||||
- gox -cgo -os="linux" -arch="amd64 arm arm64" -output="dist/{{.Dir}}_{{.OS}}_{{.Arch}}" -ldflags "-X main.Version=`git rev-parse --short HEAD`" -verbose ./...
|
||||
|
||||
deploy:
|
||||
provider: releases
|
||||
skip_cleanup: true # Important, otherwise the build output would be purged.
|
||||
api_key:
|
||||
# *encrypted* GitHub key, as the output of the Travis CI CLI tool
|
||||
secure: TODO...
|
||||
file:
|
||||
- dist/wg-portal_linux_amd64
|
||||
- dist/wg-portal_linux_arm64
|
||||
- dist/wg-portal_linux_arm
|
||||
- dist/wg-portal.env
|
||||
- dist/wg-portal.service
|
||||
on:
|
||||
repo: h44z/wg-portal
|
||||
tags: true # The deployment happens only if the commit has a tag.
|
||||
|
9
Makefile
9
Makefile
@ -10,15 +10,14 @@ IMAGE=h44z/wg-portal
|
||||
|
||||
all: dep build
|
||||
|
||||
build: dep $(addsuffix -amd64,$(addprefix $(BUILDDIR)/,$(BINARIES)))
|
||||
cp scripts/wg-portal.service $(BUILDDIR)
|
||||
cp scripts/wg-portal.env $(BUILDDIR)
|
||||
|
||||
build-cross-plat: dep build $(addsuffix -arm,$(addprefix $(BUILDDIR)/,$(BINARIES))) $(addsuffix -arm64,$(addprefix $(BUILDDIR)/,$(BINARIES)))
|
||||
build: dep
|
||||
mkdir -p $(BUILDDIR)
|
||||
cp scripts/wg-portal.service $(BUILDDIR)
|
||||
cp scripts/wg-portal.env $(BUILDDIR)
|
||||
gox -cgo -os="linux" -arch="amd64 arm arm64" -output="dist/{{.Dir}}_{{.OS}}_{{.Arch}}" -ldflags "-X main.Version=`git rev-parse --short HEAD`" -verbose ./...
|
||||
|
||||
dep:
|
||||
$(GOCMD) get github.com/mitchellh/gox
|
||||
$(GOCMD) mod download
|
||||
|
||||
validate: dep
|
||||
|
@ -12,13 +12,15 @@ import (
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
var Version string = "unknown (local build)"
|
||||
|
||||
func main() {
|
||||
_ = setupLogger(logrus.StandardLogger())
|
||||
|
||||
c := make(chan os.Signal, 1)
|
||||
signal.Notify(c, syscall.SIGINT, syscall.SIGTERM, syscall.SIGHUP)
|
||||
|
||||
logrus.Infof("Starting WireGuard Portal Server...")
|
||||
logrus.Infof("Starting WireGuard Portal Server [%s]...", Version)
|
||||
|
||||
// Context for clean shutdown
|
||||
ctx, cancel := context.WithCancel(context.Background())
|
||||
|
1
go.mod
1
go.mod
@ -11,6 +11,7 @@ require (
|
||||
github.com/jordan-wright/email v4.0.1-0.20200917010138-e1c00e156980+incompatible
|
||||
github.com/kelseyhightower/envconfig v1.4.0
|
||||
github.com/milosgajdos/tenus v0.0.3
|
||||
github.com/mitchellh/gox v1.0.1 // indirect
|
||||
github.com/pkg/errors v0.9.1
|
||||
github.com/sirupsen/logrus v1.7.0
|
||||
github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e
|
||||
|
Loading…
Reference in New Issue
Block a user