summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShulhan <m.shulhan@gmail.com>2020-04-01 06:28:48 +0700
committerShulhan <m.shulhan@gmail.com>2020-04-01 06:28:48 +0700
commit9613122cf6b0f315b6071704b60ab902906362b1 (patch)
tree59c3a25eaa0b43fc1d735548e92b5b738cd24365
parent8a141995aabdee289d2b096bd77a10b52b08a1bf (diff)
downloadkamusku-9613122cf6b0f315b6071704b60ab902906362b1.tar.xz
Makefile: add deploy task
The deploy task build the specific binary for server OS and architecture and copy them to server.
-rw-r--r--.gitignore2
-rw-r--r--Makefile10
2 files changed, 11 insertions, 1 deletions
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