From 9d252ecf92c150d8a43b6c81a10d2cee64a05a9b Mon Sep 17 00:00:00 2001 From: Mike Kolesnik Date: Tue, 12 Dec 2023 16:48:19 +0200 Subject: [PATCH] Add Shipyard support for deploying clusters This allows to quickly and easily deploy clusters (kind, ocp, acm) for testing. The kind clusters run locally and can be used for development, quick testing and CI. Signed-off-by: Mike Kolesnik --- .gitignore | 6 ++++++ .shipyard.yml | 5 +++++ Makefile | 30 ++++++++++++++++++++++++++++++ 3 files changed, 41 insertions(+) create mode 100644 .shipyard.yml diff --git a/.gitignore b/.gitignore index 825173c29c..df7a2b849d 100644 --- a/.gitignore +++ b/.gitignore @@ -30,3 +30,9 @@ # Generated files manifest.json + +# Shipyard generated and downloaded +.dapper +Dockerfile.dapper +Makefile.shipyard +output/ diff --git a/.shipyard.yml b/.shipyard.yml new file mode 100644 index 0000000000..75dde449a6 --- /dev/null +++ b/.shipyard.yml @@ -0,0 +1,5 @@ +--- +nodes: control-plane worker +clusters: + cluster1: + cluster2: diff --git a/Makefile b/Makefile index 49d0d97ec4..4e945514b4 100644 --- a/Makefile +++ b/Makefile @@ -12,6 +12,15 @@ PLATFORMS ?= linux/amd64,linux/arm64 GOOS ?= linux GOARCH ?= amd64 +# Shipyard configuration +BASE_BRANCH = main +LOAD_BALANCER = true +ORG = skupperproject +PROJECT = skupper +SETTINGS = ./.shipyard.yml +SHIPYARD_URL = https://raw.githubusercontent.com/submariner-io/shipyard/devel +export BASE_BRANCH ORG PROJECT SHIPYARD_REPO SHIPYARD_URL + all: generate-client build-cmd build-get build-config-sync build-controllers build-tests build-manifest build-tests: @@ -142,3 +151,24 @@ release/arm64/skupper: cmd/skupper/skupper.go release/arm64.tgz: release/arm64/skupper tar -czf release/arm64.tgz release/arm64/skupper + +ifneq (,$(DAPPER_HOST_ARCH)) + +# Running in Shipyard's container + +include $(SHIPYARD_DIR)/Makefile.clusters + +else + +# Not running in Shipyard's container + +Makefile.shipyard: +ifeq (,$(findstring s,$(firstword -$(MAKEFLAGS)))) + @echo Downloading $@ +endif + @curl -sfLO $(SHIPYARD_URL)/$@ + +ONLY_SHIPYARD_GOALS = true +include Makefile.shipyard + +endif