Skip to content

Instantly share code, notes, and snippets.

@marinakr
Forked from emilsoman/phoenix_to_umbrella
Last active January 25, 2019 21:11
Show Gist options
  • Select an option

  • Save marinakr/aa03ccde81a949341e0907a45c8b14c8 to your computer and use it in GitHub Desktop.

Select an option

Save marinakr/aa03ccde81a949341e0907a45c8b14c8 to your computer and use it in GitHub Desktop.

Revisions

  1. marinakr revised this gist Jan 25, 2019. 1 changed file with 8 additions and 5 deletions.
    13 changes: 8 additions & 5 deletions phoenix_to_umbrella
    Original file line number Diff line number Diff line change
    @@ -38,13 +38,16 @@ chrismccord [10:16 PM]
    deps: deps]
    end
    ```
    Not: distillery, coveralls, credo should be in root mix.exs

    5) Move /rel to root
    5) rel to root:
    if distillery is not updated, just move it
    if distillery updated, run mix release.init and does rel file should be updated

    5) Move coverall.json to root
    6) Move coverall.json to root
    ```apps/my_app/coverall.json .```

    5) Move .credo to root
    7) Move .credo to root
    mv apps/my_app/config/.credo.exs config/
    Update to umbrella:
    ```
    @@ -70,10 +73,10 @@ Update to umbrella:


    [10:16]
    5) shipit
    8) shipit

    [10:17]
    6) if using brunch/node, update package.json paths that reference phoenix
    9) if using brunch/node, update package.json paths that reference phoenix

    [10:18]
    @david.antaramian @alanpeabody ah yes, you should be able to do it similarly but within the existing repo
  2. marinakr revised this gist Jan 25, 2019. 1 changed file with 30 additions and 0 deletions.
    30 changes: 30 additions & 0 deletions phoenix_to_umbrella
    Original file line number Diff line number Diff line change
    @@ -39,6 +39,36 @@ chrismccord [10:16 PM]
    end
    ```

    5) Move /rel to root

    5) Move coverall.json to root
    ```apps/my_app/coverall.json .```

    5) Move .credo to root
    mv apps/my_app/config/.credo.exs config/
    Update to umbrella:
    ```
    %{
    configs: [
    %{
    color: true,
    name: "default",
    files: %{
    included: ["apps/*/lib/*"],
    excluded: ["apps/*/lib/tasks/tasks.ex"]
    },
    checks: [
    {Credo.Check.Design.TagTODO, exit_status: 0},
    {Credo.Check.Readability.MaxLineLength, priority: :low, max_length: 120},
    {Credo.Check.Readability.Specs, false},
    {Credo.Check.Design.AliasUsage, if_nested_deeper_than: 2}
    ]
    }
    ]
    }
    ```


    [10:16]
    5) shipit

  3. @emilsoman emilsoman revised this gist Sep 3, 2016. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions phoenix_to_umbrella
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,5 @@
    How to convert existing phoenix app to an umbrella app.
    https://elixir-lang.slack.com/archives/phoenix/p1472921051000134


    chrismccord [10:14 PM]
  4. @emilsoman emilsoman created this gist Sep 3, 2016.
    48 changes: 48 additions & 0 deletions phoenix_to_umbrella
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,48 @@
    How to convert existing phoenix app to an umbrella app.


    chrismccord [10:14 PM]
    @alanpeabody yes, it's straightforward

    [10:14]
    1) mix new my_umbrella --umbrella

    [10:14]
    2) cd my_umbrella/apps

    [10:15]
    3) mv ~/path/to/phoenix_app ./

    [10:16]
    4) Update the paths in your phoenix project's mix.exs to match:

    david.antaramian [10:16 PM]
    He described his problem more in #general which is that he wants to keep his existing git history. Though, that should really just involve inverting what you suggested

    chrismccord [10:16 PM]
    ```
    def project do
    [app: :my_app,
    version: "0.0.1",
    build_path: "../../_build",
    config_path: "../../config/config.exs",
    deps_path: "../../deps",
    lockfile: "../../mix.lock",
    elixir: "~> 1.2",
    elixirc_paths: elixirc_paths(Mix.env),
    compilers: [:phoenix, :gettext] ++ Mix.compilers,
    build_embedded: Mix.env == :prod,
    start_permanent: Mix.env == :prod,
    aliases: aliases,
    deps: deps]
    end
    ```

    [10:16]
    5) shipit

    [10:17]
    6) if using brunch/node, update package.json paths that reference phoenix

    [10:18]
    @david.antaramian @alanpeabody ah yes, you should be able to do it similarly but within the existing repo