feat: remove emqx_release_helper
This commit is contained in:
parent
188f44ad50
commit
c14319e5bd
|
@ -1,4 +0,0 @@
|
||||||
# Used by "mix format"
|
|
||||||
[
|
|
||||||
inputs: ["{mix,.formatter}.exs", "{config,lib,test}/**/*.{ex,exs}"]
|
|
||||||
]
|
|
|
@ -1,26 +0,0 @@
|
||||||
# The directory Mix will write compiled artifacts to.
|
|
||||||
/_build/
|
|
||||||
|
|
||||||
# If you run "mix test --cover", coverage assets end up here.
|
|
||||||
/cover/
|
|
||||||
|
|
||||||
# The directory Mix downloads your dependencies sources to.
|
|
||||||
/deps/
|
|
||||||
|
|
||||||
# Where third-party dependencies like ExDoc output generated docs.
|
|
||||||
/doc/
|
|
||||||
|
|
||||||
# Ignore .fetch files in case you like to edit your project deps locally.
|
|
||||||
/.fetch
|
|
||||||
|
|
||||||
# If the VM crashes, it generates a dump, let's ignore it too.
|
|
||||||
erl_crash.dump
|
|
||||||
|
|
||||||
# Also ignore archive artifacts (built via "mix archive.build").
|
|
||||||
*.ez
|
|
||||||
|
|
||||||
# Ignore package tarball (built via "mix hex.build").
|
|
||||||
emqx_config_helper-*.tar
|
|
||||||
|
|
||||||
# Temporary files, for example, from tests.
|
|
||||||
/tmp/
|
|
|
@ -1,21 +0,0 @@
|
||||||
# EmqxConfigHelper
|
|
||||||
|
|
||||||
**TODO: Add description**
|
|
||||||
|
|
||||||
## Installation
|
|
||||||
|
|
||||||
If [available in Hex](https://hex.pm/docs/publish), the package can be installed
|
|
||||||
by adding `emqx_config_helper` to your list of dependencies in `mix.exs`:
|
|
||||||
|
|
||||||
```elixir
|
|
||||||
def deps do
|
|
||||||
[
|
|
||||||
{:emqx_config_helper, "~> 0.1.0"}
|
|
||||||
]
|
|
||||||
end
|
|
||||||
```
|
|
||||||
|
|
||||||
Documentation can be generated with [ExDoc](https://github.com/elixir-lang/ex_doc)
|
|
||||||
and published on [HexDocs](https://hexdocs.pm). Once published, the docs can
|
|
||||||
be found at [https://hexdocs.pm/emqx_config_helper](https://hexdocs.pm/emqx_config_helper).
|
|
||||||
|
|
|
@ -1,9 +0,0 @@
|
||||||
defmodule EmqxConfigHelper do
|
|
||||||
def hocon_cli(arg) do
|
|
||||||
arg
|
|
||||||
|> String.split()
|
|
||||||
|> Enum.map(&to_charlist/1)
|
|
||||||
|> :hocon_cli.main()
|
|
||||||
:ok
|
|
||||||
end
|
|
||||||
end
|
|
|
@ -1,34 +0,0 @@
|
||||||
defmodule EmqxConfigHelper.Hocon do
|
|
||||||
def hocon(_application, options) do
|
|
||||||
{:ok, config} =
|
|
||||||
options
|
|
||||||
|> Keyword.fetch!(:config_file)
|
|
||||||
|> List.wrap()
|
|
||||||
|> Enum.map(&to_charlist/1)
|
|
||||||
|> :hocon.files(%{format: :richmap})
|
|
||||||
|
|
||||||
options
|
|
||||||
|> Keyword.fetch!(:schema_module)
|
|
||||||
|> :hocon_schema.generate(config, %{atom_key: true, return_plain: true})
|
|
||||||
|> Enum.each(fn {application, envs} ->
|
|
||||||
Config.config(application, Enum.to_list(envs))
|
|
||||||
end)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
defmodule EmqxConfigHelper.Cuttlefish do
|
|
||||||
def cuttlefish(application, options) do
|
|
||||||
config =
|
|
||||||
options
|
|
||||||
|> Keyword.fetch!(:config_file)
|
|
||||||
|> :cuttlefish_conf.file()
|
|
||||||
|
|
||||||
application
|
|
||||||
|> :code.priv_dir()
|
|
||||||
|> Path.join("#{application}.schema")
|
|
||||||
|> List.wrap()
|
|
||||||
|> :cuttlefish_schema.files()
|
|
||||||
|> :cuttlefish_generator.map(config)
|
|
||||||
|> Enum.each(fn {application, envs} -> Config.config(application, envs) end)
|
|
||||||
end
|
|
||||||
end
|
|
|
@ -1,30 +0,0 @@
|
||||||
defmodule EmqxConfigHelper.MixProject do
|
|
||||||
use Mix.Project
|
|
||||||
|
|
||||||
def project do
|
|
||||||
[
|
|
||||||
app: :emqx_config_helper,
|
|
||||||
version: "0.1.0",
|
|
||||||
build_path: "../../_build",
|
|
||||||
config_path: "../../config/config.exs",
|
|
||||||
deps_path: "../../deps",
|
|
||||||
lockfile: "../../mix.lock",
|
|
||||||
elixir: "~> 1.12",
|
|
||||||
start_permanent: Mix.env() == :prod,
|
|
||||||
deps: deps()
|
|
||||||
]
|
|
||||||
end
|
|
||||||
|
|
||||||
def application do
|
|
||||||
[
|
|
||||||
extra_applications: [:logger]
|
|
||||||
]
|
|
||||||
end
|
|
||||||
|
|
||||||
defp deps do
|
|
||||||
[
|
|
||||||
{:cuttlefish, github: "emqx/cuttlefish", tag: "v4.0.1"},
|
|
||||||
{:hocon, github: "emqx/hocon"}
|
|
||||||
]
|
|
||||||
end
|
|
||||||
end
|
|
|
@ -1,8 +0,0 @@
|
||||||
defmodule EmqxConfigHelperTest do
|
|
||||||
use ExUnit.Case
|
|
||||||
doctest EmqxConfigHelper
|
|
||||||
|
|
||||||
test "greets the world" do
|
|
||||||
assert EmqxConfigHelper.hello() == :world
|
|
||||||
end
|
|
||||||
end
|
|
|
@ -1 +0,0 @@
|
||||||
ExUnit.start()
|
|
|
@ -100,10 +100,6 @@ defmodule EmqxReleaseHelper.Applications do
|
||||||
overlay :application
|
overlay :application
|
||||||
end
|
end
|
||||||
|
|
||||||
application :emqx_config_helper do
|
|
||||||
start_type :load
|
|
||||||
end
|
|
||||||
|
|
||||||
application :emqx_prometheus, %{release_type: :cloud} do
|
application :emqx_prometheus, %{release_type: :cloud} do
|
||||||
start_type :permanent
|
start_type :permanent
|
||||||
overlay :application
|
overlay :application
|
||||||
|
|
|
@ -4,7 +4,6 @@ defmodule EmqxReleaseHelper.Overlay do
|
||||||
overlay %{release_version: release_version} do
|
overlay %{release_version: release_version} do
|
||||||
mkdir "log"
|
mkdir "log"
|
||||||
mkdir "etc"
|
mkdir "etc"
|
||||||
mkdir "etc/plugins"
|
|
||||||
mkdir "data"
|
mkdir "data"
|
||||||
mkdir "data/mnesia"
|
mkdir "data/mnesia"
|
||||||
mkdir "data/configs"
|
mkdir "data/configs"
|
||||||
|
@ -14,22 +13,10 @@ defmodule EmqxReleaseHelper.Overlay do
|
||||||
copy "bin/install_upgrade.escript", "bin/install_upgrade.escript"
|
copy "bin/install_upgrade.escript", "bin/install_upgrade.escript"
|
||||||
|
|
||||||
copy "bin/node_dump", "bin/node_dump"
|
copy "bin/node_dump", "bin/node_dump"
|
||||||
# copy "bin/nodetool", "bin/nodetool"
|
copy "bin/emqx_ctl", "bin/emqx_ctl"
|
||||||
# copy "bin/nodetool", "bin/nodetool-#{release_version}"
|
|
||||||
|
|
||||||
# copy "bin/emqx", "bin/emqx"
|
|
||||||
# copy "bin/emqx_ctl", "bin/emqx_ctl"
|
|
||||||
|
|
||||||
# for relup
|
|
||||||
copy "bin/emqx", "bin/emqx-#{release_version}"
|
|
||||||
copy "bin/emqx_ctl", "bin/emqx_ctl-#{release_version}"
|
|
||||||
|
|
||||||
copy "bin/install_upgrade.escript", "bin/install_upgrade.escript-#{release_version}"
|
|
||||||
|
|
||||||
template "data/emqx_vars", "releases/emqx_vars"
|
template "data/emqx_vars", "releases/emqx_vars"
|
||||||
template "data/BUILT_ON", "releases/#{release_version}/BUILT_ON"
|
template "data/BUILT_ON", "releases/#{release_version}/BUILT_ON"
|
||||||
# template "bin/emqx.cmd", "bin/emqx.cmd"
|
|
||||||
# template "bin/emqx_ctl.cmd", "bin/emqx_ctl.cmd"
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def run(release, config) do
|
def run(release, config) do
|
||||||
|
|
Loading…
Reference in New Issue