From 9613122cf6b0f315b6071704b60ab902906362b1 Mon Sep 17 00:00:00 2001 From: Shulhan Date: Wed, 1 Apr 2020 06:28:48 +0700 Subject: Makefile: add deploy task The deploy task build the specific binary for server OS and architecture and copy them to server. --- .gitignore | 2 ++ Makefile | 10 +++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 2d3eb1a..f426802 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,5 @@ /kbbi /testdata/kamus.gob /testdata/kamus.gob.new +/www-kbbi +/www-kbbi-linux-amd64 diff --git a/Makefile b/Makefile index 192eed6..0f4812c 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ ## Use of this source code is governed by a BSD-style ## license that can be found in the LICENSE file. -.PHONY: all build lint test +.PHONY: all build lint test install deploy LINT_OPTS = @@ -23,3 +23,11 @@ lint: test: go test ./... + +install: + go install ./cmd/kbbi/ + +deploy: + CGO_ENABLED=0 GOOS=linux GOARCH=amd64 \ + go build -o www-kbbi-linux-amd64 ./cmd/www-kbbi/ + rsync --progress ./www-kbbi-linux-amd64 www-kbbi:~/bin/www-kbbi -- cgit v1.3