From cdaeef30fd0367da439c48c72bb96ef199c28d28 Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Thu, 17 Aug 2023 09:13:37 +0200 Subject: my_workspace: use community.docker.docker_compose --- roles/my_workspace/tasks/project.yml | 28 +++++++--------------------- 1 file changed, 7 insertions(+), 21 deletions(-) (limited to 'roles/my_workspace') diff --git a/roles/my_workspace/tasks/project.yml b/roles/my_workspace/tasks/project.yml index 41fed86..813de46 100644 --- a/roles/my_workspace/tasks/project.yml +++ b/roles/my_workspace/tasks/project.yml @@ -36,26 +36,12 @@ chdir: '{{ project_dir }}' when: makefile_check is succeeded -- name: This project uses docker-compose +- name: Run docker-compose become: true + community.docker.docker_compose: + build: true + debug: true + project_src: '{{ project_dir }}' + pull: true + remove_orphans: true when: makefile_check is not succeeded and docker_compose_check is succeeded - block: - - name: docker-compose pull - ansible.builtin.command: docker-compose pull - args: - chdir: '{{ project_dir }}' - - - name: docker-compose build - ansible.builtin.command: docker-compose build --force-rm --pull -q - args: - chdir: '{{ project_dir }}' - - - name: docker-compose up - ansible.builtin.command: docker-compose up --remove-orphans -d - args: - chdir: '{{ project_dir }}' - register: docker_compose_up - - - name: Show docker-compose up output - ansible.builtin.debug: - var: docker_compose_up -- cgit v1.2.3