-
Notifications
You must be signed in to change notification settings - Fork 144
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix k8s template link versioning (#1504)
- Loading branch information
Showing
3 changed files
with
12 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
ALL=elastic-agent-standalone elastic-agent-managed | ||
BEAT_VERSION=$(shell head -n 1 ../../version/docs/version.asciidoc | cut -c 17- ) | ||
BRANCH_VERSION=$(shell sed -n '2p' ../../version/docs/version.asciidoc | cut -c 14- ) | ||
|
||
#variables needed for ci-create-kubernetes-templates-pull-request | ||
ELASTIC_AGENT_REPO=kibana | ||
|
@@ -9,7 +10,7 @@ ELASTIC_AGENT_BRANCH=update-k8s-templates-$(shell date "+%Y%m%d%H%M%S") | |
|
||
.PHONY: generate-k8s $(ALL) | ||
generate-k8s: $(ALL) | ||
|
||
test: generate-k8s | ||
for FILE in $(shell ls *-kubernetes.yaml); do \ | ||
BEAT=$$(echo $$FILE | cut -d \- -f 1); \ | ||
|
@@ -19,21 +20,21 @@ test: generate-k8s | |
clean: | ||
@for f in $(ALL); do rm -f "$$f-kubernetes.yaml"; done | ||
|
||
$(ALL): | ||
$(ALL): | ||
ifdef WITHOUTCONFIG | ||
@echo "Generating [email protected]" | ||
@rm -f [email protected] | ||
@for f in $(shell ls $@/*.yaml | grep -v daemonset-configmap); do \ | ||
sed "s/%VERSION%/VERSION/g" $$f >> [email protected]; \ | ||
sed -e "s/%VERSION%/VERSION/g" -e "s/%BRANCH%/${BRANCH_VERSION}/g" $$f >> [email protected]; \ | ||
echo --- >> [email protected]; \ | ||
done | ||
else | ||
@echo "Generating [email protected]" | ||
@rm -f [email protected] | ||
@echo "Generating [email protected]" | ||
@rm -f [email protected] | ||
@for f in $(shell ls $@/*.yaml); do \ | ||
sed "s/%VERSION%/${BEAT_VERSION}/g" $$f >> [email protected]; \ | ||
sed -e "s/%VERSION%/${BEAT_VERSION}/g" -e "s/%BRANCH%/${BRANCH_VERSION}/g" $$f >> [email protected]; \ | ||
echo --- >> [email protected]; \ | ||
done | ||
done | ||
endif | ||
|
||
CHDIR_SHELL := $(SHELL) | ||
|
@@ -47,7 +48,7 @@ endef | |
ci-clone-kibana-repository: | ||
git clone [email protected]:elastic/kibana.git | ||
cp $(FILE_REPO) $(ELASTIC_AGENT_REPO)/$(ELASTIC_AGENT_REPO_PATH) | ||
|
||
## ci-create-kubernetes-templates-pull-request : Create the pull request for the kubernetes templates | ||
$(eval HASDIFF =$(shell sh -c "git status | grep $(FILE_REPO) | wc -l")) | ||
.PHONY: ci-create-kubernetes-templates-pull-request | ||
|
@@ -79,6 +80,7 @@ else | |
--head $(ELASTIC_AGENT_BRANCH) \ | ||
--reviewer elastic/obs-cloudnative-monitoring | ||
endif | ||
|
||
else | ||
echo "No differences found with kibana git repository" | ||
endif | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters