From e7785a63eec21c18b23430176ba1c6ea5d2e0865 Mon Sep 17 00:00:00 2001 From: Zaiming Shi Date: Wed, 10 Feb 2021 22:24:41 +0100 Subject: [PATCH] fix(scripts): update scripts to work with new lib-opensource dir --- Makefile | 1 + elvis.config | 4 ++-- get-dashboard.sh | 9 ++++++--- rebar.config.erl | 2 +- sync-apps.sh | 6 +++--- 5 files changed, 13 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index 76e3802bd..81b8b4fb0 100644 --- a/Makefile +++ b/Makefile @@ -2,6 +2,7 @@ REBAR_VERSION = 3.14.3-emqx-4 DASHBOARD_VERSION = v4.3.0 REBAR = $(CURDIR)/rebar3 BUILD = $(CURDIR)/build +export EMQX_ENTERPRISE=false export PKG_VSN ?= $(shell $(CURDIR)/pkg-vsn.sh) PROFILE ?= emqx diff --git a/elvis.config b/elvis.config index 42f67e40f..bb551e81a 100644 --- a/elvis.config +++ b/elvis.config @@ -5,7 +5,7 @@ [ {config, [ - #{dirs => ["apps/**/src", "src"], + #{dirs => ["src", "apps/**/src", "lib-opensource/**/src"], filter => "*.erl", ruleset => erl_files, rules => [ @@ -16,7 +16,7 @@ ]}} ] }, - #{dirs => ["apps/**/test", "test"], + #{dirs => ["test", "apps/**/test", "lib-opensource/**/src"], filter => "*.erl", rules => [ {elvis_text_style, line_length, #{ limit => 100 diff --git a/get-dashboard.sh b/get-dashboard.sh index 08879351d..885a68f77 100755 --- a/get-dashboard.sh +++ b/get-dashboard.sh @@ -1,6 +1,5 @@ -#!/bin/sh +#!/bin/bash -#set -euo pipefail set -eu VERSION="$1" @@ -10,7 +9,11 @@ cd -P -- "$(dirname -- "$0")" DOWNLOAD_URL='https://github.com/emqx/emqx-dashboard-frontend/releases/download' -DASHBOARD_PATH='apps/emqx_dashboard/priv' +if [ "$EMQX_ENTERPRISE" = 'true' ] || [ "$EMQX_ENTERPRISE" == '1' ]; then + DASHBOARD_PATH='lib-enterprise/emqx_dashboard/priv' +else + DASHBOARD_PATH='lib-opensource/emqx_dashboard/priv' +fi case $(uname) in *Darwin*) SED="sed -E";; diff --git a/rebar.config.erl b/rebar.config.erl index d68d46b9b..4bd8f45e4 100644 --- a/rebar.config.erl +++ b/rebar.config.erl @@ -279,7 +279,7 @@ provide_bcrypt_release(ReleaseType) -> %% rebar3 does not handle umberella project's cross-app parse_transform well compile_and_load_pase_transforms(Dir) -> PtFiles = - [ "apps/emqx_rule_engine/src/emqx_rule_actions_trans.erl" + [ "lib-opensource/emqx_rule_engine/src/emqx_rule_actions_trans.erl" ], CompileOpts = [verbose,report_errors,report_warnings,return_errors,debug_info], lists:foreach(fun(PtFile) -> {ok, _Mod} = compile:file(path(Dir, PtFile), CompileOpts) end, PtFiles). diff --git a/sync-apps.sh b/sync-apps.sh index 1b4b8fcc2..e5c36228f 100755 --- a/sync-apps.sh +++ b/sync-apps.sh @@ -15,17 +15,17 @@ apps=( "emqx_auth_redis" "emqx_bridge_mqtt" "emqx_coap" -"emqx_dashboard" +# "emqx_dashboard" # moved to lib-opensource "emqx_exhook" "emqx_exproto" "emqx_lua_hook" "emqx_lwm2m" -"emqx_management" +# "emqx_management" # moved to lib-opensource "emqx_prometheus" "emqx_psk_file" "emqx_recon" "emqx_retainer" -"emqx_rule_engine" +# "emqx_rule_engine" # moved to lib-opensource "emqx_sasl" "emqx_sn" "emqx_stomp"