Skip to content

Setting environment variables (for :start task, maybe :compile)? #213

@pmeinhardt

Description

@pmeinhardt

Hi, I hope you don’t mind me bothering you 🙂 Thanks a lot for your quick replies!
I was wondering what your strategy for environment variables with bootleg is.

More specifically: I would like to pass a PORT environment variable when starting an app. For now what I did is to override the :start task in the environment – obviously a hack:

# config/deploy/production.exs

use Bootleg.Config

# …

task :start do
  remote :app do
    "PORT=20673 bin/#{Bootleg.Config.app} start"
  end
  Bootleg.UI.info "#{Bootleg.Config.app} started"
  :ok
end

Unfortunately I don't have any control over what environment the system sets by default.

I bet there's a better way, maybe you can help me out?

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions