From 25d6a98aa4b361a35f6c2096bcae59b55240ba92 Mon Sep 17 00:00:00 2001 From: Zaiming Shi Date: Tue, 16 Nov 2021 09:44:38 +0100 Subject: [PATCH] build: get otp version and export OTP_VSN --- Makefile | 1 + scripts/get-otp-vsn.sh | 5 +++++ 2 files changed, 6 insertions(+) create mode 100755 scripts/get-otp-vsn.sh diff --git a/Makefile b/Makefile index ad5344c39..938ccf736 100644 --- a/Makefile +++ b/Makefile @@ -3,6 +3,7 @@ REBAR_VERSION = 3.16.1-emqx-1 REBAR = $(CURDIR)/rebar3 BUILD = $(CURDIR)/build SCRIPTS = $(CURDIR)/scripts +export OTP_VSN ?= $(shell $(CURDIR)/scripts/get-otp-vsn.sh) export PKG_VSN ?= $(shell $(CURDIR)/pkg-vsn.sh) export EMQX_DESC ?= EMQ X export EMQX_DASHBOARD_VERSION ?= v5.0.0-beta.18 diff --git a/scripts/get-otp-vsn.sh b/scripts/get-otp-vsn.sh new file mode 100755 index 000000000..a791318dc --- /dev/null +++ b/scripts/get-otp-vsn.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +set -euo pipefail + +erl -noshell -eval '{ok, Version} = file:read_file(filename:join([code:root_dir(), "releases", erlang:system_info(otp_release), "OTP_VERSION"])), io:fwrite(Version), halt().'