general: fix incorrect name for pushed docker images
This commit is contained in:
@@ -12,7 +12,8 @@ workflows:
|
|||||||
matrix:
|
matrix:
|
||||||
parameters:
|
parameters:
|
||||||
program: [frontend, proxy]
|
program: [frontend, proxy]
|
||||||
image_arch: [i386, amd64, arm32v7, arm64v8, ppc64le, s390x]
|
# latest is amd64 arch + push to default latest tag
|
||||||
|
image_arch: [latest, i386, arm32v7, arm64v8, ppc64le, s390x]
|
||||||
filters:
|
filters:
|
||||||
branches:
|
branches:
|
||||||
only: master
|
only: master
|
||||||
|
|||||||
63
Makefile
63
Makefile
@@ -1,6 +1,6 @@
|
|||||||
# Basic definitions
|
# Basic definitions
|
||||||
DOCKER_USERNAME := xddxdd
|
DOCKER_USERNAME := xddxdd
|
||||||
ARCHITECTURES := amd64 i386 arm32v7 arm64v8 ppc64le s390x riscv64 x32
|
ARCHITECTURES := amd64 i386 arm32v7 arm64v8 ppc64le s390x
|
||||||
IMAGES := frontend proxy
|
IMAGES := frontend proxy
|
||||||
|
|
||||||
# General Purpose Preprocessor config
|
# General Purpose Preprocessor config
|
||||||
@@ -12,17 +12,30 @@ GPP_FLAGS := -I ${GPP_INCLUDE_DIR} --nostdinc -U ${GPP_FLAGS_U} -M ${GPP_FLAGS_M
|
|||||||
|
|
||||||
BUILD_ID ?= $(shell date +%Y%m%d%H%M)
|
BUILD_ID ?= $(shell date +%Y%m%d%H%M)
|
||||||
|
|
||||||
# Function to create targets for image/architecture combos
|
|
||||||
define create-image-arch-target
|
define create-image-arch-target
|
||||||
$1/Dockerfile.$2: $1/template.Dockerfile
|
frontend/Dockerfile.$1: frontend/template.Dockerfile
|
||||||
@gpp ${GPP_FLAGS} -D ARCH_$(shell echo $2 | tr a-z A-Z) -o $1/Dockerfile.$2 $1/template.Dockerfile || rm -rf $1/Dockerfile.$2
|
@gpp ${GPP_FLAGS} -D ARCH_$(shell echo $1 | tr a-z A-Z) -o frontend/Dockerfile.$1 frontend/template.Dockerfile || rm -rf frontend/Dockerfile.$1
|
||||||
|
|
||||||
$1/$2: $1/Dockerfile.$2
|
frontend/$1: frontend/Dockerfile.$1
|
||||||
@if [ -f $1/Dockerfile.$2 ]; then \
|
@if [ -f frontend/Dockerfile.$1 ]; then \
|
||||||
docker build --pull --no-cache -t ${DOCKER_USERNAME}/$1:$2-${BUILD_ID} -f $1/Dockerfile.$2 $1 || exit 1; \
|
docker build --pull --no-cache -t ${DOCKER_USERNAME}/bird-lg-go:$1-${BUILD_ID} -f frontend/Dockerfile.$1 frontend || exit 1; \
|
||||||
docker push ${DOCKER_USERNAME}/$1:$2-${BUILD_ID} || exit 1; \
|
docker push ${DOCKER_USERNAME}/bird-lg-go:$1-${BUILD_ID} || exit 1; \
|
||||||
docker tag ${DOCKER_USERNAME}/$1:$2-${BUILD_ID} ${DOCKER_USERNAME}/$1:$2 || exit 1; \
|
docker tag ${DOCKER_USERNAME}/bird-lg-go:$1-${BUILD_ID} ${DOCKER_USERNAME}/bird-lg-go:$1 || exit 1; \
|
||||||
docker push ${DOCKER_USERNAME}/$1:$2 || exit 1; \
|
docker push ${DOCKER_USERNAME}/bird-lg-go:$1 || exit 1; \
|
||||||
|
else \
|
||||||
|
echo "Dockerfile generation failed, see error above"; \
|
||||||
|
exit 1; \
|
||||||
|
fi
|
||||||
|
|
||||||
|
proxy/Dockerfile.$1: proxy/template.Dockerfile
|
||||||
|
@gpp ${GPP_FLAGS} -D ARCH_$(shell echo $1 | tr a-z A-Z) -o proxy/Dockerfile.$1 proxy/template.Dockerfile || rm -rf proxy/Dockerfile.$1
|
||||||
|
|
||||||
|
proxy/$1: proxy/Dockerfile.$1
|
||||||
|
@if [ -f proxy/Dockerfile.$1 ]; then \
|
||||||
|
docker build --pull --no-cache -t ${DOCKER_USERNAME}/bird-lgproxy-go:$1-${BUILD_ID} -f proxy/Dockerfile.$1 proxy || exit 1; \
|
||||||
|
docker push ${DOCKER_USERNAME}/bird-lgproxy-go:$1-${BUILD_ID} || exit 1; \
|
||||||
|
docker tag ${DOCKER_USERNAME}/bird-lgproxy-go:$1-${BUILD_ID} ${DOCKER_USERNAME}/bird-lgproxy-go:$1 || exit 1; \
|
||||||
|
docker push ${DOCKER_USERNAME}/bird-lgproxy-go:$1 || exit 1; \
|
||||||
else \
|
else \
|
||||||
echo "Dockerfile generation failed, see error above"; \
|
echo "Dockerfile generation failed, see error above"; \
|
||||||
exit 1; \
|
exit 1; \
|
||||||
@@ -30,28 +43,28 @@ $1/$2: $1/Dockerfile.$2
|
|||||||
|
|
||||||
endef
|
endef
|
||||||
|
|
||||||
# Function to create targets for images
|
$(foreach arch,${ARCHITECTURES},$(eval $(call create-image-arch-target,$(arch))))
|
||||||
define create-image-target
|
|
||||||
$1:$(foreach arch,latest ${ARCHITECTURES},$1/${arch})
|
|
||||||
|
|
||||||
# Target for latest image, mapping to amd64
|
frontend:$(foreach arch,latest ${ARCHITECTURES},frontend/${arch})
|
||||||
$1/latest: $1/amd64
|
|
||||||
@docker tag ${DOCKER_USERNAME}/$1:amd64-${BUILD_ID} ${DOCKER_USERNAME}/$1:${BUILD_ID} || exit 1
|
|
||||||
docker push ${DOCKER_USERNAME}/$1:${BUILD_ID} || exit 1
|
|
||||||
@docker tag ${DOCKER_USERNAME}/$1:amd64-${BUILD_ID} ${DOCKER_USERNAME}/$1:latest || exit 1
|
|
||||||
docker push ${DOCKER_USERNAME}/$1:latest || exit 1
|
|
||||||
|
|
||||||
$(foreach arch,${ARCHITECTURES},$(eval $(call create-image-arch-target,$1,$(arch))))
|
frontend/latest: frontend/amd64
|
||||||
endef
|
@docker tag ${DOCKER_USERNAME}/bird-lg-go:amd64-${BUILD_ID} ${DOCKER_USERNAME}/bird-lg-go:${BUILD_ID} || exit 1
|
||||||
|
@docker push ${DOCKER_USERNAME}/bird-lg-go:${BUILD_ID} || exit 1
|
||||||
|
@docker tag ${DOCKER_USERNAME}/bird-lg-go:amd64-${BUILD_ID} ${DOCKER_USERNAME}/bird-lg-go:latest || exit 1
|
||||||
|
@docker push ${DOCKER_USERNAME}/bird-lg-go:latest || exit 1
|
||||||
|
|
||||||
|
proxy:$(foreach arch,latest ${ARCHITECTURES},proxy/${arch})
|
||||||
|
|
||||||
|
proxy/latest: proxy/amd64
|
||||||
|
@docker tag ${DOCKER_USERNAME}/bird-lgproxy-go:amd64-${BUILD_ID} ${DOCKER_USERNAME}/bird-lgproxy-go:${BUILD_ID} || exit 1
|
||||||
|
@docker push ${DOCKER_USERNAME}/bird-lgproxy-go:${BUILD_ID} || exit 1
|
||||||
|
@docker tag ${DOCKER_USERNAME}/bird-lgproxy-go:amd64-${BUILD_ID} ${DOCKER_USERNAME}/bird-lgproxy-go:latest || exit 1
|
||||||
|
@docker push ${DOCKER_USERNAME}/bird-lgproxy-go:latest || exit 1
|
||||||
|
|
||||||
# By default, build docker images, and do not delete intermediate files
|
|
||||||
.DEFAULT_GOAL := images
|
.DEFAULT_GOAL := images
|
||||||
.DELETE_ON_ERROR:
|
.DELETE_ON_ERROR:
|
||||||
.SECONDARY:
|
.SECONDARY:
|
||||||
|
|
||||||
# Create all targets for image/architecture combos
|
|
||||||
$(foreach image,${IMAGES},$(eval $(call create-image-target,${image})))
|
|
||||||
|
|
||||||
# Target to enable multiarch support
|
# Target to enable multiarch support
|
||||||
_crossbuild:
|
_crossbuild:
|
||||||
@docker run --rm --privileged multiarch/qemu-user-static --reset -p yes >/dev/null
|
@docker run --rm --privileged multiarch/qemu-user-static --reset -p yes >/dev/null
|
||||||
|
|||||||
Reference in New Issue
Block a user