chore(build): move rebar3 download script to scripts dir

This commit is contained in:
Zaiming Shi 2021-03-01 07:49:22 +01:00 committed by Shawn
parent 675603fd73
commit 30293b602a
3 changed files with 9 additions and 8 deletions

View File

@ -2,6 +2,7 @@ REBAR_VERSION = 3.14.3-emqx-4
DASHBOARD_VERSION = v4.3.0 DASHBOARD_VERSION = v4.3.0
REBAR = $(CURDIR)/rebar3 REBAR = $(CURDIR)/rebar3
BUILD = $(CURDIR)/build BUILD = $(CURDIR)/build
SCRIPTS = $(CURDIR)/scripts
export EMQX_ENTERPRISE=false export EMQX_ENTERPRISE=false
export PKG_VSN ?= $(shell $(CURDIR)/pkg-vsn.sh) export PKG_VSN ?= $(shell $(CURDIR)/pkg-vsn.sh)
@ -20,13 +21,13 @@ all: $(REBAR) $(PROFILES)
.PHONY: ensure-rebar3 .PHONY: ensure-rebar3
ensure-rebar3: ensure-rebar3:
$(CURDIR)/ensure-rebar3.sh $(REBAR_VERSION) $(SCRIPTS)/ensure-rebar3.sh $(REBAR_VERSION)
$(REBAR): ensure-rebar3 $(REBAR): ensure-rebar3
.PHONY: get-dashboard .PHONY: get-dashboard
get-dashboard: get-dashboard:
$(CURDIR)/scripts/get-dashboard.sh $(DASHBOARD_VERSION) $(SCRIPTS)/get-dashboard.sh $(DASHBOARD_VERSION)
.PHONY: eunit .PHONY: eunit
eunit: $(REBAR) eunit: $(REBAR)

View File

@ -1,12 +1,11 @@
#!/bin/sh #!/bin/bash
#set -euo pipefail set -euo pipefail
set -eu
VERSION="$1" VERSION="$1"
# ensure dir # ensure dir
cd -P -- "$(dirname -- "$0")" cd -P -- "$(dirname -- "${BASH_SOURCE[0]}")/.."
DOWNLOAD_URL='https://github.com/emqx/rebar3/releases/download' DOWNLOAD_URL='https://github.com/emqx/rebar3/releases/download'

View File

@ -1,9 +1,10 @@
#!/bin/bash #!/bin/bash
## NOTE: execute this script in the project root
set -euo pipefail set -euo pipefail
# ensure dir
cd -P -- "$(dirname -- "${BASH_SOURCE[0]}")/.."
if [[ "$1" == https://* ]]; then if [[ "$1" == https://* ]]; then
VERSION='*' # alwyas download VERSION='*' # alwyas download
DOWNLOAD_URL="$1" DOWNLOAD_URL="$1"