diff options
| author | SergeiEU <39683682+SergeiEU@users.noreply.github.com> | 2026-04-01 10:17:15 +0400 |
|---|---|---|
| committer | SergeiEU <39683682+SergeiEU@users.noreply.github.com> | 2026-04-01 10:17:15 +0400 |
| commit | 1bd203c5555046b7ee4fbfe2f822eb3d03571ad7 (patch) | |
| tree | d8c85273ede547e03a5727bf185f5d07e87b4a08 /Makefile | |
| download | vpnem-1bd203c5555046b7ee4fbfe2f822eb3d03571ad7.tar.gz vpnem-1bd203c5555046b7ee4fbfe2f822eb3d03571ad7.tar.bz2 vpnem-1bd203c5555046b7ee4fbfe2f822eb3d03571ad7.zip | |
Diffstat (limited to 'Makefile')
| -rw-r--r-- | Makefile | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..f3051ae --- /dev/null +++ b/Makefile @@ -0,0 +1,60 @@ +GOPATH ?= $(HOME)/.local/share/go +WAILS := $(GOPATH)/bin/wails +SERVER := root@178.20.40.99 +export GOPATH + +.PHONY: all server client-linux client-windows installer test clean deploy release + +all: server client-linux + +# --- Server --- + +server: + go build -o build/vpnem-server ./cmd/server + +# --- Client --- + +client-linux: + cd cmd/client && $(WAILS) build -platform linux/amd64 -o vpnem -tags with_gvisor + cp cmd/client/build/bin/vpnem build/vpnem-linux-amd64 + +client-windows: + cd cmd/client && CC=x86_64-w64-mingw32-gcc $(WAILS) build -platform windows/amd64 -o vpnem.exe -tags with_gvisor + cp cmd/client/build/bin/vpnem.exe build/vpnem-windows-amd64.exe + +installer: + CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -ldflags "-H windowsgui" -o build/vpnem-installer.exe ./cmd/installer + +# --- Test --- + +test: + go test ./... -v + +# --- Deploy: server code only --- + +deploy: + rsync -avz --exclude '.git' --exclude 'build' --exclude '*.srs' --exclude '.claude' \ + ./ $(SERVER):/opt/vpnem/ + ssh $(SERVER) "cd /opt/vpnem && docker compose up -d --build" + @echo "Verify: curl https://vpn.em-sysadmin.xyz/health" + +# --- Release: build all + deploy binaries + bump version --- + +release: client-linux client-windows installer + rm -f build/vpnem-linux-amd64 + cp cmd/client/build/bin/vpnem build/vpnem-linux-amd64 + scp build/vpnem-linux-amd64 build/vpnem-windows-amd64.exe build/vpnem-installer.exe \ + $(SERVER):/opt/vpnem/data/releases/ + scp data/version.json $(SERVER):/opt/vpnem/data/version.json + rsync -avz --exclude '.git' --exclude 'build' --exclude '*.srs' --exclude '.claude' \ + ./ $(SERVER):/opt/vpnem/ + ssh $(SERVER) "cd /opt/vpnem && docker compose restart" + @echo "" + @curl -s https://vpn.em-sysadmin.xyz/api/v1/version + @echo "" + @echo "Release deployed." + +# --- Clean --- + +clean: + rm -rf build/ cmd/client/build/ |
