|
10 | 10 | """Cut a new release and push the tag to the upstream Materialize repository.""" |
11 | 11 |
|
12 | 12 | import argparse |
| 13 | +import os |
13 | 14 | import re |
| 15 | +import shutil |
| 16 | +import subprocess |
14 | 17 | import sys |
| 18 | +import time |
15 | 19 |
|
16 | 20 | from semver.version import Version |
17 | 21 |
|
@@ -54,6 +58,43 @@ def main(): |
54 | 58 | try: |
55 | 59 | print(f"Checking out SHA {args.sha}") |
56 | 60 | checkout(args.sha) |
| 61 | + print("Cloning console repo") |
| 62 | + console_dir = MZ_ROOT / "console" |
| 63 | + if os.path.exists(console_dir): |
| 64 | + shutil.rmtree(console_dir) |
| 65 | + try: |
| 66 | + spawn.runv( |
| 67 | + [ |
| 68 | + "git", |
| 69 | + "clone", |
| 70 | + "https://github.com/MaterializeInc/console", |
| 71 | + console_dir, |
| 72 | + ], |
| 73 | + env={**os.environ, "GIT_TERMINAL_PROMPT": "0"}, |
| 74 | + ) |
| 75 | + except subprocess.CalledProcessError: |
| 76 | + spawn.runv( |
| 77 | + [ "git", "clone", "[email protected]:MaterializeInc/console", console_dir], |
| 78 | + env={**os.environ, "GIT_TERMINAL_PROMPT": "0"}, |
| 79 | + ) |
| 80 | + |
| 81 | + print(f"Bumping console version to {version}") |
| 82 | + spawn.runv(["git", "tag", "-a", version, "-m", version], cwd=console_dir) |
| 83 | + spawn.runv(["git", "push", "origin", version], cwd=console_dir) |
| 84 | + |
| 85 | + print("Waiting for console version to be released on DockerHub (~15 min)") |
| 86 | + console_image = f"materialize/console:{version[1:]}" |
| 87 | + time.sleep(15 * 60) |
| 88 | + while True: |
| 89 | + try: |
| 90 | + spawn.runv(["docker", "manifest", "inspect", console_image]) |
| 91 | + except subprocess.CalledProcessError: |
| 92 | + print(f"{console_image} not yet on DockerHub, sleeping 1 min") |
| 93 | + time.sleep(60) |
| 94 | + continue |
| 95 | + print(f"{console_image} found on DockerHub") |
| 96 | + break |
| 97 | + |
57 | 98 | print(f"Bumping version to {version}") |
58 | 99 | spawn.runv( |
59 | 100 | [ |
|
0 commit comments