Thienvv -
This commit is contained in:
@@ -1,18 +1,31 @@
|
|||||||
|
#Debug
|
||||||
- name: Debug iis_site_name
|
- name: Debug iis_site_name
|
||||||
debug:
|
debug:
|
||||||
var: iis_site_name
|
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
|
#Lấy đường dẫn vật lý của iis site
|
||||||
- name: Get the physical path of the current IIS site
|
- name: Get the physical path of the current IIS site
|
||||||
win_shell: |
|
win_command: |
|
||||||
Import-Module WebAdministration
|
Import-Module WebAdministration
|
||||||
$site = Get-Website -Name "{{ iis_site_name }}"
|
$site = Get-Website -Name "{{ iis_site_name }}"
|
||||||
$site.PhysicalPath
|
$site.PhysicalPath
|
||||||
register: active_path
|
register: active_path
|
||||||
|
- debug:
|
||||||
# Debug Debug active_path
|
|
||||||
- name: Debug active_path
|
|
||||||
debug:
|
|
||||||
var: active_path
|
var: active_path
|
||||||
|
|
||||||
- name: Handle error if active_path is null
|
- name: Handle error if active_path is null
|
||||||
@@ -25,25 +38,12 @@
|
|||||||
- name: Normalize active_path
|
- name: Normalize active_path
|
||||||
set_fact:
|
set_fact:
|
||||||
active_path: "{{ active_path.stdout | trim }}"
|
active_path: "{{ active_path.stdout | trim }}"
|
||||||
|
- debug:
|
||||||
- name: Debug blue_path
|
var: active_path
|
||||||
debug:
|
|
||||||
var: blue_path
|
|
||||||
|
|
||||||
# Chọn môi trường Blue hoặc Green để deploy
|
# Chọn môi trường Blue hoặc Green để deploy
|
||||||
- name: Set target deployment environment
|
- name: Set target deployment environment
|
||||||
set_fact:
|
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
|
target_path: "{{ green_path if active_path == blue_path else blue_path }}" #lấy ra đường dẫn thư mục cần deploy
|
||||||
|
- debug:
|
||||||
- name: Debug target_path
|
|
||||||
debug:
|
|
||||||
var: target_path
|
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
|
|
||||||
Reference in New Issue
Block a user