change taskfile
This commit is contained in:
+8
-7
@@ -30,7 +30,7 @@ tasks:
|
|||||||
build-api:
|
build-api:
|
||||||
desc: clean, then build api bin
|
desc: clean, then build api bin
|
||||||
cmds:
|
cmds:
|
||||||
- task clean-api
|
- go tool task clean-api
|
||||||
- mkdir -p {{.BINARY_DIR}}
|
- mkdir -p {{.BINARY_DIR}}
|
||||||
- echo "building {{.BINARY_API}} with version {{.VERSION_STR}}"
|
- 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
|
- 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:
|
dev-build-api:
|
||||||
desc: clean, then build DEV api bin
|
desc: clean, then build DEV api bin
|
||||||
cmds:
|
cmds:
|
||||||
- task dev-clean-api
|
- go tool task dev-clean-api
|
||||||
- mkdir -p {{.DEV_BINARY_API}}
|
- mkdir -p {{.DEV_BINARY_API}}
|
||||||
- echo "building DEV {{.DEV_BINARY_API}} with version {{.VERSION_STR}}"
|
- 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
|
- 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 individual ──────────────────────────────────────────────────────
|
||||||
|
|
||||||
deploy-api:
|
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]
|
deps: [build-api]
|
||||||
cmds:
|
cmds:
|
||||||
- ssh {{.REMOTE_MACHINE}} "rm -f /srv/go-api/go-api"
|
- ssh {{.REMOTE_MACHINE}} "rm -rf /tmp/go-api-deploy && mkdir -p /tmp/go-api-deploy"
|
||||||
- rsync -avz --delete {{.BINARY_API}} {{.REMOTE_MACHINE}}:/srv/go-api/
|
- rsync -avz --delete {{.BINARY_API}} {{.REMOTE_MACHINE}}:/tmp/go-api-deploy/
|
||||||
- ssh -t {{.REMOTE_MACHINE}} "sudo systemctl restart go-api"
|
- 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 ──────────────────────────────────────────────────
|
# ── DEV START individual ──────────────────────────────────────────────────
|
||||||
|
|
||||||
@@ -66,7 +67,7 @@ tasks:
|
|||||||
dir: "{{ .DEV_BINARY_API }}"
|
dir: "{{ .DEV_BINARY_API }}"
|
||||||
cmds:
|
cmds:
|
||||||
- "rm -rf *"
|
- "rm -rf *"
|
||||||
- task dev-build-api
|
- go tool task dev-build-api
|
||||||
- "./go-api"
|
- "./go-api"
|
||||||
|
|
||||||
run:
|
run:
|
||||||
|
|||||||
Reference in New Issue
Block a user