Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/bitbucket.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ services:
- module: shellexec
prepare:
- python util/pre_run/environment_checker.py
- python util/pre_run/check_for_updates.py
- python util/pre_run/git_client_check.py
- python util/data_preparation/bitbucket_prepare_data.py
shutdown:
Expand Down
1 change: 1 addition & 0 deletions app/confluence.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ services:
- module: shellexec
prepare:
- python util/pre_run/environment_checker.py
- python util/pre_run/check_for_updates.py
- python util/data_preparation/confluence_prepare_data.py
shutdown:
- python util/post_run/jmeter_post_check.py
Expand Down
1 change: 1 addition & 0 deletions app/crowd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ services:
- module: shellexec
prepare:
- python util/pre_run/environment_checker.py
- python util/pre_run/check_for_updates.py
- python util/data_preparation/crowd_prepare_data.py
- python util/data_preparation/crowd_sync_check.py
shutdown:
Expand Down
1 change: 1 addition & 0 deletions app/jira.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ services:
- module: shellexec
prepare:
- python util/pre_run/environment_checker.py
- python util/pre_run/check_for_updates.py
- python util/data_preparation/jira_prepare_data.py
shutdown:
- python util/post_run/jmeter_post_check.py
Expand Down
1 change: 1 addition & 0 deletions app/jsm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ services:
- module: shellexec
prepare:
- python util/pre_run/environment_checker.py
- python util/pre_run/check_for_updates.py
- python util/data_preparation/jsm_prepare_data.py
shutdown:
- python util/post_run/jmeter_post_check.py
Expand Down
28 changes: 28 additions & 0 deletions app/util/pre_run/check_for_updates.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import requests
from packaging import version

from util.conf import TOOLKIT_VERSION

CONF_URL = "https://raw.githubusercontent.com/atlassian/dc-app-performance-toolkit/master/app/util/conf.py"
VERSION_STR = "TOOLKIT_VERSION"

r = requests.get(CONF_URL)

if not r.ok:
print(f"Warning: DCAPT check for updates failed.\nURL: {r.url}. Status code: {r.status_code}. Reason: {r.reason}")
exit(0)

conf = r.text.splitlines()
version_line = next((line for line in conf if VERSION_STR in line))
latest_version_str = version_line.split('=')[1].replace("'", "").replace('"', "").strip()

latest_version = version.parse(latest_version_str)
current_version = version.parse(TOOLKIT_VERSION)

if current_version < latest_version:
print(f"Warning: DCAPT version {TOOLKIT_VERSION} is outdated. "
f"Consider upgrade to the latest version: {latest_version}.")
elif current_version == latest_version:
print(f"Info: DCAPT version {TOOLKIT_VERSION} is latest.")
else:
print(f"Info: DCAPT version {TOOLKIT_VERSION} is ahead of the latest production version: {latest_version}.")