【问题标题】:edeliver with distillery: how to setup `start` command to use systemctl与酿酒厂一起交付:如何设置“开始”命令以使用 systemctl
【发布时间】:2018-01-18 23:51:42
【问题描述】:

我正在使用由distillery 支持的edeliver 将Elixir 项目部署到远程。

我还成功创建了systemd.service 文件,该文件可以从命令行启动、停止、重新启动等。

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

我找不到我该告诉谁使用systemd 来[重新]开始发布。应该是delivery 策略吗?还有什么?我知道这个问题不适合 SO,但我只是迷路了。

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

【问题讨论】:

    标签: elixir edeliver distillery


    【解决方案1】:

    FWIW,我会在这里发布。我用一个讨厌的东西克服了这个问题。我有一个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."
    

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

    【讨论】:

      猜你喜欢
      • 2021-11-25
      • 1970-01-01
      • 2023-03-10
      • 1970-01-01
      • 2020-09-11
      • 2013-11-28
      • 2015-03-10
      • 1970-01-01
      • 2021-06-20
      相关资源
      最近更新 更多