mirror of
https://bitbucket.org/atlassian/dc-deployments-automation.git
synced 2025-12-13 08:23:06 -06:00
Merged in fix-jira-latest-lookup (pull request #10)
The S3 Jira latest file does not appear to be updating, so use marketplace. Approved-by: Varun Arbatti <varbatti@atlassian.com>
This commit is contained in:
@@ -2,6 +2,7 @@ import os
|
||||
from six.moves import urllib
|
||||
|
||||
import testinfra.utils.ansible_runner
|
||||
import json
|
||||
|
||||
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
|
||||
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
|
||||
@@ -11,14 +12,16 @@ def test_version_file_is_latest(host):
|
||||
verfile = host.file('/media/atl/jira/shared/jira-core.version')
|
||||
assert verfile.exists
|
||||
|
||||
upstream_fd = urllib.request.urlopen("https://s3.amazonaws.com/atlassian-software/releases/jira-core/latest")
|
||||
upstream = upstream_fd.read()
|
||||
upstream_fd = urllib.request.urlopen("https://marketplace.atlassian.com/rest/2/applications/jira/versions/latest")
|
||||
upstream_json = json.load(upstream_fd)
|
||||
upstream = upstream_json['version']
|
||||
|
||||
assert verfile.content.decode("UTF-8").strip() == upstream.decode("UTF-8").strip()
|
||||
assert verfile.content.decode("UTF-8").strip() == upstream.strip()
|
||||
|
||||
def test_latest_is_downloaded(host):
|
||||
upstream_fd = urllib.request.urlopen("https://s3.amazonaws.com/atlassian-software/releases/jira-core/latest")
|
||||
upstream = upstream_fd.read().decode("UTF-8").strip()
|
||||
upstream_fd = urllib.request.urlopen("https://marketplace.atlassian.com/rest/2/applications/jira/versions/latest")
|
||||
upstream_json = json.load(upstream_fd)
|
||||
upstream = upstream_json['version']
|
||||
|
||||
installer = host.file('/opt/atlassian/tmp/jira-core.'+upstream+'.bin')
|
||||
assert installer.exists
|
||||
|
||||
@@ -2,6 +2,7 @@ import os
|
||||
from six.moves import urllib
|
||||
|
||||
import testinfra.utils.ansible_runner
|
||||
import json
|
||||
|
||||
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
|
||||
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
|
||||
@@ -23,14 +24,16 @@ def test_version_file_is_latest(host):
|
||||
verfile = host.file('/media/atl/jira/shared/jira-software.version')
|
||||
assert verfile.exists
|
||||
|
||||
upstream_fd = urllib.request.urlopen("https://s3.amazonaws.com/atlassian-software/releases/jira-software/latest")
|
||||
upstream = upstream_fd.read()
|
||||
upstream_fd = urllib.request.urlopen("https://marketplace.atlassian.com/rest/2/applications/jira/versions/latest")
|
||||
upstream_json = json.load(upstream_fd)
|
||||
upstream = upstream_json['version']
|
||||
|
||||
assert verfile.content.decode("UTF-8").strip() == upstream.decode("UTF-8").strip()
|
||||
assert verfile.content.decode("UTF-8").strip() == upstream.strip()
|
||||
|
||||
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()
|
||||
upstream_fd = urllib.request.urlopen("https://marketplace.atlassian.com/rest/2/applications/jira/versions/latest")
|
||||
upstream_json = json.load(upstream_fd)
|
||||
upstream = upstream_json['version']
|
||||
|
||||
installer = host.file('/opt/atlassian/tmp/jira-software.'+upstream+'.bin')
|
||||
assert installer.exists
|
||||
|
||||
@@ -2,6 +2,7 @@ import os
|
||||
from six.moves import urllib
|
||||
|
||||
import testinfra.utils.ansible_runner
|
||||
import json
|
||||
|
||||
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
|
||||
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
|
||||
@@ -11,14 +12,16 @@ def test_version_file_is_latest(host):
|
||||
verfile = host.file('/media/atl/jira/shared/jira-core.version')
|
||||
assert verfile.exists
|
||||
|
||||
upstream_fd = urllib.request.urlopen("https://s3.amazonaws.com/atlassian-software/releases/jira-core/latest")
|
||||
upstream = upstream_fd.read()
|
||||
upstream_fd = urllib.request.urlopen("https://marketplace.atlassian.com/rest/2/applications/jira/versions/latest")
|
||||
upstream_json = json.load(upstream_fd)
|
||||
upstream = upstream_json['version']
|
||||
|
||||
assert verfile.content.decode("UTF-8").strip() == upstream.decode("UTF-8").strip()
|
||||
assert verfile.content.decode("UTF-8").strip() == upstream.strip()
|
||||
|
||||
def test_latest_is_downloaded(host):
|
||||
upstream_fd = urllib.request.urlopen("https://s3.amazonaws.com/atlassian-software/releases/jira-core/latest")
|
||||
upstream = upstream_fd.read().decode("UTF-8").strip()
|
||||
upstream_fd = urllib.request.urlopen("https://marketplace.atlassian.com/rest/2/applications/jira/versions/latest")
|
||||
upstream_json = json.load(upstream_fd)
|
||||
upstream = upstream_json['version']
|
||||
|
||||
installer = host.file('/opt/atlassian/tmp/jira-core.'+upstream+'.bin')
|
||||
assert installer.exists
|
||||
|
||||
Reference in New Issue
Block a user