mod taskfile and gitignore
This commit is contained in:
@@ -0,0 +1 @@
|
|||||||
|
bin/
|
||||||
+8
-8
@@ -16,8 +16,8 @@ vars:
|
|||||||
sh: if [ -f build/words.txt ]; then awk 'BEGIN{srand()} /^[[:lower:]]+$/ && length($0) >= 4 && length($0) <= 10 { words[++n]=$0 } END { if (n < 1) { print "word-list"; exit } print words[int(rand()*n)+1] "-" words[int(rand()*n)+1] }' build/words.txt; else echo word-list; fi
|
sh: if [ -f build/words.txt ]; then awk 'BEGIN{srand()} /^[[:lower:]]+$/ && length($0) >= 4 && length($0) <= 10 { words[++n]=$0 } END { if (n < 1) { print "word-list"; exit } print words[int(rand()*n)+1] "-" words[int(rand()*n)+1] }' build/words.txt; else echo word-list; fi
|
||||||
VERSION_STR: "version [{{.SHORT_SHA}}-{{.BRANCH}}/{{.RANDOM_WORDS}}]. git is [{{.DIRTY}}]."
|
VERSION_STR: "version [{{.SHORT_SHA}}-{{.BRANCH}}/{{.RANDOM_WORDS}}]. git is [{{.DIRTY}}]."
|
||||||
LD_FLAGS: "-X '{{.PKG}}.Version={{.VERSION_STR}}'"
|
LD_FLAGS: "-X '{{.PKG}}.Version={{.VERSION_STR}}'"
|
||||||
BINARY_API: "{{.BINARY_DIR}}/abuse-registration-poc"
|
BINARY_API: "{{.BINARY_DIR}}/go-api"
|
||||||
DEV_BINARY_API: "{{.DEV_BINARY_DIR}}/abuse-registration-poc/"
|
DEV_BINARY_API: "{{.DEV_BINARY_DIR}}/go-api/"
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
|
|
||||||
@@ -47,7 +47,7 @@ tasks:
|
|||||||
- task dev-clean-api
|
- 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}}/abuse-registration-poc ./cmd/api
|
- CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags "{{.LD_FLAGS}}" -o {{.DEV_BINARY_API}}/go-api ./cmd/api
|
||||||
|
|
||||||
# ── Deploy individual ──────────────────────────────────────────────────────
|
# ── Deploy individual ──────────────────────────────────────────────────────
|
||||||
|
|
||||||
@@ -55,9 +55,9 @@ tasks:
|
|||||||
desc: build api, create remote dirs, and deploy api to remote vps
|
desc: build api, create remote dirs, and deploy api to remote vps
|
||||||
deps: [build-api]
|
deps: [build-api]
|
||||||
cmds:
|
cmds:
|
||||||
- ssh {{.REMOTE_MACHINE}} "mkdir -p /srv/abuse-registration-poc && rm -f /srv/abuse-registration-poc/abuse-registration-poc"
|
- ssh {{.REMOTE_MACHINE}} "rm -f /srv/go-api/go-api"
|
||||||
- rsync -avz --delete {{.BINARY_API}} {{.REMOTE_MACHINE}}:/srv/abuse-registration-poc/
|
- rsync -avz --delete {{.BINARY_API}} {{.REMOTE_MACHINE}}:/srv/go-api/
|
||||||
- ssh -t {{.REMOTE_MACHINE}} "sudo systemctl restart abuse-registration-poc"
|
- ssh -t {{.REMOTE_MACHINE}} "sudo systemctl restart go-api"
|
||||||
|
|
||||||
# ── DEV START individual ──────────────────────────────────────────────────
|
# ── DEV START individual ──────────────────────────────────────────────────
|
||||||
|
|
||||||
@@ -67,7 +67,7 @@ tasks:
|
|||||||
cmds:
|
cmds:
|
||||||
- "rm -rf *"
|
- "rm -rf *"
|
||||||
- task dev-build-api
|
- task dev-build-api
|
||||||
- "./abuse-registration-poc"
|
- "./go-api"
|
||||||
|
|
||||||
run:
|
run:
|
||||||
desc: run the POC API locally on :8080 by default
|
desc: run the POC API locally on :8080 by default
|
||||||
@@ -97,4 +97,4 @@ tasks:
|
|||||||
|
|
||||||
dev-clean-api:
|
dev-clean-api:
|
||||||
cmds:
|
cmds:
|
||||||
- rm -f {{.DEV_BINARY_API}}/abuse-registration-poc
|
- rm -f {{.DEV_BINARY_API}}/go-api
|
||||||
|
|||||||
Reference in New Issue
Block a user