mirror of
https://bitbucket.org/atlassian/dc-deployments-automation.git
synced 2025-12-13 16:33:08 -06:00
DCD-224: Download locally rather than to the shared drive to avoid races.
This commit is contained in:
@@ -7,4 +7,5 @@ atl_product_latest_version_url: "{{ atl_product_base_url }}/latest"
|
||||
atl_product_version_cache: "{{ atl_product_home_shared }}/{{ atl_product_edition }}.version"
|
||||
|
||||
atl_product_download_url: "{{ atl_product_base_url }}/atlassian-{{ atl_product_edition }}-{{ atl_product_version_file.stdout }}-x64.bin"
|
||||
atl_product_download_cache: "{{ atl_product_home_shared }}/{{ atl_product_edition }}.{{ atl_product_version_file.stdout }}.bin"
|
||||
atl_product_download_filename: "{{ atl_product_edition }}.{{ atl_product_version_file.stdout }}.bin"
|
||||
atl_product_download: "{{ atl_installer_temp }}/{{ atl_product_download_filename }}"
|
||||
|
||||
@@ -25,7 +25,7 @@ def test_latest_is_downloaded(host):
|
||||
upstream_fd = urllib.request.urlopen("https://s3.amazonaws.com/atlassian-software/releases/jira-software/latest")
|
||||
upstream = upstream_fd.read().decode("UTF-8").strip()
|
||||
|
||||
installer = host.file('/media/atl/jira/shared/jira-software.'+upstream+'.bin')
|
||||
installer = host.file('/opt/atlassian/tmp/jira-software.'+upstream+'.bin')
|
||||
assert installer.exists
|
||||
assert installer.user == 'root'
|
||||
assert installer.mode == 0o0755
|
||||
|
||||
@@ -18,3 +18,8 @@ def test_version_is_latest(host):
|
||||
|
||||
assert verfile.content.decode("UTF-8").strip() == "7.13.2"
|
||||
|
||||
def test_latest_is_downloaded(host):
|
||||
installer = host.file('/opt/atlassian/tmp/jira-software.7.13.2.bin')
|
||||
assert installer.exists
|
||||
assert installer.user == 'root'
|
||||
assert installer.mode == 0o0755
|
||||
|
||||
@@ -17,10 +17,15 @@
|
||||
- name: Use version for product version
|
||||
command: "cat {{ atl_product_version_cache }}"
|
||||
register: atl_product_version_file
|
||||
changed_when: False
|
||||
|
||||
# Note: We don't cache this in the shared drive to the complexity
|
||||
# around download race-conditions if multiple nodes are starting at
|
||||
# the same time. When downloading from product-downloads.atlassian.com
|
||||
# (which is a CDN) takes seconds anyway.
|
||||
- name: Fetch product installer
|
||||
get_url:
|
||||
url: "{{ atl_product_download_url }}"
|
||||
dest: "{{ atl_product_download_cache }}"
|
||||
dest: "{{ atl_product_download }}"
|
||||
mode: 0755
|
||||
force: false
|
||||
|
||||
Reference in New Issue
Block a user