From a3649fa6ec1d97d8350f362887655e51dea46914 Mon Sep 17 00:00:00 2001 From: Pagan Gazzard Date: Mon, 5 Jun 2017 16:03:50 -0700 Subject: [PATCH] Switch to generating the BASE_IMAGE_VERSION in the makefile, so that the makefile targets can use an accurate version by default Fixes #422 Change-type: minor --- Makefile | 6 +++++- automation/jenkins_build.sh | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index ddd60913..ba340a0e 100644 --- a/Makefile +++ b/Makefile @@ -25,7 +25,8 @@ ARCH = rpi# rpi/amd64/i386/armv7hf/armel DEPLOY_REGISTRY = SUPERVISOR_VERSION = master -ESCAPED_BASE_IMAGE_TAG = resin\/$(ARCH)-supervisor-base:$(SUPERVISOR_VERSION) +BASE_IMAGE_VERSION = $(shell find base-image -print0 | LC_ALL=C sort -z | tar --null -cf - --no-recursion --mtime=@0 --owner=root --group=root --numeric-owner -T - | md5sum | awk -F " " '{print $$1}') +ESCAPED_BASE_IMAGE_TAG = resin\/$(ARCH)-supervisor-base:$(BASE_IMAGE_VERSION) DOCKER_VERSION:=$(shell docker version --format '{{.Server.Version}}') DOCKER_MAJOR_VERSION:=$(word 1, $(subst ., ,$(DOCKER_VERSION))) @@ -226,4 +227,7 @@ test-integration: gosuper resin/go-supervisor-$(ARCH):$(SUPERVISOR_VERSION) \ go test -v ./supertest +base-image-version: + @echo $(BASE_IMAGE_VERSION) + .PHONY: supervisor deploy supervisor-dind run-supervisor gosuper nodesuper diff --git a/automation/jenkins_build.sh b/automation/jenkins_build.sh index a6904030..3129456f 100755 --- a/automation/jenkins_build.sh +++ b/automation/jenkins_build.sh @@ -6,7 +6,7 @@ export ESCAPED_BRANCH_NAME=$(echo $sourceBranch | sed 's/[^a-z0-9A-Z_.-]/-/g') git submodule update --init --recursive git clean -fxd base-image git submodule foreach --recursive git clean -fxd -BASE_IMAGE_VERSION=$(find base-image -print0 | LC_ALL=C sort -z | tar --null -cf - --no-recursion --mtime=@0 --owner=root --group=root --numeric-owner -T - | md5sum | awk -F " " '{print $1}') +BASE_IMAGE_VERSION=$(make base-image-version) export BASE_IMAGE_REPO=resin/$ARCH-supervisor-base export BASE_IMAGE_TAG=resin/$ARCH-supervisor-base:$BASE_IMAGE_VERSION