Merge pull request #8188 from zmstone/0612-build-exclude-sub-build-dirs

build: ignore _build sub-dir in release dir
This commit is contained in:
Zaiming (Stone) Shi 2022-06-13 15:53:02 +01:00 committed by GitHub
commit 83e9876e68
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 6 deletions

View File

@ -1,6 +1,6 @@
{application, emqx_management,
[{description, "EMQ X Management API and CLI"},
{vsn, "4.3.13"}, % strict semver, bump manually!
{vsn, "4.3.14"}, % strict semver, bump manually!
{modules, []},
{registered, [emqx_management_sup]},
{applications, [kernel,stdlib,minirest]},

View File

@ -1,13 +1,13 @@
%% -*- mode: erlang -*-
{VSN,
[ {<<"4\\.3\\.([0-9]|1[0-4])">>,
[ {<<"4\\.3\\.[0-9]+">>,
[ {apply,{minirest,stop_http,['http:management']}},
{apply,{minirest,stop_http,['https:management']}},
{restart_application, emqx_management}
]},
{<<".*">>, []}
],
[ {<<"4\\.3\\.([0-9]|1[0-4])">>,
[ {<<"4\\.3\\.[0-9]+">>,
[ {apply,{minirest,stop_http,['http:management']}},
{apply,{minirest,stop_http,['https:management']}},
{restart_application, emqx_management}

View File

@ -55,7 +55,10 @@ app_specific_actions(_) ->
[].
ignored_apps() ->
[gpb, emqx_dashboard, emqx_management] ++ otp_standard_apps().
[gpb, %% only a build tool
emqx_dashboard, %% generic appup file for all versions
emqx_management %% generic appup file for all versions
] ++ otp_standard_apps().
main(Args) ->
#{prev_tag := Baseline} = Options = parse_args(Args, default_options()),
@ -530,8 +533,10 @@ contains_contents(File, Upgrade, Downgrade) ->
index_apps(ReleaseDir) ->
log("INFO: indexing apps in ~s~n", [ReleaseDir]),
Apps0 = maps:from_list([index_app(filename:join(ReleaseDir, AppFile)) ||
AppFile <- filelib:wildcard("**/ebin/*.app", ReleaseDir)]),
AppFiles0 = filelib:wildcard("**/ebin/*.app", ReleaseDir),
%% everything in _build sub-dir e.g. cuttlefish/_build should be ignored
AppFiles = lists:filter(fun(File) -> re:run(File, "_build") =:= nomatch end, AppFiles0),
Apps0 = maps:from_list([index_app(filename:join(ReleaseDir, AppFile)) || AppFile <- AppFiles]),
maps:without(ignored_apps(), Apps0).
index_app(AppFile) ->