Giter Club home page Giter Club logo

windows-distillery-custom-commands's Introduction

Sample Project for a working Windows-Elixir-Distillery-Custom-Commands-Configuration.

Created and tested with following System configuration

  • Windows 10 Pro x64
  • Elixir 1.7.4
  • Erlang/OTP 21 (compiled w/ 19)
  • Phoenix 1.4
  • Ecto 3.0.3
  • Distillery 2.0.12
  • PostgreSQL 10

Test-Workflow:

  1. Set Environment-Variables in your OS:

execute "set-system-vars.bat"

  1. Load dependencies:

mix deps.get --only prod

  1. Build a release:

set "MIX_ENV=prod" && mix release --env=prod

  1. Then you can execute one of the custom commands:

init (db create, migrate, seed):

set "COOKIE=MY_PROD_SECRET" && .\_build\prod\rel\phoenix_distillery\bin\phoenix_distillery.bat init

create (db create):

set "COOKIE=MY_PROD_SECRET" && .\_build\prod\rel\phoenix_distillery\bin\phoenix_distillery.bat init

drop (db drop):

set "COOKIE=MY_PROD_SECRET" && .\_build\prod\rel\phoenix_distillery\bin\phoenix_distillery.bat drop

migrate (db migrate):

set "COOKIE=MY_PROD_SECRET" && .\_build\prod\rel\phoenix_distillery\bin\phoenix_distillery.bat migrate

seed (db seed):

set "COOKIE=MY_PROD_SECRET" && .\_build\prod\rel\phoenix_distillery\bin\phoenix_distillery.bat seed

reset (db reset):

set "COOKIE=MY_PROD_SECRET" && .\_build\prod\rel\phoenix_distillery\bin\phoenix_distillery.bat reset

Keyfacts for a working configuration:

1. In the "ReleaseTasks-Module" you need to change ":ecto" to ":ecto_sql" in your constant "@start_apps"
2. In generel, configuration in config-Files doesnt work for me! (Problem: the program cant find the DB-Connection-Fields like ":database" for example! But! When you use init callback of repo it works (and.. Of course it also with with dynamic loading -> System.get(..))
3. In the "ReleaseTasks-Module: The repo Migrator needs more then "pool_size: 1" to perform tasks parallel (at least 2). So set it to 2: "repo.start_link(pool_size: 2)"

PS

Thanks to user "StoatPower" for his inspiring Elixirform Post:

windows-distillery-custom-commands's People

Contributors

lbormann avatar

Stargazers

Mariusz Baleczny avatar Matthew Caldwell avatar

Watchers

Matthew Caldwell avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.