Skip to content

Commit 5141d4b

Browse files
authored
Merge pull request #88 from oracle/ap/fix-version-cmd
Fix $VERSION in Makefile
2 parents 54bbbcb + 2cec97f commit 5141d4b

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

Makefile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ REGISTRY := wcr.io/oracle
22
PKG := github.com/oracle/oci-cloud-controller-manager
33
BIN := oci-cloud-controller-manager
44
IMAGE := $(REGISTRY)/$(BIN)
5-
VERSION := $(shell git describe --always --dirty)
5+
VERSION := $(shell git describe --exact-match 2> /dev/null || \
6+
git describe --match=$(git rev-parse --short=8 HEAD) --always --dirty --abbrev=8)
67

78
GOOS ?= linux
89
ARCH ?= amd64
@@ -75,3 +76,7 @@ run-dev:
7576
--cluster-cidr=10.244.0.0/16 \
7677
--cloud-provider=external \
7778
-v=4
79+
80+
.PHONY: version
81+
version:
82+
@echo ${VERSION}

wercker.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ build:
88
- script:
99
name: write VERSION.txt
1010
code: |
11-
git describe --always --dirty > ${WERCKER_OUTPUT_DIR}/VERSION.txt
11+
make version > ${WERCKER_OUTPUT_DIR}/VERSION.txt
1212
cat ${WERCKER_OUTPUT_DIR}/VERSION.txt
1313
1414
- script:

0 commit comments

Comments
 (0)