Commit 00095714 authored by Daniel Dehennin's avatar Daniel Dehennin

feat(service): do not start the container if it's already runnnig

* discourse/service/running.sls: verify the state of the container
  before running “launcher:start_cmd”.
parent d4c46013
......@@ -9,9 +9,14 @@
include:
- {{ sls_service_rebuild }}
{%- set format = '--format "{{.Names}}" ' %}
{%- set filter = '--filter NAME=app --filter status=running' %}
discourse-service-running-cmd-run:
cmd.run:
- name: {{ discourse | traverse('launcher:start_cmd') }}
- cwd: {{ discourse.directory }}
- unless:
- test "$(docker ps {{ format }} {{ filter }})" = 'app'
- require:
- sls: {{ sls_service_rebuild }}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment