Merge pull request #3860 from zmstone/refactor-build-download-from-github-release
refactor(build): download rebar3 from GitHub release
This commit is contained in:
commit
e2c472ae84
2
Makefile
2
Makefile
|
@ -1,4 +1,4 @@
|
|||
REBAR_VERSION = 3.13.2-emqx-1
|
||||
REBAR_VERSION = 3.13.2-emqx-2
|
||||
REBAR = ./rebar3
|
||||
|
||||
PROFILE ?= emqx
|
||||
|
|
|
@ -4,12 +4,17 @@ set -euo pipefail
|
|||
|
||||
VERSION="$1"
|
||||
|
||||
DOWNLOAD_URL='https://github.com/emqx/rebar3/releases/download'
|
||||
|
||||
download() {
|
||||
curl -L "https://s3-us-west-2.amazonaws.com/packages.emqx/rebar/rebar3-${VERSION}" -o ./rebar3
|
||||
curl -L "${DOWNLOAD_URL}/${VERSION}/rebar3" -o ./rebar3
|
||||
}
|
||||
|
||||
# get the version number from the second line of the escript
|
||||
# because command `rebar3 -v` tries to load rebar.config
|
||||
# which is slow and may print some logs
|
||||
version() {
|
||||
./rebar3 -v | grep -v '===' | grep 'rebar.*Erlang' | awk '{print $2}'
|
||||
head -n 2 ./rebar3 | tail -n 1 | tr ' ' '\n' | grep -E '^.+-emqx-.+'
|
||||
}
|
||||
|
||||
if [ -f 'rebar3' ] && [ "$(version)" == "$VERSION" ]; then
|
||||
|
|
Loading…
Reference in New Issue