Add where clause to prevent unnecessary step running

This commit is contained in:
jowj 2018-12-02 19:59:15 -06:00
parent f8f5f82bbf
commit 22b7f6bd39

View File

@ -10,9 +10,14 @@
shell: cd /home/josiah/arke/ && git pull
- name: Build from the latest version
shell: cd ~/arke/ && docker build -t arke -f dockerfile .
- name: Check if there are any existing arke containers running and kill it
- name: Check if there are any existing arke containers running
shell: docker ps | grep 'arke' | awk '{print $1}'
register: result
- name: and kill it
# this has to be a shell because command: isn't interactive
shell: docker ps | grep 'arke' | awk '{print $1}' | xargs docker kill
when: result.stdout != ""
- name: Remove any existing containers using the arke name, its mine and i must have it
# this has to be a shell because command: isn't interactive
shell: docker container rm arke