From d6788d42f84acfcf944cd0616080bbc3313d6f6e Mon Sep 17 00:00:00 2001 From: thienqb123456 Date: Mon, 23 Dec 2024 01:09:53 +0700 Subject: [PATCH] Thienvv - --- roles/deploy/tasks/setup.yml | 46 ++++++++++++++++++------------------ 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/roles/deploy/tasks/setup.yml b/roles/deploy/tasks/setup.yml index eb748b8..331acc4 100644 --- a/roles/deploy/tasks/setup.yml +++ b/roles/deploy/tasks/setup.yml @@ -1,18 +1,31 @@ +#Debug - name: Debug iis_site_name debug: var: iis_site_name + +- name: Debug blue_path + debug: + var: blue_path + +# Kiểm tra các thông số Nexus +- name: Debug Nexus URL + debug: + var: nexus_url + +- name: Debug artifact name + debug: + var: artifact_name + + #Lấy đường dẫn vật lý của iis site - name: Get the physical path of the current IIS site - win_shell: | + win_command: | Import-Module WebAdministration $site = Get-Website -Name "{{ iis_site_name }}" $site.PhysicalPath register: active_path - -# Debug Debug active_path -- name: Debug active_path - debug: +- debug: var: active_path - name: Handle error if active_path is null @@ -24,26 +37,13 @@ # Chuẩn hóa giá trị của active_path - name: Normalize active_path set_fact: - active_path: "{{ active_path.stdout | trim }}" - -- name: Debug blue_path - debug: - var: blue_path + active_path: "{{ active_path.stdout | trim }}" +- debug: + var: active_path # Chọn môi trường Blue hoặc Green để deploy - name: Set target deployment environment set_fact: target_path: "{{ green_path if active_path == blue_path else blue_path }}" #lấy ra đường dẫn thư mục cần deploy - -- name: Debug target_path - debug: - var: target_path - -# Kiểm tra các thông số Nexus -- name: Debug Nexus URL - debug: - var: nexus_url - -- name: Debug artifact name - debug: - var: artifact_name \ No newline at end of file +- debug: + var: target_path \ No newline at end of file