@@ -45,9 +45,10 @@ REV=$(shell git describe --long --tags --match='v*' --dirty 2>/dev/null || git r
45
45
# Determined dynamically.
46
46
IMAGE_TAGS =
47
47
48
- # A "canary" image gets built if the current commit is the head of the remote "master" branch.
48
+ # A "canary" image gets built if the current commit is the head of the remote "master" or "main" branch.
49
49
# That branch does not exist when building some other branch in TravisCI.
50
50
IMAGE_TAGS+ =$(shell if [ "$$(git rev-list -n1 HEAD ) " = "$$(git rev-list -n1 origin/master 2>/dev/null ) " ]; then echo "canary"; fi)
51
+ IMAGE_TAGS+ =$(shell if [ "$$(git rev-list -n1 HEAD ) " = "$$(git rev-list -n1 origin/main 2>/dev/null ) " ]; then echo "canary"; fi)
51
52
52
53
# A "X.Y.Z-canary" image gets built if the current commit is the head of a "origin/release-X.Y.Z" branch.
53
54
# The actual suffix does not matter, only the "release-" prefix is checked.
@@ -143,7 +144,7 @@ DOCKER_BUILDX_CREATE_ARGS ?=
143
144
# Windows binaries can be built before adding a Dockerfile for it.
144
145
#
145
146
# BUILD_PLATFORMS determines which individual images are included in the multiarch image.
146
- # PULL_BASE_REF must be set to 'master', 'release-x.y', or a tag name, and determines
147
+ # PULL_BASE_REF must be set to 'master', 'main', ' release-x.y', or a tag name, and determines
147
148
# the tag for the resulting multiarch image.
148
149
$(CMDS:% =push-multiarch-%): push-multiarch-%: check-pull-base-ref build-%
149
150
set -ex; \
@@ -191,7 +192,7 @@ $(CMDS:%=push-multiarch-%): push-multiarch-%: check-pull-base-ref build-%
191
192
done; \
192
193
docker manifest push -p $(IMAGE_NAME):$$tag; \
193
194
}; \
194
- if [ $(PULL_BASE_REF) = "master" ]; then \
195
+ if [ $(PULL_BASE_REF) = "master" ] || [ $(PULL_BASE_REF) = "main" ] ; then \
195
196
: "creating or overwriting canary image"; \
196
197
pushMultiArch canary; \
197
198
elif echo $(PULL_BASE_REF) | grep -q -e 'release-*' ; then \
@@ -209,7 +210,7 @@ $(CMDS:%=push-multiarch-%): push-multiarch-%: check-pull-base-ref build-%
209
210
.PHONY : check-pull-base-ref
210
211
check-pull-base-ref :
211
212
if ! [ " $( PULL_BASE_REF) " ]; then \
212
- echo >&2 " ERROR: PULL_BASE_REF must be set to 'master', 'release-x.y', or a tag name." ; \
213
+ echo >&2 " ERROR: PULL_BASE_REF must be set to 'master', 'main', ' release-x.y', or a tag name." ; \
213
214
exit 1; \
214
215
fi
215
216
0 commit comments