Public Access
DEVX-110: feat: extract docker-login, tofu-ops, check-deps, install-tofu to Python tools
Post-merge / detect-type (push) Successful in 9s
Post-merge / validate-commit-msg (push) Successful in 9s
Post-merge / vikunja (push) Successful in 21s
Build Images / detect-type (push) Successful in 41s
Post-merge / configure-repo (push) Successful in 17s
Post-merge / release (push) Successful in 43s
Post-merge / sync-wiki (push) Successful in 47s
Post-merge / badges (push) Successful in 51s
Post-merge / publish (push) Successful in 22s
Build Images / build-and-push (push) Successful in 3m26s
Build Images / cleanup (push) Successful in 3m20s
Post-merge / detect-type (push) Successful in 9s
Post-merge / validate-commit-msg (push) Successful in 9s
Post-merge / vikunja (push) Successful in 21s
Build Images / detect-type (push) Successful in 41s
Post-merge / configure-repo (push) Successful in 17s
Post-merge / release (push) Successful in 43s
Post-merge / sync-wiki (push) Successful in 47s
Post-merge / badges (push) Successful in 51s
Post-merge / publish (push) Successful in 22s
Build Images / build-and-push (push) Successful in 3m26s
Build Images / cleanup (push) Successful in 3m20s
This commit was merged in pull request #168.
This commit is contained in:
@@ -42,6 +42,8 @@ TEA_VERSION = "0.14.1"
|
||||
|
||||
HADOLINT_VERSION = "2.12.0"
|
||||
|
||||
TOFU_VERSION = "1.12.3"
|
||||
|
||||
|
||||
def _arch() -> str:
|
||||
"""Return the architecture string used by release assets (delegates to shared utility)."""
|
||||
@@ -174,7 +176,27 @@ def install_hadolint() -> bool:
|
||||
return True
|
||||
|
||||
|
||||
TOOL_NAMES = ["actionlint", "git-cliff", "act_runner", "tea", "hadolint"]
|
||||
def install_tofu() -> bool:
|
||||
"""Install OpenTofu if not already present. Returns True if installed/skipped.
|
||||
|
||||
Downloads the official release tarball from GitHub and extracts the
|
||||
``tofu`` binary to ``~/.local/bin``.
|
||||
"""
|
||||
if _is_installed("tofu"):
|
||||
click.echo("tofu: already installed")
|
||||
return True
|
||||
arch = _arch()
|
||||
os_name = platform.system().lower()
|
||||
url = (
|
||||
f"https://github.com/opentofu/opentofu/releases/download/"
|
||||
f"v{TOFU_VERSION}/tofu_{TOFU_VERSION}_{os_name}_{arch}.tar.gz"
|
||||
)
|
||||
dest = _download_and_extract_tarball(url, "tofu")
|
||||
click.echo(f"tofu: installed to {dest}")
|
||||
return True
|
||||
|
||||
|
||||
TOOL_NAMES = ["actionlint", "git-cliff", "act_runner", "tea", "hadolint", "tofu"]
|
||||
|
||||
|
||||
def _install_tool(name: str) -> bool:
|
||||
@@ -189,6 +211,8 @@ def _install_tool(name: str) -> bool:
|
||||
return install_tea()
|
||||
if name == "hadolint":
|
||||
return install_hadolint()
|
||||
if name == "tofu":
|
||||
return install_tofu()
|
||||
raise click.ClickException(f"Unknown tool: {name}")
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user