Skip to content

Commit

Permalink
Merge pull request #1194 from HathorNetwork/chore/rc-include-python-s…
Browse files Browse the repository at this point in the history
…uffix

chore(docker): include python suffix tags on rc images
  • Loading branch information
jansegre authored Dec 11, 2024
2 parents f6bf33a + f893765 commit 191dac6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
9 changes: 3 additions & 6 deletions extras/github/docker.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,9 @@ def extract_pyver(filename):

tags = set()

# We don't want a tag with a python suffix for release-candidates
if is_release_candidate:
version = base_version
else:
version = base_version + '-' + suffix
tags.add(version)
# Always include -python{Version} suffix variant
version = base_version + '-' + suffix
tags.add(version)

if suffix == default_python:
tags.add(base_version)
Expand Down
15 changes: 10 additions & 5 deletions extras/github/test_docker.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,14 @@ def test_release_candidate_non_default_python(self):
self.assertEqual(base_version, 'v0.53.0-rc.1')

output = prep_tags(os.environ, base_version, is_release_candidate)
version_with_python = f'{base_version}-python{NON_DEFAULT_PYTHON_VERSION}'

self.assertNotIn('slack-notification-version', output)
self.assertEqual(output['version'], base_version)
self.assertEqual(output['version'], version_with_python)
self.assertEqual(output['login-dockerhub'], 'true')
self.assertEqual(output['login-ghcr'], 'false')
self.assertEqual(output['tags'], 'dont-push--local-only')
self.assertEqual(output['push'], 'false')
self.assertEqual(output['tags'], f'mock_image:{version_with_python}')
self.assertEqual(output['push'], 'true')
self.assertEqual(output['dockerfile'], 'Dockerfile')

def test_release_candidate_default_python(self):
Expand All @@ -127,12 +128,16 @@ def test_release_candidate_default_python(self):
self.assertEqual(base_version, 'v0.53.0-rc.1')

output = prep_tags(os.environ, base_version, is_release_candidate)
version_with_python = f'{base_version}-python{DEFAULT_PYTHON_VERSION}'

self.assertEqual(output['slack-notification-version'], base_version)
self.assertEqual(output['version'], base_version)
self.assertEqual(output['version'], version_with_python)
self.assertEqual(output['login-dockerhub'], 'true')
self.assertEqual(output['login-ghcr'], 'false')
self.assertEqual(output['tags'], 'mock_image:v0.53.0-rc.1')
self.assertEqual(
set(output['tags'].split(',')),
{f'mock_image:{version_with_python}', 'mock_image:v0.53.0-rc.1'},
)
self.assertEqual(output['push'], 'true')
self.assertEqual(output['dockerfile'], 'Dockerfile')

Expand Down

0 comments on commit 191dac6

Please sign in to comment.