Skip to content

Commit

Permalink
Ensure building multiarch works when the image name isn't overridden
Browse files Browse the repository at this point in the history
Stop tagging latest by when running the make release step
  • Loading branch information
CodeCutterUK committed May 31, 2019
1 parent b5c34e9 commit 9c9ffde
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,19 @@ 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

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."
Expand Down
5 changes: 0 additions & 5 deletions build-multiarch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -23,5 +20,3 @@ if [[ $TAG_LATEST != 'true' ]]; then
else
docker manifest push $NAME:latest
fi

fi

0 comments on commit 9c9ffde

Please sign in to comment.