tiancheng91 / collection

笔记
https://github.com/tiancheng91/collection/issues
21 stars 1 forks source link

nomad with make #49

Open tiancheng91 opened 3 years ago

tiancheng91 commented 3 years ago
VERSION_TAG=$(shell git rev-parse --short HEAD)

.PHONY: build
build:
    docker build -t artifactory:9090/perf/influxdb-foobar:$(VERSION_TAG) .

.PHONY: push
push: build
    docker push artifactory:9090/perf/influxdb-foobar:$(VERSION_TAG)

.PHONY: nomad.job
nomad.job:
   hclfmt -w nomad.job.tpl
   export VERSION_TAG=$(VERSION_TAG) &&
   envsubst < "nomad.job.tpl" > "nomad.job"

.PHONY: clean
clean:
   @rm nomad.job

.PHONY: deploy
deploy: push nomad.job
   nomad run -verbose nomad.job
   make clean

.PHONY: stop
stop:
   nomad stop perf-influxdb-foobar

.PHONY: status
status:
   nomad status perf-influxdb-foobar

.PHONY: logs
logs:
   nomad logs -f -job perf-influxdb-foobar
tiancheng91 commented 3 years ago

https://tech.trivago.com/2019/01/25/nomad-our-experiences-and-best-practices/