From 029c867f5a7c320e406cefc65814631c026a1937 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 | 29 +++++++++++++++++++++++++++++ 3 files changed, 40 insertions(+) create mode 100644 .shipyard.yml diff --git a/.gitignore b/.gitignore index 825173c29..df7a2b849 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 000000000..75dde449a --- /dev/null +++ b/.shipyard.yml @@ -0,0 +1,5 @@ +--- +nodes: control-plane worker +clusters: + cluster1: + cluster2: diff --git a/Makefile b/Makefile index 49d0d97ec..53d4f24ea 100644 --- a/Makefile +++ b/Makefile @@ -12,6 +12,14 @@ PLATFORMS ?= linux/amd64,linux/arm64 GOOS ?= linux GOARCH ?= amd64 +# Shipyard configuration +BASE_BRANCH = main +LOAD_BALANCER = true +ORG = skupperproject +PROJECT = skupper +SETTINGS = ./.shipyard.yml +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 +150,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