From d96df7e064376864c6070eb0598805fa08b1475e Mon Sep 17 00:00:00 2001 From: xZero707 Date: Fri, 24 Sep 2021 23:25:47 +0200 Subject: [PATCH] Fix image tagging problem where latest version is not tagged as litteral --- build/bin/build | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/build/bin/build b/build/bin/build index e704aac..270b41b 100755 --- a/build/bin/build +++ b/build/bin/build @@ -1,7 +1,8 @@ -#!/usr/bin/env sh +#!/usr/bin/env bash WP_VERSIONS=${1:-""} WP_LATEST_VERSION=${2:-""} +TARGET_PLATFORMS="linux/amd64,linux/armhf,linux/aarch64" CACHE_DIR="/tmp/.buildx-cache" @@ -16,16 +17,18 @@ docker buildx create --use --name build --node build --driver-opt network=host for TARGET_VERSION in ${WP_VERSIONS}; do echo "> Building WordPress ${TARGET_VERSION}" + IMAGE_TAGS="--tag nlss/wordpress:${TARGET_VERSION}" + if [ "${TARGET_VERSION}" = "${WP_LATEST_VERSION}" ]; then - TARGET_VERSION="latest" + IMAGE_TAGS="${IMAGE_TAGS} --tag nlss/wordpress:latest" fi - docker buildx build \ + docker buildx build . \ --pull \ --push \ --cache-from "type=local,src=${CACHE_DIR}" \ --cache-to "type=local,dest=${CACHE_DIR}" \ --build-arg "WP_VERSION=${TARGET_VERSION}" \ - --platform "linux/amd64,linux/armhf,linux/aarch64" \ - --tag "nlss/wordpress:${TARGET_VERSION}" . + --platform "${TARGET_PLATFORMS}" \ + ${IMAGE_TAGS[@]} done