From 50a2d3db29b0ec24241f8e099f421c10c77114f5 Mon Sep 17 00:00:00 2001 From: Mike Kolesnik Date: Wed, 10 Mar 2021 12:39:19 +0200 Subject: [PATCH] Import Makefile.dapper downloaded from Shipyard Instead of redefining the dapper file here, download it from Shiyard Also use the BASE_BRANCH env variable for the dapper file Signed-off-by: Mike Kolesnik --- .gitignore | 1 + Dockerfile.dapper | 3 ++- Makefile | 9 ++++++++- Makefile.dapper | 26 -------------------------- 4 files changed, 11 insertions(+), 28 deletions(-) delete mode 100644 Makefile.dapper diff --git a/.gitignore b/.gitignore index 730ba57..eb49691 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ .idea .shflags *.tgz +Makefile.dapper diff --git a/Dockerfile.dapper b/Dockerfile.dapper index 4ffab1a..d65e66b 100644 --- a/Dockerfile.dapper +++ b/Dockerfile.dapper @@ -1,4 +1,5 @@ -FROM quay.io/submariner/shipyard-dapper-base:devel +ARG BASE_BRANCH +FROM quay.io/submariner/shipyard-dapper-base:${BASE_BRANCH} ARG DAPPER_HOST_ARCH ENV HOST_ARCH=${DAPPER_HOST_ARCH} ARCH=${DAPPER_HOST_ARCH} \ diff --git a/Makefile b/Makefile index 733bdab..7819391 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,6 @@ +BASE_BRANCH ?= devel +export BASE_BRANCH + ifneq (,$(DAPPER_HOST_ARCH)) # Running in Dapper @@ -54,9 +57,13 @@ else # Not running in Dapper +Makefile.dapper: + @echo Downloading $@ + @curl -sfLO https://raw.githubusercontent.com/submariner-io/shipyard/$(BASE_BRANCH)/$@ + include Makefile.dapper endif # Disable rebuilding Makefile -Makefile Makefile.dapper Makefile.inc: ; +Makefile Makefile.inc: ; diff --git a/Makefile.dapper b/Makefile.dapper deleted file mode 100644 index cd42de7..0000000 --- a/Makefile.dapper +++ /dev/null @@ -1,26 +0,0 @@ -# This Makefile contains the rules required to set up our -# Dapper-based build environment; it can be copied as-is to -# other projects (and needs to be copied, it can't be shared -# via the Dapper image since it's needed to retrieve the image) - -.dapper: - @echo Downloading dapper - @curl -sL https://releases.rancher.com/dapper/latest/dapper-`uname -s`-`uname -m` > .dapper.tmp - @@chmod +x .dapper.tmp - @./.dapper.tmp -v - @mv .dapper.tmp .dapper - -invoke_dapper = +./.dapper -m bind make -- $1 - -%: .dapper - @echo Invoking Dapper, MAKEFLAGS=$(MAKEFLAGS) - $(call invoke_dapper,$@) - -# Ensure that files in the current directory don't hide Dapper targets -$(wildcard [^M]*): .dapper - $(call invoke_dapper,$@) - -shell: .dapper - ./.dapper -m bind -s - -.PHONY: shell $(wildcard [^M]*)