Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: prefer system-wide rebar3 #107

Merged
merged 3 commits into from
Dec 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
BUILD_WITHOUT_QUIC ?= true
export BUILD_WITHOUT_QUIC

REBAR = $(CURDIR)/rebar3
REBAR_VERSION = 3.16.1-emqx-1
REBAR ?= $(or $(shell which rebar3 2>/dev/null),$(CURDIR)/rebar3)
REBAR_VERSION ?= 3.19.0-emqx-1

.PHONY: all
all: compile
Expand All @@ -13,7 +13,8 @@ all: compile
get-rebar3:
@$(CURDIR)/get-rebar3 $(REBAR_VERSION)

$(REBAR): get-rebar3
$(REBAR):
$(MAKE) get-rebar3

.PHONY: compile
compile: $(REBAR)
Expand Down
5 changes: 4 additions & 1 deletion get-rebar3
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ cd -P -- "$(dirname -- "${BASH_SOURCE[0]}")/"
DOWNLOAD_URL='/~https://github.com/emqx/rebar3/releases/download'

download() {
curl --silent --show-error -f -L "${DOWNLOAD_URL}/${VERSION}/rebar3" -o ./rebar3
local url="${DOWNLOAD_URL}/${VERSION}/rebar3"

echo "Downloading rebar3 from '${url}' ..."
curl --silent --show-error -f -L "${url}" -o ./rebar3
}

# get the version number from the second line of the escript
Expand Down