From b41448b274c9a18f2540bca88b4e6cc2fdd91346 Mon Sep 17 00:00:00 2001 From: Daniel Maizel Date: Mon, 7 Nov 2022 18:50:44 +0200 Subject: [PATCH] fix script that gets the runtime def location (#633) * fix script that gets the runtime def location * remove unused targets --- Makefile | 10 +--------- hack/get-manifests-location.sh | 6 ++++-- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/Makefile b/Makefile index 2568cc10a..516193f07 100644 --- a/Makefile +++ b/Makefile @@ -76,10 +76,7 @@ cli-local: $(OUT_DIR)/$(CLI_NAME)-$(shell go env GOOS)-$(shell go env GOARCH) @ln $(OUT_DIR)/$(CLI_NAME)-$(shell go env GOOS)-$(shell go env GOARCH) /usr/local/bin/$(CLI_NAME)-dev .PHONY: cli-e2e -cli-e2e: cli-package - -.PHONY: cli-package -cli-package: $(OUT_DIR)/$(CLI_NAME)-$(shell go env GOOS)-$(shell go env GOARCH) +cli-e2e: $(OUT_DIR)/$(CLI_NAME)-$(shell go env GOOS)-$(shell go env GOARCH) @cp $(OUT_DIR)/$(CLI_NAME)-$(shell go env GOOS)-$(shell go env GOARCH) $(OUT_DIR)/$(CLI_NAME) $(OUT_DIR)/$(CLI_NAME)-linux-amd64: GO_FLAGS='GOOS=linux GOARCH=amd64 CGO_ENABLED=0' @@ -175,8 +172,3 @@ $(GOBIN)/golangci-lint: @mkdir dist || true @echo installing: golangci-lint @curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(GOBIN) v1.50.1 - -.PHONY: e2e-local-manifests -e2e-local-manifests: - cat /codefresh/volume/cli-v2/manifests/runtime.yaml | sed 's@github.com/codefresh-io/cli-v2/@/codefresh/volume/cli-v2/@' > /tmp/tmp_runtime.yaml - mv /tmp/tmp_runtime.yaml manifests/runtime.yaml diff --git a/hack/get-manifests-location.sh b/hack/get-manifests-location.sh index 53d4a5137..15b3b0b1f 100755 --- a/hack/get-manifests-location.sh +++ b/hack/get-manifests-location.sh @@ -4,7 +4,7 @@ REPO="https://github.com/codefresh-io/csdp-official" BRANCH="$1" DEFAULT_MANIFESTS_LOCATION="https://raw.githubusercontent.com/codefresh-io/csdp-official/stable/csdp/hybrid/basic/runtime.yaml" -CUSTOM_MANIFESTS_LOCATION="https://github.com/codefresh-io/csdp-official/csdp/hybrid/basic/runtime.yaml?ref=$BRANCH" +RUNTIME_DEFINITION_URL="https://raw.githubusercontent.com/codefresh-io/csdp-official/$BRANCH/csdp/hybrid/basic/runtime.yaml" git ls-remote --heads ${REPO} ${BRANCH} | grep ${BRANCH} >/dev/null @@ -14,4 +14,6 @@ if [ "$?" == "1" ]; then exit 0 fi -echo "$CUSTOM_MANIFESTS_LOCATION" +RUNTIME_DEFINITION_FILE="/codefresh/volume/runtime.yaml" +curl --silent "$RUNTIME_DEFINITION_URL" | yq "(.spec.components[] | select(.type == \"kustomize\") | .url) += \"?ref=$BRANCH\"" | yq ".spec.bootstrapSpecifier += \"?ref=$BRANCH\"" >$RUNTIME_DEFINITION_FILE +echo $RUNTIME_DEFINITION_FILE