change taskfile
This commit is contained in:
+8
-7
@@ -30,7 +30,7 @@ tasks:
|
||||
build-api:
|
||||
desc: clean, then build api bin
|
||||
cmds:
|
||||
- task clean-api
|
||||
- go tool task clean-api
|
||||
- mkdir -p {{.BINARY_DIR}}
|
||||
- echo "building {{.BINARY_API}} with version {{.VERSION_STR}}"
|
||||
- CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags "{{.LD_FLAGS}}" -o {{.BINARY_API}} ./cmd/api
|
||||
@@ -44,7 +44,7 @@ tasks:
|
||||
dev-build-api:
|
||||
desc: clean, then build DEV api bin
|
||||
cmds:
|
||||
- task dev-clean-api
|
||||
- go tool task dev-clean-api
|
||||
- mkdir -p {{.DEV_BINARY_API}}
|
||||
- echo "building DEV {{.DEV_BINARY_API}} with version {{.VERSION_STR}}"
|
||||
- CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags "{{.LD_FLAGS}}" -o {{.DEV_BINARY_API}}/go-api ./cmd/api
|
||||
@@ -52,12 +52,13 @@ tasks:
|
||||
# ── Deploy individual ──────────────────────────────────────────────────────
|
||||
|
||||
deploy-api:
|
||||
desc: build api, create remote dirs, and deploy api to remote vps
|
||||
desc: build api, stage files, and deploy api to remote server
|
||||
deps: [build-api]
|
||||
cmds:
|
||||
- ssh {{.REMOTE_MACHINE}} "rm -f /srv/go-api/go-api"
|
||||
- rsync -avz --delete {{.BINARY_API}} {{.REMOTE_MACHINE}}:/srv/go-api/
|
||||
- ssh -t {{.REMOTE_MACHINE}} "sudo systemctl restart go-api"
|
||||
- ssh {{.REMOTE_MACHINE}} "rm -rf /tmp/go-api-deploy && mkdir -p /tmp/go-api-deploy"
|
||||
- rsync -avz --delete {{.BINARY_API}} {{.REMOTE_MACHINE}}:/tmp/go-api-deploy/
|
||||
- ssh -t {{.REMOTE_MACHINE}} "sudo rsync -a --delete --exclude='.env' --exclude='config.json' --exclude='data/' --chown=go-api:go-api /tmp/go-api-deploy/ /opt/go-api/ && sudo systemctl restart go-api"
|
||||
- ssh {{.REMOTE_MACHINE}} "rm -rf /tmp/go-api-deploy"
|
||||
|
||||
# ── DEV START individual ──────────────────────────────────────────────────
|
||||
|
||||
@@ -66,7 +67,7 @@ tasks:
|
||||
dir: "{{ .DEV_BINARY_API }}"
|
||||
cmds:
|
||||
- "rm -rf *"
|
||||
- task dev-build-api
|
||||
- go tool task dev-build-api
|
||||
- "./go-api"
|
||||
|
||||
run:
|
||||
|
||||
Reference in New Issue
Block a user