与酿酒厂合作:如何设置`start`命令以使用systemctl

时间:2017-08-10 16:09:01

标签: elixir edeliver distillery

我正在使用edeliver备份的distillery将Elixir项目部署到远程项目。

我还成功创建了systemd.service文件,用于从命令行启动,停止,重启等等。

mix edeliver start production命令似乎通过普通的旧systemd shell命令绕过bin/my_app start运行发布。我想要的是始终使用systemd,即使是热门上传,因为它(与upstart不同)确实提供了reload功能。

我无法找到使用systemd来重新启动发布的内容和对象。应该是delivery策略吗?别的什么?我理解这个问题并不适合SO,但我只是迷失了。

所以:我可以强制edeliver超过distillery使用systemd开始发布吗?如果是,怎么样?

1 个答案:

答案 0 :(得分:1)

FWIW,我会在这里发布。我用一个讨厌的kludge克服了这个问题。我有一个release.sh脚本,其中包含很少的后续builddeployping命令。所以我做了以下事情:

# mix edeliver restart production

for host in `cat .deliver/config | grep PRODUCTION_HOSTS | cut -d '=' -f 2 | sed -e 's/"//g'`
do
  echo "Restarting the remote [$host]..."
  echo `ssh rates-injector@$host sudo systemctl restart rates_injector.service`
done
echo "Likely restarted."

基本上,我手动为restart发出systemctl命令,从.deliver/config文件中获取生产主机列表。

相关问题