Skip to content

Instantly share code, notes, and snippets.

@yeongsheng-tan
Last active May 23, 2017 23:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yeongsheng-tan/36a89e4c6cf95c57f6387a4182122a88 to your computer and use it in GitHub Desktop.
Save yeongsheng-tan/36a89e4c6cf95c57f6387a4182122a88 to your computer and use it in GitHub Desktop.
Distillery release migration commands
# distillery rel/config.exs sample content for linking up migration tasks
Path.join(["rel", "plugins", "*.exs"])
|> Path.wildcard()
|> Enum.map(&Code.eval_file(&1))
use Mix.Releases.Config,
# This sets the default release built by `mix release`
default_release: :my_app,
# This sets the default environment used by `mix release`
default_environment: Mix.env()
environment :prod do
set include_erts: true
set include_src: false
set cookie: :"<G,>[;G>bCk]9{YJA4ydOT8aarJBIi;F:oh:$<>~(DG7S03b3EzVr)~b`,%aV@<zi@"
set vm_args: "rel/vm.args"
end
release :my_app do
set version: current_version(:my_app)
set applications: [
my_app: :permanent
]
set commands: [
# Develop and have your my_db_migrate_script.sh script located in my_app/priv/commands/my_db_migrate_script.sh
"ecto.migrate": Path.join([:code.priv_dir(:my_app), "commands", "my_db_migrate_script.sh"])
]
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment