Incerteza
Incerteza

Reputation: 34934

Edeliver and systemd for Phoenix/Elixir applications

Here's how I'm deploying my Phoenix/Elixir application on a server:

mix edeliver stop production --verbose
mix edeliver build release --verbose
mix edeliver deploy release to production --verbose
mix edeliver start production --verbose

It works as long as it's being run this way.

I've created a systemd unit for my website. I've checked it -- it's working fine, start and stop. Then I've deployed my website, the service which was running, isn't running anymore, it's in the failure state, where the website itself is running -- that's not how it should be.

How can I incorporate my systemd unit-service into these 4 commands above for deploy? That is, edeliver should run and stop the service for my website via systemd by "sudo systemctl start|stop my_website" somehow. Or is there other way?

Upvotes: 1

Views: 775

Answers (1)

Aleksei Matiushkin
Aleksei Matiushkin

Reputation: 121010

edeliver uses the upstart scripts hardcoded. That said, it simple executes sudo stop blah on remote.

There probably are better and more robust solutions, but I personally overcame this by setting aliases for my deploy user on remote:

alias start='systemctl enable'
alias stop='systemctl disable'

Upvotes: 2

Related Questions