Merge pull request #4300 from zmstone/chore-makefile-clean-target
Chore makefile clean target
This commit is contained in:
commit
72f5468001
|
@ -40,9 +40,11 @@ jobs:
|
||||||
- name: run eunit
|
- name: run eunit
|
||||||
run: |
|
run: |
|
||||||
docker exec -i erlang bash -c "make eunit"
|
docker exec -i erlang bash -c "make eunit"
|
||||||
docker exec --env EMQX_EXTRA_PLUGINS=all -i erlang bash -c "./rebar3 eunit --dir lib-extra/*"
|
docker exec --env EMQX_EXTRA_PLUGINS=all -i erlang bash -c "./rebar3 eunit --dir $(find lib-extra/ -mindepth 1 -maxdepth 2 -type l | tr '\n' ',')"
|
||||||
- name: run common test
|
- name: run common test
|
||||||
run: docker exec -i erlang bash -c "make ct"
|
run: |
|
||||||
|
docker exec -i erlang bash -c "make ct"
|
||||||
|
docker exec --env EMQX_EXTRA_PLUGINS=all -i erlang bash -c "./rebar3 ct --dir $(find lib-extra/ -mindepth 1 -maxdepth 2 -type l | tr '\n' ',')"
|
||||||
- name: run cover
|
- name: run cover
|
||||||
run: |
|
run: |
|
||||||
docker exec -i erlang bash -c "make cover"
|
docker exec -i erlang bash -c "make cover"
|
||||||
|
|
20
Makefile
20
Makefile
|
@ -10,7 +10,7 @@ export EMQX_CE_DASHBOARD_VERSION ?= v4.3.0-beta.1
|
||||||
PROFILE ?= emqx
|
PROFILE ?= emqx
|
||||||
REL_PROFILES := emqx emqx-edge
|
REL_PROFILES := emqx emqx-edge
|
||||||
PKG_PROFILES := emqx-pkg emqx-edge-pkg
|
PKG_PROFILES := emqx-pkg emqx-edge-pkg
|
||||||
PROFILES := $(REL_PROFILES) $(PKG_PROFILES)
|
PROFILES := $(REL_PROFILES) $(PKG_PROFILES) default
|
||||||
|
|
||||||
export REBAR_GIT_CLONE_OPTIONS += --depth=1
|
export REBAR_GIT_CLONE_OPTIONS += --depth=1
|
||||||
|
|
||||||
|
@ -60,12 +60,22 @@ else
|
||||||
endif
|
endif
|
||||||
@$(REBAR) as $(@) release
|
@$(REBAR) as $(@) release
|
||||||
|
|
||||||
# rebar clean
|
## Not calling rebar3 clean because
|
||||||
|
## 1. rebar3 clean relies on rebar3, meaning it reads config, fetches dependencies etc.
|
||||||
|
## 2. it's slow
|
||||||
|
## NOTE: this does not force rebar3 to fetch new version dependencies
|
||||||
|
## make clean-all to delete all fetched dependencies for a fresh start-over
|
||||||
.PHONY: clean $(PROFILES:%=clean-%)
|
.PHONY: clean $(PROFILES:%=clean-%)
|
||||||
clean: $(PROFILES:%=clean-%)
|
clean: $(PROFILES:%=clean-%)
|
||||||
$(PROFILES:%=clean-%): $(REBAR)
|
$(PROFILES:%=clean-%):
|
||||||
@$(REBAR) as $(@:clean-%=%) clean
|
@if [ -d _build/$(@:clean-%=%) ]; then \
|
||||||
@rm -rf apps/emqx_dashboard/priv/www
|
rm -rf _build/$(@:clean-%=%)/rel; \
|
||||||
|
find _build/$(@:clean-%=%) -name '*.beam' -o -name '*.so' -o -name '*.app' -o -name '*.appup' -o -name '*.o' -o -name '*.d' -type f | xargs rm -f; \
|
||||||
|
fi
|
||||||
|
|
||||||
|
.PHONY: clean-all
|
||||||
|
clean-all:
|
||||||
|
@rm -rf _build
|
||||||
|
|
||||||
.PHONY: deps-all
|
.PHONY: deps-all
|
||||||
deps-all: $(REBAR) $(PROFILES:%=deps-%)
|
deps-all: $(REBAR) $(PROFILES:%=deps-%)
|
||||||
|
|
|
@ -0,0 +1,50 @@
|
||||||
|
# EMQ X Extra plugin apps
|
||||||
|
|
||||||
|
This directory keeps a `plugins` file which defines all the approved
|
||||||
|
external plugins from open-source community.
|
||||||
|
|
||||||
|
The (maybe broken) symlinks are keept to help testing plugins
|
||||||
|
in this umbrella project.
|
||||||
|
|
||||||
|
## How to build `plugin_foo`
|
||||||
|
|
||||||
|
Add `plugin_foo` as a rebar3 dependency in `plugins` file.
|
||||||
|
|
||||||
|
e.g.
|
||||||
|
|
||||||
|
```
|
||||||
|
{erlang_plugins,
|
||||||
|
[ {plugin_foo, {git, "https://github.com/bar/plugin-foo.git", {tag, "0.1.0"}}}
|
||||||
|
]
|
||||||
|
}.
|
||||||
|
```
|
||||||
|
|
||||||
|
Exeucte command
|
||||||
|
|
||||||
|
```
|
||||||
|
export EMQX_EXTRA_PLUGINS='plugin_foo'
|
||||||
|
make
|
||||||
|
```
|
||||||
|
|
||||||
|
The plugin source code should downloaded to `_build/default/lib/plugin_foo`
|
||||||
|
|
||||||
|
NOTE: Shallow clone with depth=1 is used for git dependencies.
|
||||||
|
|
||||||
|
## How to test `plugin_foo`
|
||||||
|
|
||||||
|
If the source code in `_build` is already symlinked from `lib-extra/`,
|
||||||
|
you may directlly run tests with commands below.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
./rebar3 eunit --dir lib-extra/plugin_foo
|
||||||
|
./rebar3 ct --dir lib-extra/plugin_foo
|
||||||
|
```
|
||||||
|
|
||||||
|
In case the plugin is being actively developed
|
||||||
|
it can be cloned to `lib-extra`, e.g. `lib-extra/plugin-bar-dev`
|
||||||
|
then it can be tested with commands below:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
./rebar3 eunit --dir lib-extra/plugin-bar-dev
|
||||||
|
./rebar3 ct --dir lib-extra/plugin-bar-dev
|
||||||
|
```
|
|
@ -1,5 +1,4 @@
|
||||||
{erlang_plugins,
|
{erlang_plugins,
|
||||||
[
|
[ {emqx_plugin_template, {git, "https://github.com/emqx/emqx-plugin-template", {branch, "master"}}}
|
||||||
{emqx_plugin_template, {git, "https://github.com/emqx/emqx-plugin-template", {branch, "master"}}}
|
|
||||||
]
|
]
|
||||||
}.
|
}.
|
||||||
|
|
Loading…
Reference in New Issue