Add Makefile and build, deploy scripts
This commit is contained in:
parent
bb673b18b8
commit
63394087fe
3
.gitignore
vendored
3
.gitignore
vendored
@ -100,4 +100,5 @@ Temporary Items
|
||||
##
|
||||
|
||||
whatsapp.db
|
||||
auto-response-time-map.json
|
||||
auto-response-time-map.json
|
||||
out/
|
13
Makefile
13
Makefile
@ -4,4 +4,15 @@ start: install-deps
|
||||
install-deps:
|
||||
go install ./...
|
||||
|
||||
.PHONY: start install-deps
|
||||
build:
|
||||
# CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build -o out/wa-autoresponder.linux-amd64 cmd/main.go
|
||||
CC=x86_64-linux-musl-gcc CXX=x86_64-linux-musl-g++ GOARCH=amd64 GOOS=linux CGO_ENABLED=1 go build -ldflags "-linkmode external -extldflags -static" -o out/wa-autoresponder.linux-amd64 cmd/main.go
|
||||
# docker run --rm -v $(PWD):/go/src/app -w /go/src/app -e CGO_ENABLED=1 -e GOOS=linux -e GOARCH=amd64 golang:latest go build -o out/wa-autoresponder.linux-amd64 cmd/main.go
|
||||
|
||||
deploy: build
|
||||
ssh sangeeth@athena.home "bash -l -c 'mkdir -p ~/.local/data/wa-autoresponder'"
|
||||
ssh sangeeth@athena.home "bash -l -c 'systemctl --user stop wa-autoresponder || true'"
|
||||
rsync -avhP out/wa-autoresponder.linux-amd64 athena.home:.local/bin/wa-autoresponder
|
||||
ssh sangeeth@athena.home "bash -l -c 'systemctl --user start wa-autoresponder'"
|
||||
|
||||
.PHONY: start install-deps build
|
Loading…
Reference in New Issue
Block a user