Skip to content

Commit

Permalink
Makefile: Separate "ELASTICSEARCH_VERSION" and "ELASTICSEARCH_BUILD_V…
Browse files Browse the repository at this point in the history
…ERSION" environment variables

Related: 9f367e6
(cherry picked from commit 33ff6af)
  • Loading branch information
karmi committed Mar 22, 2020
1 parent c3e8c65 commit 98cec53
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -346,8 +346,8 @@ gen-api: ## Generate the API package from the JSON specification
ifdef debug
$(eval args += --debug)
endif
ifdef ELASTICSEARCH_VERSION
$(eval version = $(ELASTICSEARCH_VERSION))
ifdef ELASTICSEARCH_BUILD_VERSION
$(eval version = $(ELASTICSEARCH_BUILD_VERSION))
else
$(eval version = $(shell cat "$(input)/buildSrc/version.properties" | grep 'elasticsearch' | cut -d '=' -f 2 | tr -d ' '))
endif
Expand All @@ -360,7 +360,7 @@ endif
@{ \
set -e; \
trap "test -d .git && git checkout --quiet $(PWD)/internal/cmd/generate/go.mod" INT TERM EXIT; \
export ELASTICSEARCH_VERSION=$(version) && \
export ELASTICSEARCH_BUILD_VERSION=$(version) && \
export ELASTICSEARCH_BUILD_HASH=$(build_hash) && \
cd internal/cmd/generate && \
go run main.go apisource --input '$(PWD)/$(input)/rest-api-spec/src/main/resources/rest-api-spec/api/*.json' --output '$(PWD)/$(output)' $(args) && \
Expand All @@ -375,7 +375,7 @@ ifdef debug
$(eval args += --debug)
endif
ifdef ELASTICSEARCH_VERSION
$(eval version = $(ELASTICSEARCH_VERSION))
$(eval version = $(ELASTICSEARCH_BUILD_VERSION))
else
$(eval version = $(shell cat "$(input)/buildSrc/version.properties" | grep 'elasticsearch' | cut -d '=' -f 2 | tr -d ' '))
endif
Expand All @@ -388,7 +388,7 @@ endif
@{ \
set -e; \
trap "test -d .git && git checkout --quiet $(PWD)/internal/cmd/generate/go.mod" INT TERM EXIT; \
export ELASTICSEARCH_VERSION=$(version) && \
export ELASTICSEARCH_BUILD_VERSION=$(version) && \
export ELASTICSEARCH_BUILD_HASH=$(build_hash) && \
rm -rf $(output)/*_test.go && \
rm -rf $(output)/xpack && \
Expand Down

0 comments on commit 98cec53

Please sign in to comment.