From b71f36434da5cfa655459f758a9d09454c700b10 Mon Sep 17 00:00:00 2001 From: plh97 Date: Wed, 31 May 2023 22:08:57 +0800 Subject: [PATCH] fix: cicd --- ansible/cicd.yml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/ansible/cicd.yml b/ansible/cicd.yml index a17c262..314d374 100644 --- a/ansible/cicd.yml +++ b/ansible/cicd.yml @@ -3,6 +3,15 @@ user: root gather_facts: False tasks: + - name: Stop running containers + docker_container: + name: "{{ item }}" + state: stopped + loop: "{{ docker_info.containers | map(attribute='Id') | list }}" + - name: Delete content & directory + file: + state: absent + path: /root/chatroom/ - name: pull latest code on develop branch git: repo: https://github.com/plh2/chatroom.git @@ -31,11 +40,6 @@ chdir: /root/chatroom cmd: npm run build - - name: rm container - command: - chdir: /root/chatroom - cmd: npm run down - - name: deploy command: chdir: /root/chatroom