Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • heptapod/heptapod-docker
1 result
Show changes
Commits on Source (2)
  • Georges Racinet's avatar
    release-full: new script · 6b5aa7d98445
    Georges Racinet authored
    It's become very boring to build manually the likes of
    
    ```
    ./registry-pull-heptapod-push-docker \
    --push \
    --podman \
    --tag 0-32-testing \
    --verify-hg-tag heptapod-0.32.1-1 \
    --expected-image-id 0e976fdfa6733d4298025cd0b98ae36384863c8dd8d60ac7f9f979bb5d05b259
    ```
    
    Next step should be to parse the SHA256 directly from the CI job.
    6b5aa7d98445
  • Georges Racinet's avatar
    release-full: output a draft twitt message · 448c42c004b2
    Georges Racinet authored
    448c42c004b2
#!/usr/bin/env python3
import argparse
import logging
from pathlib import Path
import subprocess
FILE_PATH = Path(__file__)
BASE_DIR = FILE_PATH.parent
logger = logging.getLogger(FILE_PATH.name.rsplit('.', 1)[0])
TWITT_TEMPLATE = (
"registry-pull-heptapod-push-docker#heptapod {version} "
"released, COMMENT_HERE "
"Docker: https://hub.docker.com/r/heptapod/heptapod/"
"tags?name={version} Changelog: "
"https://foss.heptapod.net/heptapod/heptapod/-/blob/heptapod-{version}/"
"HEPTAPOD_CHANGELOG.md #git #mercurial"
)
def validate_sha256(s):
assert len(s) == 64
return s
def validate_yes(s):
return s.strip().lower() in ('y', 'yes')
def parse_version(s):
"""Parse command-line version.
:returns: version with build number, dash series
"""
split = s.rsplit('-', 1)
if len(split) == 1:
version = s
build_version = s + '-1'
else:
version = split[0]
build_version = s
dash_series = '-'.join(version.split('.', 2)[:2])
return version, build_version, dash_series
def main():
parser = argparse.ArgumentParser()
parser.add_argument('version',
help="Heptapod version to pull and release, e.g "
"17.1.2 or 17.2.0-2. The build number is optional"
)
parser.add_argument('--config',
help="Path to configuration file (TOML)",
default='config.toml')
parser.add_argument('-l', '--logging-level', default='info')
cl_args = parser.parse_args()
logging.basicConfig(level=getattr(logging, cl_args.logging_level.upper()))
version, build_version, dash_series = parse_version(cl_args.version)
image_testing_tag = dash_series + '-testing'
omnibus_tag = 'heptapod-' + build_version
image_id = validate_sha256(
input("Please enter the container image id, as seen "
"in Heptapod Tests job: "))
latest = validate_yes(input("Update the `latest` container tag (y/N)? "))
logger.info("Pulling image %r from registry.h.n, pushing it "
"to docker.io, testing consistency with Omnibus tag %r, "
"and pushing version tag for series %r, with latest=%r.",
image_testing_tag,
omnibus_tag,
dash_series,
latest)
subprocess.check_call((BASE_DIR / 'registry-pull-heptapod-push-docker',
'--push',
'--tag', image_testing_tag,
'--verify-hg-tag', omnibus_tag,
'--expected-image-id', image_id))
push_release = [BASE_DIR / 'push-release', dash_series]
if latest:
push_release.append('--latest')
subprocess.check_call(push_release)
print("Now brag about it on social media, inserting additional comments "
"into the following:\n")
print(TWITT_TEMPLATE.format(version=version))
if __name__ == '__main__':
main()