File tree Expand file tree Collapse file tree 3 files changed +17
-25
lines changed
Expand file tree Collapse file tree 3 files changed +17
-25
lines changed Original file line number Diff line number Diff line change 5151 registry : quay.io
5252 username : ${{ secrets.QUAY_USER }}
5353 password : ${{ secrets.QUAY_PASSWORD }}
54- - name : Build images
55- run : make push-docker-image-canary
54+ - name : Build and push
55+ run : make push-docker-image
56+ - name : Tag
57+ run : make create-docker-image-tag NEW_TAG=canary
Original file line number Diff line number Diff line change 77 - v*
88
99jobs :
10- golint :
11- name : vet fmt and lint
12- runs-on : ubuntu-20.04
13- container : golang:1.13.7
14- steps :
15- 16- - name : Install golint
17- run : go get -u golang.org/x/lint/golint
18- - run : make lint
19- shell : bash
20- gotest :
21- name : go test
22- runs-on : ubuntu-20.04
23- container : golang:1.13.7
24- steps :
25- 26- - run : make test
27- docker_build :
10+ docker_tag :
2811 name : docker_build
2912 runs-on : ubuntu-20.04
3013 container :
4124 - name : Install Tools
4225 run : apk add --update make git jq rsync curl
432627+ - name : Capture tag in env
28+ run : echo "TAG_LABEL=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
4429 - name : Set up QEMU
4530 uses : docker/setup-qemu-action@v1
4631 - name : Set up Docker Buildx
5136 registry : quay.io
5237 username : ${{ secrets.QUAY_USER }}
5338 password : ${{ secrets.QUAY_PASSWORD }}
54- - name : Build images
55- run : make push-docker-image
39+ - name : Tag latest
40+ run : make create-docker-image-tag NEW_TAG=latest
41+ - name : Tag with git tag
42+ run : make create-docker-image-tag NEW_TAG=${{ env.TAG_LEVEL }}
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ GOARCH:=$(shell go env GOARCH)
1010BIN_NAME: =preflight
1111
1212DOCKER_IMAGE? =quay.io/jetstack/preflight
13- DOCKER_IMAGE_TAG? =$(DOCKER_IMAGE ) :$(VERSION )
13+ DOCKER_IMAGE_TAG? =$(DOCKER_IMAGE ) :$(COMMIT )
1414
1515# BUILD_IN decides if the binaries will be built in `docker` or in the `host`.
1616BUILD_IN? =docker
@@ -90,7 +90,7 @@ build-all-platforms-in-docker:
9090PLATFORMS? =linux/arm/v7,linux/arm64/v8,linux/amd64
9191BUILDX_EXTRA_ARGS? =
9292
93- push_buildx_args =--tag $( DOCKER_IMAGE ) :latest -- push $(BUILDX_EXTRA_ARGS )
93+ push_buildx_args =--push $(BUILDX_EXTRA_ARGS )
9494push-canary_buildx_args =--tag $(DOCKER_IMAGE ) :canary --push $(BUILDX_EXTRA_ARGS )
9595build_buildx_args =$(BUILDX_EXTRA_ARGS )
9696
@@ -103,7 +103,10 @@ _docker-%: build-all-platforms
103103
104104build-docker-image : _docker-build
105105push-docker-image : _docker-push
106- push-docker-image-canary : _docker-push-canary
106+
107+ NEW_TAG? =latest
108+ create-docker-image-tag :
109+ docker buildx imagetools create $(DOCKER_IMAGE ) :$(COMMIT ) --tag $(DOCKER_IMAGE ) :$(NEW_TAG )
107110
108111# CI
109112
You can’t perform that action at this time.
0 commit comments