feat(taskfiles): expose current version based on latest release or dev tag
This commit is contained in:
parent
b668a45810
commit
4719a9d64c
2 changed files with 11 additions and 0 deletions
|
@ -8,10 +8,14 @@ tasks:
|
|||
prefix: "build image: {{ .SERVICE }}"
|
||||
dir: services/{{ .SERVICE }}
|
||||
cmd: . ./build.sh
|
||||
env:
|
||||
IMAGE_VERSION: "{{ .VERSION }}"
|
||||
start-service:
|
||||
prefix: "start: {{ .SERVICE }}"
|
||||
dir: services/{{ .SERVICE }}
|
||||
cmd: . ./start.sh
|
||||
env:
|
||||
IMAGE_VERSION: "{{ .VERSION }}"
|
||||
stop-service:
|
||||
prefix: "stop: {{ .SERVICE }}"
|
||||
dir: services/{{ .SERVICE }}
|
||||
|
|
|
@ -11,6 +11,11 @@ includes:
|
|||
|
||||
output: prefixed
|
||||
|
||||
vars:
|
||||
# Any build that is not on a tag is a development build.
|
||||
CURRENT_VERSION:
|
||||
sh: git describe --tags --exact-match $(git rev-parse HEAD) 2> /dev/null || echo "dev-$(git rev-parse HEAD)"
|
||||
|
||||
tasks:
|
||||
build:
|
||||
desc: "Builds images for one or more services. Include service names as a space-separated list."
|
||||
|
@ -19,6 +24,7 @@ tasks:
|
|||
task: internal:build-images
|
||||
vars:
|
||||
SERVICE: "{{ .ITEM }}"
|
||||
VERSION: "{{ .CURRENT_VERSION }}"
|
||||
prefix: "build: {{ .CLI_ARGS }}"
|
||||
dir: services
|
||||
start:
|
||||
|
@ -28,6 +34,7 @@ tasks:
|
|||
task: internal:start-service
|
||||
vars:
|
||||
SERVICE: "{{ .ITEM }}"
|
||||
VERSION: "{{ .CURRENT_VERSION }}"
|
||||
prefix: "start: {{ .CLI_ARGS }}"
|
||||
dir: services
|
||||
stop:
|
||||
|
|
Reference in a new issue