Commit Graph

101 Commits

Author SHA1 Message Date
Thales Macedo Garitezi b9494662ae
fix(ci): fix shellcheck file pattern
Since we started to use the portable shebang style for our scripts, we
need to update the pattern used to find scripts for Shellcheck to
check.
2022-01-05 11:34:04 -03:00
Zaiming (Stone) Shi 5df382f054
Merge pull request #6598 from zmstone/ci-port-changes-from-4.4
[5.0] CI port changes from 4.4
2022-01-04 18:52:25 +01:00
Zaiming (Stone) Shi 320506957c refactor(bin/emqx): wait for up to 120 seconds by default 2022-01-04 17:28:53 +01:00
Thales Macedo Garitezi 93cdf318c7
fix(ci): setup mix before running check 2022-01-04 13:28:03 -03:00
Thales Macedo Garitezi d78e9429f3
ci(mix): rm mix.lock from repo
While Mix is not the main build tool, we remove the commited
`mix.lock` file to reduce friction when updating dependencies, since
it requires remembering to run `mix deps.get` to update the
`mix.lock`, used by a CI check in
`scripts/check-elixir-deps-discrepancies.exs`.  We change said script
to produce the required file on the fly.
2022-01-04 12:10:58 -03:00
Thales Macedo Garitezi 1d71256305
chore(deps): update mix.lock (mongodb) 2022-01-03 10:02:59 -03:00
Thales Macedo Garitezi c29bc126ef
Merge pull request #6507 from emqx/build-with-mix-mkII
Build with Elixir Mix Release
2021-12-30 15:00:38 -03:00
Thales Macedo Garitezi fe444bf134
chore(shellcheck): use `git grep` to search only tracked files 2021-12-28 16:49:24 -03:00
Thales Macedo Garitezi 0020cf592f
Merge remote-tracking branch 'origin/master' into build-with-mix-mkII 2021-12-28 11:28:40 -03:00
Thales Macedo Garitezi 8342b3711d
chore(update_appup): Improve `update_appup.escript` (5.0)
Port of #6480 .

* Make the script regex-aware

This change makes the `update_appup.escript` check whether the new
version of an application (the _current_ one) is already contained in
entries in the _new_ .appup file for that application if such .appup
file contains regexes.

* Do not use `load_module` instructions if `restart_application` is present

Since the appup instruction `restart_application` already loads all
modules of a given application, there is no need to introduce those
instructions if a restart is already present.

* Do not force `.appup.src` render if contents are the same

To avoid losing comments and/or manual indentation in appup files that
are already up to date, we now check whether the contents have the
exact same terms as those we are about to write to an existint .appup
file.

* Insert `load_module`s after `application:stop`, if present

If there is already any `application:stop(Application)` call in the
appup instructions, we prefer to add `load_module` instructions after
it, so we can be sure that the load is replaced safely.

* Add expected versions check

For apps inside emqx umbrella, we try to bump only the patch part of
their version numbers, and use only 3-part version
numbers (`Major.Minor.Patch`).  With those assumptions, we may infer
all versions that need to be covered in a given upgrade, and check if
those are covered in regexes.
2021-12-28 10:06:42 -03:00
Thales Macedo Garitezi a54e108296
ci(mix): add application mode check
This adds a CI check to ensure that applications and their modes are
in sync between Elixir and Rebar release builds.
2021-12-27 13:09:55 -03:00
Zaiming (Stone) Shi 68eb13d478 fix: portable shebang 2021-12-27 15:45:12 +01:00
Thales Macedo Garitezi c14e8db869
style(format): format elixir files 2021-12-27 10:51:12 -03:00
Thales Macedo Garitezi cc652c3343
ci(mix): add elixir deps check
Checks whether there are discrepancies between rebar3 and mix deps.
2021-12-24 14:44:49 -03:00
Thales Macedo Garitezi 014b6d3cfd
chore(shellcheck): fix shellcheck linting warnings 2021-12-22 15:43:43 -03:00
Zaiming (Stone) Shi 4d9b4cb828 refactor: delete lib-extra
plugin development and deploy will different from 4.3
2021-12-16 12:48:13 +01:00
firest 8493b61cb5 refactor(eqmx_limiter): use the new hierarchical token bucket to replace the old ratelimit code 2021-12-10 14:37:23 +08:00
Thales Macedo Garitezi 540e5dbc0b
Merge pull request #6344 from emqx/update-appup-ext-deps-diff-50
chore(appup): make update_appup.escript output only differences for external dependencies [5.0]

Same as #6307 .

Currently, the update_appup.escript outputs as an error the full appup
file for external dependencies, even if all the changes are already
contained in the depency. Here, we make it only output the missing
actions to be inserted, to aid in seeing what are the differences.
2021-12-09 09:15:25 -03:00
JimMoen 257ee19be5 chore(dashboard): change dashboard repo and version 2021-12-09 11:31:31 +08:00
Thales Macedo Garitezi 2eb7a71e49
chore(appup): make update_appup.escript output only differences for
external dependencies [5.0]

Same as #6307 .

Currently, the update_appup.escript outputs as an error the full appup
file for external dependencies, even if all the changes are already
contained in the depency. Here, we make it only output the missing
actions to be inserted, to aid in seeing what are the differences.
2021-12-01 08:52:40 -03:00
Thales Macedo Garitezi 1a6b4d2d57
chore(appup): minor fixes to update_appup.escript (5.0)
- Fixes clause error on `create_stub/1`.
- Small optimization: do not download the same file multiple times
  with `wget`.
