Skip to content

Commit

Permalink
Set useful version in signalilo --version for signalilo:latest
Browse files Browse the repository at this point in the history
  • Loading branch information
simu committed Apr 17, 2020
1 parent 02d9d14 commit 9833252
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ jobs:
- name: Set version from tag
if: startsWith(github.ref, 'refs/tags/v')
run: echo ::set-env name=VERSION::$(echo ${GITHUB_REF#refs/tags/})
- name: Set binary version from Git
run: echo ::set-env name=BINARY_VERSION::$(git describe --tags --always --dirty --match=v*)
- name: Build Image
run: make docker
env:
Expand All @@ -29,4 +31,4 @@ jobs:
name: "${{ env.IMAGE }}:${{ env.VERSION }}"
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
buildargs: VERSION
buildargs: BINARY_VERSION
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#####################
FROM golang:1.14 as builder

ARG VERSION
ARG BINARY_VERSION

# Workdir must be outside of GOPATH because of go mod usage
WORKDIR /src/signalilo
Expand Down
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# Project parameters
BINARY_NAME ?= signalilo

VERSION ?= $(shell git describe --tags --always --dirty --match=v* || (echo "command failed $$?"; exit 1))
BINARY_VERSION = $(shell git describe --tags --always --dirty --match=v* || (echo "command failed $$?"; exit 1))
VERSION ?= $(BINARY_VERSION)

IMAGE_NAME ?= docker.io/vshn/$(BINARY_NAME):$(VERSION)

Expand Down

0 comments on commit 9833252

Please sign in to comment.