Skip to content

Commit

Permalink
Add exrm plugin to link vm.args file
Browse files Browse the repository at this point in the history
if env `LINK_VM_ARGS=/path/to/vm.args` is configured.
  • Loading branch information
bharendt committed May 29, 2015
1 parent 9ae2dfd commit e46c97c
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions lib/exrm/plugins/link_vm_args.ex
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
defmodule ReleaseManager.Plugin.LinkVMARgs do
use ReleaseManager.Plugin
alias ReleaseManager.Utils


def before_release(_), do: nil

def after_release(%Config{env: :prod, version: version, name: name}) do
case System.get_env "LINK_VM_ARGS" do
vm_args_link_destination = <<_,_::binary>> ->
debug "Linking vm.args file"
vmargs_path = Utils.rel_dest_path(Path.join([name, "releases", version, "vm.args"]))
if vmargs_path |> File.exists?, do: vmargs_path |> File.rm
File.ln_s(vm_args_link_destination, vmargs_path)
_ -> nil
end
end
def after_release(_), do: nil

def after_cleanup(_), do: nil
end

0 comments on commit e46c97c

Please sign in to comment.