fix: some sanity-checks

This commit is contained in:
Shawn 2024-07-18 19:00:55 +08:00
parent 3c8ef35b18
commit 3ad7dc262b
7 changed files with 17 additions and 14 deletions

View File

@ -238,7 +238,7 @@ $(foreach zt,$(ALL_ZIPS),$(eval $(call download-relup-packages,$(zt))))
## relup target is to create relup instructions
.PHONY: $(REL_PROFILES:%=%-relup)
define gen-relup-target
$1-relup: $1-relup-downloads $(COMMON_DEPS)
$1-relup: $(COMMON_DEPS)
@$(BUILD) $1 relup
endef
ALL_TGZS = $(REL_PROFILES)
@ -247,7 +247,7 @@ $(foreach zt,$(ALL_TGZS),$(eval $(call gen-relup-target,$(zt))))
## tgz target is to create a release package .tar.gz with relup
.PHONY: $(REL_PROFILES:%=%-tgz)
define gen-tgz-target
$1-tgz: $1-relup
$1-tgz: $(COMMON_DEPS)
@$(BUILD) $1 tgz
endef
ALL_TGZS = $(REL_PROFILES)

View File

@ -17,21 +17,21 @@
-module(emqx_post_upgrade).
%% PR#12765
-export([
pr12765_update_stats_timer/1,
pr12765_revert_stats_timer/1
]).
% -export([
% pr12765_update_stats_timer/1,
% pr12765_revert_stats_timer/1
% ]).
-include("logger.hrl").
%%------------------------------------------------------------------------------
%% Hot Upgrade Callback Functions.
%%------------------------------------------------------------------------------
pr12765_update_stats_timer(_FromVsn) ->
emqx_stats:update_interval(broker_stats, fun emqx_broker_helper:stats_fun/0).
% pr12765_update_stats_timer(_FromVsn) ->
% emqx_stats:update_interval(broker_stats, fun emqx_broker_helper:stats_fun/0).
pr12765_revert_stats_timer(_ToVsn) ->
emqx_stats:update_interval(broker_stats, fun emqx_broker:stats_fun/0).
% pr12765_revert_stats_timer(_ToVsn) ->
% emqx_stats:update_interval(broker_stats, fun emqx_broker:stats_fun/0).
%%------------------------------------------------------------------------------
%% Helper functions

View File

@ -40,6 +40,8 @@
'/relup/upgrade/:node'/2
]).
-ignore_xref(emqx_relup_main).
-define(TAGS, [<<"Relup">>]).
-define(NAME_RE, "^[A-Za-z]+[A-Za-z0-9-_.]*$").
-define(CONTENT_PACKAGE, plugin).

View File

@ -69,7 +69,7 @@ if [ -f "$RUNNER_ROOT_DIR/relup/version" ]; then
TARGET_VSN=$(cat "$RUNNER_ROOT_DIR/relup/version")
export BASE_RUNNER_ROOT_DIR
logwarn "Loading emqx from hot upgrade dir: $RUNNER_ROOT_DIR/relup"
exec $RUNNER_ROOT_DIR/relup/$TARGET_VSN/bin/emqx "$@"
exec "$RUNNER_ROOT_DIR"/relup/"$TARGET_VSN"/bin/emqx "$@"
else
logdebug "Loading emqx from $RUNNER_ROOT_DIR"
fi

3
build
View File

@ -212,7 +212,8 @@ make_elixir_rel() {
}
make_relup() {
export RELUP_TARGET_VSN="$(./pkg-vsn.sh "$PROFILE" --long)"
RELUP_TARGET_VSN="$(./pkg-vsn.sh "$PROFILE" --long)"
export RELUP_TARGET_VSN
./rebar3 emqx relup_gen --relup-dir=./relup
make rel -C _build/default/plugins/emqx_relup
}

View File

@ -184,7 +184,7 @@ project_app_excluded("apps/" ++ AppStr, ExcludedApps) ->
plugins() ->
[
{emqx_relup, {git, "https://github.com/emqx/emqx-relup.git", {branch, "0.1.0"}}},
{emqx_relup, {git, "https://github.com/emqx/emqx-relup.git", {tag, "0.1.0"}}},
%% emqx main project does not require port-compiler
%% pin at root level for deterministic
{pc, "v1.14.0"}