- Fix: remove old file extension (`.app.src`) and preserve dirname
  when creating stubs for apps.
2021-11-25 13:54:31 -03:00
Zaiming Shi a705bc1fc7 build: change package name scheme
`${PROFILE}-${PKG_VSN}-otp${OTP_VSN}-${SYSTEM}-${ARCH}.zip`
2021-11-20 20:44:48 +01:00
Zaiming Shi 25d6a98aa4 build: get otp version and export OTP_VSN 2021-11-20 20:44:48 +01:00
Zaiming Shi 6edd862dd5 refactor: no more EMQX_ENTERPRISE compile flag
The compile flag was introduced in EQM X 4.3 series
where CE and EE code was diverged large enough which made
non-practicle to determin edition at runtime.

such approach made testing quite challenging as we'll have to
build with different compile flags inorder to run per-edition
test cases

In this commit, we try to retrieve edition info from EMQX's
description text, (put to PT for fast access) at runtime
so we can test ALL editions from a super-set edition (EE).
2021-11-20 20:41:06 +01:00
k32 970e6bebde fix(update_appup): Sync version from 4.* branch 2021-11-18 12:33:48 +01:00
Zaiming Shi ce8e52f4d0 ci: fix job syntax 2021-11-04 18:32:03 +01:00
Zaiming Shi d1abb30818 ci: fix elvis check 2021-11-04 15:27:10 +01:00
Zaiming Shi dc58e4a441 ci: check code style
run elvis and nl-at-eof check
2021-11-04 14:47:05 +01:00
Zaiming Shi 6f3cfbc102 chore: add a script to find files without new line at EOF 2021-11-04 14:39:27 +01:00
Zaiming (Stone) Shi 4dbe3ccf71
refactor(dashboard): rename 'password' field to 'pwdhash' (#5990)
* refactor(dashboard): rename 'password' field to 'pwdhash'

rename as it is not plaintext password stored in db

* refactor(emqx_dashboard): rename records

* test(emqx_dashboard_token): add test case to cover match specs
2021-10-26 20:41:33 +08:00
zhongwencool d784e63b9f
emqx_conf (#5939)
* feat(emqx_conf): move conf manager for emqx_machine to emqx_conf

* chore(emqx_conf): change emqx:get_config/2 to emqx_conf:get/2

* fix: common test failed

* fix: badmatch by typo wrong key

* fix(emqx_conf): get the wrong core nodes

* fix(emqx_conf): get core node's tnx_id not latest tnx_id

* fix: add ro_transation when copy conf file

* fix: delete debug info

* fix: change ekka_rlog to mria_rlog

* fix: remove cluster_rpc from emqx_machine.

* fix: don't call ekka:start/0 explicitly

* fix: ekka should be start in emqx_machine
2021-10-21 18:08:51 +08:00
Zaiming Shi 010c70c200 chore: delete unused script 2021-09-28 20:40:46 +02:00
Shawn c0447d58b4 fix(config): configs in emqx_machine.conf was merged twice into emqx.conf 2021-08-20 19:04:52 +08:00
Zaiming Shi 522d8e0a4a refactor(config): split config and schema 2021-08-04 08:36:10 +02:00
Turtle 32534d2372 chore(dashboard): update get-dashboard script 2021-08-03 17:21:01 +08:00
JianBo He aa019b34ad test(exhook): refine tests 2021-08-03 14:06:58 +08:00
Zaiming Shi 00966d0114 chore(script): silent download rebar3 2021-07-30 10:40:14 +02:00
Turtle 569d54a4c0 feat(dashboard): Update the configuration file to hocon 2021-07-26 15:00:40 +08:00
Zaiming Shi 086b785cb0 chore: delete relup_deps injection
in v5, we will not rely on relup_deps to resolve app start
order after upgrade
2021-07-26 09:11:48 +08:00
zhanghongtong 9081a22b8c chore(deps): deps in rebar must not be use branch
Can use tags or commit ids in rebar deps

Signed-off-by: zhanghongtong <rory-z@outlook.com>
2021-07-12 18:28:47 +08:00
zhanghongtong e1a33c373c chore(CI): disable apps version check in unstable tags 2021-07-05 15:10:57 +08:00
Turtle 24292f4f4e chore: delete plugins related configuration 2021-07-02 18:12:06 +08:00
Turtle 918a26e921 feat(conf): merge all conf to emqx.conf 2021-07-02 17:01:16 +08:00
zhanghongtong c094e5ddcc chore(ct): cancel needless apps ct 2021-07-01 18:39:42 +08:00
Turtle 33036a1a91 chore(plugins): rm emqx-pks-file plugin 2021-06-28 15:57:19 +08:00
Zaiming Shi 9471f5ae07 fix(script): exclude non-edge apps in relup dependency 2021-06-28 11:42:55 +08:00
Zaiming Shi e4cb11fb43 chore: add more info in error message 2021-06-28 11:42:55 +08:00
Turtle 4b1bb91516 chore: fix inject deps notfound emqx_reloader 2021-06-28 11:42:55 +08:00
Zaiming Shi c7fe49c200 test(ci): add plugin list status check after relup new vsn install 2021-06-28 11:42:12 +08:00
Zaiming Shi 36685cc945 chore(relup): add relup dependency injection 2021-06-28 11:41:53 +08:00