Skip to content

Commit

Permalink
Check the existence and version of Sigstore CLI (#194)
Browse files Browse the repository at this point in the history
  • Loading branch information
sethmlarson authored Nov 25, 2024
1 parent 6d2c794 commit 24c1a0d
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions run_release.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,23 @@ def check_ssh_connection(db: ReleaseShelf) -> None:
client.exec_command("pwd")


def check_sigstore_client(db: ReleaseShelf) -> None:
client = paramiko.SSHClient()
client.load_system_host_keys()
client.set_missing_host_key_policy(paramiko.WarningPolicy)
client.connect(DOWNLOADS_SERVER, port=22, username=db["ssh_user"])
_, stdout, _ = client.exec_command("python3 -m sigstore --version")
sigstore_version = stdout.read(1000).decode()
sigstore_vermatch = re.match("^sigstore ([0-9.]+)", sigstore_version)
if not sigstore_vermatch or tuple(
int(part) for part in sigstore_vermatch.group(1).split(".")
) < (3, 5):
raise ReleaseException(
f"Sigstore version not detected or not valid. "
f"Expecting 3.5.x or later: {sigstore_version}"
)


def check_buildbots(db: ReleaseShelf) -> None:
async def _check() -> set[Builder]:
async def _get_builder_status(
Expand Down Expand Up @@ -1250,6 +1267,7 @@ def _api_key(api_key: str) -> str:
check_ssh_connection,
f"Validating ssh connection to {DOWNLOADS_SERVER} and {DOCS_SERVER}",
),
Task(check_sigstore_client, "Checking Sigstore CLI"),
Task(check_buildbots, "Check buildbots are good"),
Task(check_cpython_repo_is_clean, "Checking Git repository is clean"),
Task(check_magic_number, "Checking the magic number is up-to-date"),
Expand Down

0 comments on commit 24c1a0d

Please sign in to comment.