From 32cfff90399935d675ece2cbe4e031bcb1bd4ec9 Mon Sep 17 00:00:00 2001 From: Matte <51192395+MatteZ02@users.noreply.github.com> Date: Thu, 18 Apr 2024 17:11:37 +0300 Subject: [PATCH] Update deployer.yml --- tasks/deployer.yml | 86 +++++++++++++++++++++++----------------------- 1 file changed, 43 insertions(+), 43 deletions(-) diff --git a/tasks/deployer.yml b/tasks/deployer.yml index 6f54fe2..cd21d58 100644 --- a/tasks/deployer.yml +++ b/tasks/deployer.yml @@ -147,49 +147,6 @@ tags: - nginx -- name: "Deployer - Backend - Git Operations" - git: - repo: https://github.com/MetroHege/MPP-Backend.git - dest: /root/backend - version: main - register: deployerTask521 - -- name: "Deployer - Backend - Build Image" - containers.podman.podman_image: - name: mpp/backend - tag: latest - path: /root/backend - build: - file: Dockerfile - format: docker - cache: on - force: on - become: on - become_user: root - register: deployerTask522 - when: - - (deployerTask521 is defined and deployerTask521.changed) or deployerTask521 is undefined - tags: - - backend - -- name: "Deployer - Backend - Run Container" - containers.podman.podman_container: - name: backend - image: mpp/backend:latest - state: started - recreate: on - network: host - volumes: - - "/root/backend/uploads:/usr/src/app/uploads" - - "/root/backend/.env:/usr/src/app/.env:ro" - restart_policy: always - command: "npm start" - when: - - deployerTask522 is defined - - deployerTask522.changed - tags: - - backend - - name: "Deployer - Frontend - Git Operations" git: repo: https://github.com/MetroHege/MPP-Frontend.git @@ -232,3 +189,46 @@ - deployerTask532.changed tags: - frontend + +- name: "Deployer - Backend - Git Operations" + git: + repo: https://github.com/MetroHege/MPP-Backend.git + dest: /root/backend + version: main + register: deployerTask521 + +- name: "Deployer - Backend - Build Image" + containers.podman.podman_image: + name: mpp/backend + tag: latest + path: /root/backend + build: + file: Dockerfile + format: docker + cache: on + force: on + become: on + become_user: root + register: deployerTask522 + when: + - (deployerTask521 is defined and deployerTask521.changed) or deployerTask521 is undefined + tags: + - backend + +- name: "Deployer - Backend - Run Container" + containers.podman.podman_container: + name: backend + image: mpp/backend:latest + state: started + recreate: on + network: host + volumes: + - "/root/backend/uploads:/usr/src/app/uploads" + - "/root/backend/.env:/usr/src/app/.env:ro" + restart_policy: always + command: "npm start" + when: + - deployerTask522 is defined + - deployerTask522.changed + tags: + - backend