File tree Expand file tree Collapse file tree 2 files changed +30
-2
lines changed Expand file tree Collapse file tree 2 files changed +30
-2
lines changed Original file line number Diff line number Diff line change 1
1
.DEFAULT_GOAL := build
2
2
3
+ VERSION ?= $(shell ./hack/get-version.sh)
4
+
3
5
.PHONY :fmt vet build
4
6
fmt :
5
7
go fmt ./...
@@ -11,7 +13,7 @@ build: vet
11
13
go build
12
14
13
15
build-docker : vet
14
- docker build -t numberly/vault-db-injector:2.0.1 .
16
+ docker build -t numberly/vault-db-injector:${VERSION} .
15
17
16
18
push-docker : build-docker
17
- docker push numberly/vault-db-injector:2.0.1
19
+ docker push numberly/vault-db-injector:${VERSION}
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+ # Copyright 2022 The Kubernetes Authors.
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+
16
+ if [[ " ${GIT_TAG} " == " " ]]; then
17
+ GIT_TAG=" $( git describe --tags --dirty --always) "
18
+ fi
19
+
20
+ # The value passed by gcr's cloudbuild will have this prefix by default
21
+ # https://github.com/kubernetes/k8s.io/blob/aa5a1f164aece8f116196c40ac7b937be479cd41/images/codesearch/cs-fetch-repos/Makefile#L19
22
+ if [[ " ${GIT_TAG} " =~ ^v[0-9]{8}- ]]; then
23
+ GIT_TAG=" ${GIT_TAG: 10} "
24
+ fi
25
+
26
+ echo " ${GIT_TAG} "
You can’t perform that action at this time.
0 commit comments