Permalink
Browse files

Buildbot change (#263)

* Buildbot changes

* Fixed a CP mistake

* Removed updating status

* Fixed URL

* Fixed another URL
  • Loading branch information...
Ayuto committed Nov 18, 2018
1 parent 4b4d6a8 commit e248ee56e29b89a88a05a0aec62e31afea586e33
@@ -64,10 +64,13 @@
LOADER_UPDATE_FILE = UPDATE_PATH / 'addons' / f'source-python.{BINARY_EXT}'
VDF_UPDATE_FILE = UPDATE_PATH / 'addons' / 'source-python.vdf'
CHECKSUM_URL = 'http://data.sourcepython.com/checksum.txt'
DATA_URL = 'http://data.sourcepython.com/source-python-data.zip'
ARTIFACTS_URL = 'http://builds.sourcepython.com/job/Source.Python/lastSuccessfulBuild/api/json?tree=artifacts[relativePath]'
BASE_DOWNLOAD_URL = 'http://builds.sourcepython.com/job/Source.Python/lastSuccessfulBuild/artifact/'
BASE_DATA_URL = 'http://data.sourcepython.com'
CHECKSUM_URL = f'{BASE_DATA_URL}/checksum.txt'
DATA_URL = f'{BASE_DATA_URL}/source-python-data.zip'
BASE_DOWNLOAD_URL = 'http://downloads.sourcepython.com'
ARTIFACTS_URL = f'{BASE_DOWNLOAD_URL}/artifacts.txt'
DEFAULT_TIMEOUT = 3
#: Indicates, whether an update is in progress (stage 1 has been applied).
@@ -140,9 +143,7 @@ def get_build_artifacts(timeout=DEFAULT_TIMEOUT):
"""
update_logger.log_debug('Getting artifacts...')
with urlopen(ARTIFACTS_URL, timeout=timeout) as url:
data = json.loads(url.read())
for d in data['artifacts']:
yield d['relativePath']
return url.read().decode('utf-8').split('\n')
def get_download_url(game=SOURCE_ENGINE_BRANCH, timeout=DEFAULT_TIMEOUT):
"""Get the latest Source.Python download URL for a specific game.
@@ -157,7 +158,7 @@ def get_download_url(game=SOURCE_ENGINE_BRANCH, timeout=DEFAULT_TIMEOUT):
"""
for relative_path in get_build_artifacts(timeout):
if f'-{game}-' in relative_path:
return BASE_DOWNLOAD_URL + relative_path
return f'{BASE_DOWNLOAD_URL}/{relative_path}'
raise ValueError(f'Unable to find a download URL for game "{game}".')
@@ -32,8 +32,7 @@
GIT_COMMIT = None
LAST_SUCCESSFUL_BUILD_NUMBER_URL = (
'http://builds.sourcepython.com/job/Source.Python' +
'/api/xml?xpath=/freeStyleProject/lastSuccessfulBuild/number')
'http://downloads.sourcepython.com/version.txt')
# =============================================================================
@@ -53,9 +52,7 @@ def get_last_successful_build_number(timeout=3):
:rtype: int
"""
with urlopen(LAST_SUCCESSFUL_BUILD_NUMBER_URL, timeout=timeout) as url:
# Remove the <number></number> tags, so we just have the build number
return int(url.read()[8:-9])
return int(url.read().decode('utf-8'))
def is_unversioned():
"""Return ``True`` if this Source.Python installation has no version.

0 comments on commit e248ee5

Please sign in to comment.