File tree Expand file tree Collapse file tree 2 files changed +20
-6
lines changed Expand file tree Collapse file tree 2 files changed +20
-6
lines changed Original file line number Diff line number Diff line change @@ -142,13 +142,13 @@ jobs:
142
142
- name : Integration Tests
143
143
run : |
144
144
export CORTEX_IMAGE_PREFIX="${IMAGE_PREFIX:-quay.io/cortexproject/}"
145
- export CORTEX_IMAGE="${CORTEX_IMAGE_PREFIX}cortex:${TAG:-$(./tools/image-tag)}"
145
+ export IMAGE_TAG=$(make image-tag)
146
+ export CORTEX_IMAGE="${CORTEX_IMAGE_PREFIX}cortex:$IMAGE_TAG"
146
147
export CORTEX_CHECKOUT_DIR="/go/src/github.com/cortexproject/cortex"
147
148
echo "Running integration tests with image: $CORTEX_IMAGE"
148
149
go test -tags=requires_docker -timeout 1800s -v -count=1 ./integration/...
149
150
env :
150
151
IMAGE_PREFIX : ${{ secrets.IMAGE_PREFIX }}
151
- TAG : ${{ github.event.push.tag_name }}
152
152
153
153
integration-configs-db :
154
154
needs : build
@@ -241,11 +241,11 @@ jobs:
241
241
if [ -n "$QUAY_REGISTRY_PASSWORD" ]; then
242
242
docker login -u "$QUAY_REGISTRY_USER" -p "$QUAY_REGISTRY_PASSWORD" quay.io;
243
243
fi
244
- IMAGE_TAG=$GIT_TAG ./push-images $NOQUAY
244
+ export IMAGE_TAG=$(make image-tag)
245
+ ./push-images $NOQUAY
245
246
env :
246
247
DOCKER_REGISTRY_USER : ${{secrets.DOCKER_REGISTRY_USER}}
247
248
DOCKER_REGISTRY_PASSWORD : ${{ secrets.DOCKER_REGISTRY_PASSWORD }}
248
249
QUAY_REGISTRY_USER : ${{secrets.QUAY_REGISTRY_USER}}
249
250
QUAY_REGISTRY_PASSWORD : ${{secrets.QUAY_REGISTRY_PASSWORD}}
250
- GIT_TAG : ${{github.event.release.tag_name}}
251
251
NOQUAY : ${{secrets.NOQUAY}}
Original file line number Diff line number Diff line change @@ -12,12 +12,26 @@ GOPROXY_VALUE=$(shell go env GOPROXY)
12
12
# Boiler plate for building Docker containers.
13
13
# All this must go at top of file I'm afraid.
14
14
IMAGE_PREFIX ?= quay.io/cortexproject/
15
- # Use CIRCLE_TAG if present for releases.
16
- IMAGE_TAG ?= $(if $(CIRCLE_TAG ) ,$(CIRCLE_TAG ) ,$(shell ./tools/image-tag) )
15
+
16
+ # For a tag push GITHUB_REF will look like refs/tags/<tag_name>,
17
+ # If finding refs/tags/ does not equal emptystring then use
18
+ # the tag we are at as the image tag.
19
+ ifneq (,$(findstring refs/tags/, $(GITHUB_REF ) ) )
20
+ GIT_TAG := $(shell git tag --points-at HEAD)
21
+ endif
22
+ # Keep circle-ci compatability for now.
23
+ ifdef CIRCLE_TAG
24
+ GIT_TAG := $(CIRCLE_TAG)
25
+ endif
26
+ IMAGE_TAG ?= $(if $(GIT_TAG ) ,$(GIT_TAG ) ,$(shell ./tools/image-tag) )
17
27
GIT_REVISION := $(shell git rev-parse --short HEAD)
18
28
GIT_BRANCH := $(shell git rev-parse --abbrev-ref HEAD)
19
29
UPTODATE := .uptodate
20
30
31
+ .PHONY : image-tag
32
+ image-tag :
33
+ @echo $(IMAGE_TAG )
34
+
21
35
# Support gsed on OSX (installed via brew), falling back to sed. On Linux
22
36
# systems gsed won't be installed, so will use sed as expected.
23
37
SED ?= $(shell which gsed 2>/dev/null || which sed)
You can’t perform that action at this time.
0 commit comments