File tree Expand file tree Collapse file tree 3 files changed +56
-2
lines changed Expand file tree Collapse file tree 3 files changed +56
-2
lines changed Original file line number Diff line number Diff line change
1
+ name : " Build and push docker container"
2
+
3
+ on :
4
+ pull_request :
5
+ workflow_dispatch :
6
+
7
+ jobs :
8
+ cluster-bootstrap-controller :
9
+ runs-on : ubuntu-latest
10
+ steps :
11
+ - name : Install Go
12
+ uses : actions/setup-go@v2
13
+ with :
14
+ go-version : 1.17.x
15
+ - name : Checkout code
16
+ uses : actions/checkout@v2
17
+ with :
18
+ fetch-depth : 0
19
+ ref : ${{ github.event.pull_request.head.sha }}
20
+ - name : Build docker image
21
+ run : |
22
+ make docker-build
23
+ - name : Login to Docker Hub
24
+ uses : docker/login-action@v1
25
+ with :
26
+ registry : docker.io
27
+ username : ${{ secrets.WGE_DOCKER_IO_USER }}
28
+ password : ${{ secrets.WGE_DOCKER_IO_PASSWORD }}
29
+ - name : Push image to docker registry
30
+ run : |
31
+ make docker-push
32
+
33
+
Original file line number Diff line number Diff line change @@ -29,14 +29,15 @@ BUNDLE_METADATA_OPTS ?= $(BUNDLE_CHANNELS) $(BUNDLE_DEFAULT_CHANNEL)
29
29
#
30
30
# For example, running 'make bundle-build bundle-push catalog-build catalog-push' will build and push both
31
31
# weave.works/cluster-bootstrap-controller-bundle:$VERSION and weave.works/cluster-bootstrap-controller-catalog:$VERSION.
32
- IMAGE_TAG_BASE ?= weave.works /cluster-bootstrap-controller
32
+ IMAGE_TAG_BASE ?= weaveworks /cluster-bootstrap-controller
33
33
34
34
# BUNDLE_IMG defines the image:tag used for the bundle.
35
35
# You can use it as an arg. (E.g make bundle-build BUNDLE_IMG=<some-registry>/<project-name-bundle>:<tag>)
36
36
BUNDLE_IMG ?= $(IMAGE_TAG_BASE ) -bundle:v$(VERSION )
37
37
38
+ IMAGE_TAG := $(shell tools/image-tag)
38
39
# Image URL to use all building/pushing image targets
39
- IMG ?= controller:latest
40
+ IMG ?= $( IMAGE_TAG_BASE ) : $( IMAGE_TAG )
40
41
# Produce CRDs that work back to Kubernetes 1.11 (no version conversion)
41
42
CRD_OPTIONS ?= "crd:trivialVersions=true,preserveUnknownFields=false"
42
43
# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary.
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+
3
+ set -o errexit
4
+ set -o nounset
5
+ set -o pipefail
6
+
7
+ REF=" ${1:- " HEAD" } "
8
+
9
+ WORKING_SUFFIX=$( if git status --porcelain | grep -qE ' ^(?:[^?][^ ]|[^ ][^?])\s' ; then echo " -WIP" ; else echo " " ; fi)
10
+ CURRENT_TAG=$( if TAG=$( git describe --tags --exact-match " $REF " 2> /dev/null) ; then echo $TAG ; else echo " " ; fi)
11
+ if test -z " $WORKING_SUFFIX " && test ! -z " $CURRENT_TAG "
12
+ then
13
+ echo $CURRENT_TAG
14
+ else
15
+ BRANCH_PREFIX=$( git rev-parse --abbrev-ref " $REF " )
16
+
17
+ # Fix the object name prefix length to 8 characters to have it consistent across the system.
18
+ # See https://git-scm.com/docs/git-rev-parse#Documentation/git-rev-parse.txt---shortlength
19
+ echo " ${BRANCH_PREFIX// \/ / -} -$( git rev-parse --short=8 " $REF " ) $WORKING_SUFFIX "
20
+ fi
You can’t perform that action at this time.
0 commit comments