From 9c9ffde394a82db8a586cb9021b1e27da4eb69e0 Mon Sep 17 00:00:00 2001 From: Mark Ison Date: Thu, 30 May 2019 15:04:35 +0100 Subject: [PATCH] Ensure building multiarch works when the image name isn't overridden Stop tagging latest by when running the make release step --- .travis.yml | 2 +- Makefile | 7 +++++-- build-multiarch.sh | 5 ----- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index 45e9474..d5a9b46 100644 --- a/.travis.yml +++ b/.travis.yml @@ -48,4 +48,4 @@ jobs: script: - echo $NAME:$VERSION_TAG - echo "$DOCKER_PASSWORD" | docker login --username "$DOCKER_USERNAME" --password-stdin - - ./build-multiarch.sh + - make build_multiarch diff --git a/Makefile b/Makefile index c1aa614..f0b2402 100644 --- a/Makefile +++ b/Makefile @@ -26,6 +26,9 @@ build: ./build.sh docker build --no-cache -t $(NAME):$(VERSION_ARG) $(BUILD_ARG) --build-arg QEMU_ARCH=$(QEMU_ARCH) --platform $(PLATFORM) --rm image +build_multiarch: + env NAME=$(NAME) VERSION=$(VERSION_ARG) ./build-multiarch.sh + test: env NAME=$(NAME) VERSION=$(VERSION_ARG) ./test/runner.sh @@ -33,9 +36,9 @@ tag_latest: docker tag $(NAME):$(VERSION_ARG) $(NAME):$(LATEST_VERSION) tag_multiarch_latest: - env TAG_LATEST=true ./build-multiarch.sh + env NAME=$(NAME) VERSION=$(VERSION) TAG_LATEST=true ./build-multiarch.sh -release: test tag_latest +release: test @if ! docker images $(NAME) | awk '{ print $$2 }' | grep -q -F $(VERSION_ARG); then echo "$(NAME) version $(VERSION_ARG) is not yet built. Please run 'make build'"; false; fi docker push $(NAME) @echo "*** Don't forget to create a tag by creating an official GitHub release." diff --git a/build-multiarch.sh b/build-multiarch.sh index e0d70f6..bc7cfdf 100755 --- a/build-multiarch.sh +++ b/build-multiarch.sh @@ -2,10 +2,7 @@ set -e set -x -if [[ $TRAVIS_PULL_REQUEST == 'false' ]]; then - for arch in $ARCHS; do - echo ${arch} docker pull $NAME:$VERSION-${arch} if [[ $TAG_LATEST != 'true' ]]; then @@ -23,5 +20,3 @@ if [[ $TAG_LATEST != 'true' ]]; then else docker manifest push $NAME:latest fi - -fi \ No newline at end of file