From 267a77cc08120d27efc416572f5cc358fc2df221 Mon Sep 17 00:00:00 2001 From: thienqb123456 Date: Mon, 23 Dec 2024 00:23:40 +0700 Subject: [PATCH] Thienvv - --- roles/deploy/tasks/deploy.yml | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/roles/deploy/tasks/deploy.yml b/roles/deploy/tasks/deploy.yml index caeef62..a797403 100644 --- a/roles/deploy/tasks/deploy.yml +++ b/roles/deploy/tasks/deploy.yml @@ -13,11 +13,28 @@ nexus_username: "{{ nexus_username }}" nexus_password: "{{ nexus_password }}" -# Kiểm tra xem artifact đã được tải thành công chưa -- name: Verify artifact download - fail: - msg: "Failed to download artifact from Nexus." - when: download_status is failed +# Debug download_status +- name: Debug download_status + debug: + var: download_status + +- name: Check if the download was successful + debug: + msg: "Download successful: {{ download_status.downloaded }}" + +# Kiểm tra ở trên server đã tồn tại file vùa tải xuống không +- name: Check if the artifact file exists + stat: + path: "{{ temp_dir }}\\{{ artifact_name }}" + register: file_status + changed_when: false + failed_when: false + +# Debug file_status +- name: Output file status + debug: + msg: "Artifact downloaded: {{ file_status.stat.exists }}" + # Giải nén artifact vào thư mục target - name: Deploy Backend to target environment