mirror of
https://bitbucket.org/atlassian/dc-deployments-automation.git
synced 2025-12-13 08:23:06 -06:00
DCD-1526 Update Ansible playbook "latest" logic for Bitbucket, Confluence, and Crowd
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
atl_latest_version: ''
|
||||
atl_cached_version: ''
|
||||
|
||||
atl_product_latest_version_url: "https://marketplace.atlassian.com/rest/2/applications/{{ atl_product_family }}/versions/latest"
|
||||
atl_product_latest_version_url: "https://marketplace.atlassian.com/rest/2/products/key/{{ atl_product_family }}/versions"
|
||||
atl_product_version_cache_dir: "{{ atl_product_home_shared }}"
|
||||
atl_product_version_cache: "{{ atl_product_home_shared }}/{{ atl_product_edition }}.version"
|
||||
|
||||
|
||||
@@ -24,28 +24,25 @@ def test_version_file_is_latest(host):
|
||||
verfile = host.file('/media/atl/bitbucket/shared/bitbucket.version')
|
||||
assert verfile.exists
|
||||
|
||||
upstream_fd = urllib.request.urlopen(
|
||||
"https://marketplace.atlassian.com/rest/2/applications/bitbucket/versions/latest")
|
||||
upstream_fd = urllib.request.urlopen("https://marketplace.atlassian.com/rest/2/products/key/bitbucket/versions")
|
||||
upstream_json = json.load(upstream_fd)
|
||||
upstream = upstream_json['version']
|
||||
upstream = upstream_json['_embedded']['versions'][0]['name']
|
||||
|
||||
assert verfile.content.decode("UTF-8").strip() == upstream.strip()
|
||||
|
||||
def test_latest_is_downloaded(host):
|
||||
upstream_fd = urllib.request.urlopen(
|
||||
"https://marketplace.atlassian.com/rest/2/applications/bitbucket/versions/latest")
|
||||
upstream_fd = urllib.request.urlopen("https://marketplace.atlassian.com/rest/2/products/key/bitbucket/versions")
|
||||
upstream_json = json.load(upstream_fd)
|
||||
upstream = upstream_json['version']
|
||||
upstream = upstream_json['_embedded']['versions'][0]['name']
|
||||
|
||||
installer = host.file('/media/atl/downloads/bitbucket.' + upstream + '-x64.bin')
|
||||
assert installer.exists
|
||||
assert installer.user == 'root'
|
||||
|
||||
def test_completed_lockfile(host):
|
||||
upstream_fd = urllib.request.urlopen(
|
||||
"https://marketplace.atlassian.com/rest/2/applications/bitbucket/versions/latest")
|
||||
upstream_fd = urllib.request.urlopen("https://marketplace.atlassian.com/rest/2/products/key/bitbucket/versions")
|
||||
upstream_json = json.load(upstream_fd)
|
||||
upstream = upstream_json['version']
|
||||
upstream = upstream_json['_embedded']['versions'][0]['name']
|
||||
|
||||
lockfile = host.file('/media/atl/downloads/bitbucket.' + upstream + '-x64.bin_completed')
|
||||
assert lockfile.exists
|
||||
|
||||
@@ -24,25 +24,25 @@ def test_version_file_is_latest(host):
|
||||
verfile = host.file('/media/atl/confluence/shared-home/confluence.version')
|
||||
assert verfile.exists
|
||||
|
||||
upstream_fd = urllib.request.urlopen("https://marketplace.atlassian.com/rest/2/applications/confluence/versions/latest")
|
||||
upstream_fd = urllib.request.urlopen("https://marketplace.atlassian.com/rest/2/products/key/confluence/versions")
|
||||
upstream_json = json.load(upstream_fd)
|
||||
upstream = upstream_json['version']
|
||||
upstream = upstream_json['_embedded']['versions'][0]['name']
|
||||
|
||||
assert verfile.content.decode("UTF-8").strip() == upstream.strip()
|
||||
|
||||
def test_latest_is_downloaded(host):
|
||||
upstream_fd = urllib.request.urlopen("https://marketplace.atlassian.com/rest/2/applications/confluence/versions/latest")
|
||||
upstream_fd = urllib.request.urlopen("https://marketplace.atlassian.com/rest/2/products/key/confluence/versions")
|
||||
upstream_json = json.load(upstream_fd)
|
||||
upstream = upstream_json['version']
|
||||
upstream = upstream_json['_embedded']['versions'][0]['name']
|
||||
|
||||
installer = host.file('/media/atl/downloads/confluence.'+upstream+'-x64.bin')
|
||||
assert installer.exists
|
||||
assert installer.user == 'root'
|
||||
|
||||
def test_completed_lockfile(host):
|
||||
upstream_fd = urllib.request.urlopen("https://marketplace.atlassian.com/rest/2/applications/confluence/versions/latest")
|
||||
upstream_fd = urllib.request.urlopen("https://marketplace.atlassian.com/rest/2/products/key/confluence/versions")
|
||||
upstream_json = json.load(upstream_fd)
|
||||
upstream = upstream_json['version']
|
||||
upstream = upstream_json['_embedded']['versions'][0]['name']
|
||||
|
||||
lockfile = host.file('/media/atl/downloads/confluence.'+upstream+'-x64.bin_completed')
|
||||
assert lockfile.exists
|
||||
|
||||
@@ -24,28 +24,25 @@ def test_version_file_is_latest(host):
|
||||
verfile = host.file('/media/atl/crowd/shared/crowd.version')
|
||||
assert verfile.exists
|
||||
|
||||
upstream_fd = urllib.request.urlopen(
|
||||
"https://marketplace.atlassian.com/rest/2/applications/crowd/versions/latest")
|
||||
upstream_fd = urllib.request.urlopen("https://marketplace.atlassian.com/rest/2/products/key/crowd/versions")
|
||||
upstream_json = json.load(upstream_fd)
|
||||
upstream = upstream_json['version']
|
||||
upstream = upstream_json['_embedded']['versions'][0]['name']
|
||||
|
||||
assert verfile.content.decode("UTF-8").strip() == upstream.strip()
|
||||
|
||||
def test_latest_is_downloaded(host):
|
||||
upstream_fd = urllib.request.urlopen(
|
||||
"https://marketplace.atlassian.com/rest/2/applications/crowd/versions/latest")
|
||||
upstream_fd = urllib.request.urlopen("https://marketplace.atlassian.com/rest/2/products/key/crowd/versions")
|
||||
upstream_json = json.load(upstream_fd)
|
||||
upstream = upstream_json['version']
|
||||
upstream = upstream_json['_embedded']['versions'][0]['name']
|
||||
|
||||
installer = host.file('/media/atl/downloads/crowd.' + upstream + '.tar.gz')
|
||||
assert installer.exists
|
||||
assert installer.user == 'root'
|
||||
|
||||
def test_completed_lockfile(host):
|
||||
upstream_fd = urllib.request.urlopen(
|
||||
"https://marketplace.atlassian.com/rest/2/applications/crowd/versions/latest")
|
||||
upstream_fd = urllib.request.urlopen("https://marketplace.atlassian.com/rest/2/products/key/crowd/versions")
|
||||
upstream_json = json.load(upstream_fd)
|
||||
upstream = upstream_json['version']
|
||||
upstream = upstream_json['_embedded']['versions'][0]['name']
|
||||
|
||||
lockfile = host.file('/media/atl/downloads/crowd.' + upstream + '.tar.gz_completed')
|
||||
assert lockfile.exists
|
||||
|
||||
@@ -10,4 +10,4 @@
|
||||
|
||||
- name: Set the local var to retrieved version
|
||||
set_fact:
|
||||
atl_latest_version: "{{ atl_product_version_json.version }}"
|
||||
atl_latest_version: "{{ atl_product_version_json._embedded.versions[0].name }}"
|
||||
|
||||
Reference in New Issue
Block a user