Skip to content

Commit

Permalink
renaming 'prod' target into 'demo'
Browse files Browse the repository at this point in the history
'prod' is a default name for target so renaming it into 'demo', so test scenarios won't be included in a release when amoc is used as a dependecy
  • Loading branch information
DenysGonchar committed Jul 17, 2021
1 parent 5afcf6d commit bbe7d7c
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ MAINTAINER Erlang Solutions <mongoose-im@erlang-solutions.com>

RUN useradd -ms /bin/bash amoc

COPY --from=amoc-build /amoc_build/_build/prod/rel/amoc/ /home/amoc/amoc/
COPY --from=amoc-build /amoc_build/_build/demo/rel/amoc/ /home/amoc/amoc/
# It seems hub.docker.com does not support --chown param to COPY directive
RUN chown -R amoc:amoc /home/amoc/amoc

Expand Down
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ endif
all: rel

rel: rebar3
./rebar3 as prod tar
./rebar3 as demo tar

compile:
$(REBAR) as prod compile
$(REBAR) as demo compile

clean:
$(REBAR) clean
Expand Down Expand Up @@ -45,10 +45,10 @@ rebar3:
chmod u+x rebar3

dialyzer:
$(REBAR) as prod dialyzer
$(REBAR) as demo dialyzer

xref:
$(REBAR) as prod xref
$(REBAR) as demo xref

console:
@echo "tests can be executed manually using ct:run/1 function:\n" \
Expand Down
2 changes: 1 addition & 1 deletion doc/local-run.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Everything you need to do is to create the release. To achieve that run:
`make rel`. Now you are ready to test our scenario locally with one Amoc node;
to start the node run `_build/prod/rel/amoc/bin/amoc console`.
to start the node run `_build/demo/rel/amoc/bin/amoc console`.

Start `my_scenario` spawning 10 amoc users with IDs from range (1,10) inclusive.
```erlang
Expand Down
7 changes: 5 additions & 2 deletions rebar.config
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,14 @@
]}
]},
{elvis, [{plugins, [{rebar3_lint, "0.1.11"}]}]},
{prod, [
{erl_opts, [{src_dirs, ["src", "scenarios"]}]},
{demo, [
{erl_opts, [debug_info, {src_dirs, ["src", "scenarios"]}]},
{relx, [
{release, {amoc, git}, [amoc, runtime_tools]},
{debug_info, keep},
{include_src, true},
{include_erts, true},
{dev_mode, false},
{extended_start_script, true},
{sys_config, "rel/app.config"}
]}]}
Expand Down

0 comments on commit bbe7d7c

Please sign in to comment.