diff --git a/.github/renovate.json b/.github/renovate.json index d0f3d9201a..af11632e86 100644 --- a/.github/renovate.json +++ b/.github/renovate.json @@ -61,6 +61,7 @@ "matchDepNames": [ "apko", "apm", + "aube", "bazelisk", "buf", "buildx", @@ -115,6 +116,7 @@ "matchDepNames": [ "apko", "apm", + "aube", "bazelisk", "buf", "buildx", diff --git a/docs/custom-registries.md b/docs/custom-registries.md index 0aea5b0997..92cdf39006 100644 --- a/docs/custom-registries.md +++ b/docs/custom-registries.md @@ -59,6 +59,19 @@ https://github.com/microsoft/apm/releases/download/v0.24.0/apm-linux-arm64.tar.g https://github.com/microsoft/apm/releases/download/v0.24.0/apm-linux-arm64.tar.gz.sha256 ``` +## `aube` + +Aube releases are downloaded from: + +- `https://github.com/jdx/aube/releases` + +Samples: + +```txt +https://github.com/jdx/aube/releases/download/v1.32.0/aube-v1.32.0-aarch64-unknown-linux-gnu.tar.gz +https://github.com/jdx/aube/releases/download/v1.32.0/aube-v1.32.0-x86_64-unknown-linux-gnu.tar.gz +``` + ## `bazelisk` Bazelisk releases are downloaded from: diff --git a/src/cli/install-tool/index.ts b/src/cli/install-tool/index.ts index 6d98c8e0b6..c41fe8d84f 100644 --- a/src/cli/install-tool/index.ts +++ b/src/cli/install-tool/index.ts @@ -9,6 +9,7 @@ import { } from '../services/index.ts'; import { ApkoInstallService } from '../tools/apko.ts'; import { ApmInstallService } from '../tools/apm.ts'; +import { AubeInstallService } from '../tools/aube.ts'; import { BazeliskInstallService } from '../tools/bazelisk.ts'; import { BufInstallService } from '../tools/buf.ts'; import { BunInstallService } from '../tools/bun.ts'; @@ -136,6 +137,7 @@ async function prepareInstallContainer(): Promise { container.bind(INSTALL_TOOL_TOKEN).to(AndroidSdkCmdlineToolsInstallService); container.bind(INSTALL_TOOL_TOKEN).to(ApkoInstallService); container.bind(INSTALL_TOOL_TOKEN).to(ApmInstallService); + container.bind(INSTALL_TOOL_TOKEN).to(AubeInstallService); container.bind(INSTALL_TOOL_TOKEN).to(ComposerInstallService); container.bind(INSTALL_TOOL_TOKEN).to(BazeliskInstallService); container.bind(INSTALL_TOOL_TOKEN).to(BuildxInstallService); diff --git a/src/cli/tools/aube.ts b/src/cli/tools/aube.ts new file mode 100644 index 0000000000..e0e43db541 --- /dev/null +++ b/src/cli/tools/aube.ts @@ -0,0 +1,44 @@ +import fs from 'node:fs/promises'; +import { join } from 'node:path'; +import { injectFromHierarchy, injectable } from 'inversify'; +import { BaseInstallService } from '../install-tool/base-install.service.ts'; + +@injectable() +@injectFromHierarchy() +export class AubeInstallService extends BaseInstallService { + readonly name = 'aube'; + + private get ghArch(): string { + switch (this.envSvc.arch) { + case 'arm64': + return 'aarch64'; + case 'amd64': + return 'x86_64'; + } + } + + override async install(version: string): Promise { + const filename = `aube-v${version}-${this.ghArch}-unknown-linux-gnu.tar.gz`; + const file = await this.http.download({ + url: `https://github.com/jdx/aube/releases/download/v${version}/${filename}`, + }); + + await this.pathSvc.ensureToolPath(this.name); + + const path = join( + await this.pathSvc.createVersionedToolPath(this.name, version), + 'bin', + ); + await fs.mkdir(path); + await this.compress.extract({ file, cwd: path }); + } + + override async link(version: string): Promise { + const src = join(this.pathSvc.versionedToolPath(this.name, version), 'bin'); + await this.shellwrapper({ srcDir: src }); + } + + override async test(_version: string): Promise { + await this._spawn(this.name, ['--version']); + } +} diff --git a/src/cli/tools/index.ts b/src/cli/tools/index.ts index c0c8552f32..4276301e4b 100644 --- a/src/cli/tools/index.ts +++ b/src/cli/tools/index.ts @@ -4,6 +4,7 @@ export const NoPrepareTools = [ 'android-sdk-cmdline-tools', 'apko', 'apm', + 'aube', 'bazelisk', 'bower', 'buf', diff --git a/test/latest/Dockerfile b/test/latest/Dockerfile index cef537ff42..c787fad620 100644 --- a/test/latest/Dockerfile +++ b/test/latest/Dockerfile @@ -212,7 +212,7 @@ RUN prepare-tool all RUN set -ex; [ -d /usr/local/erlang ] && echo "works" || exit 1; #-------------------------------------- -# test: apm, bazelisk, buf, bun, deno, devbox, helmfile, kustomize, skopeo, tofu, vendir +# test: apm, aube, bazelisk, buf, bun, deno, devbox, helmfile, kustomize, skopeo, tofu, vendir #-------------------------------------- FROM base AS teste @@ -234,6 +234,9 @@ RUN install-tool apko 1.2.27 # renovate: datasource=github-releases packageName=microsoft/apm RUN install-tool apm 0.26.0 +# renovate: datasource=github-releases packageName=jdx/aube +RUN install-tool aube 1.32.0 + # renovate: datasource=github-releases packageName=jetify-com/devbox RUN install-tool devbox 0.17.5 @@ -287,8 +290,16 @@ RUN helmfile version | grep "${HELMFILE_VERSION#v}" RUN kustomize version | grep "${KUSTOMIZE_VERSION}" +COPY --chown=12021:0 test/latest/src/test/aube /tmp/aube + +WORKDIR /tmp/aube + USER 12021 +RUN aube install + +RUN aube install --ignore-scripts + RUN bazel --version RUN vendir --version | grep "${VENDIR_VERSION#v}" diff --git a/test/latest/Dockerfile.arm64 b/test/latest/Dockerfile.arm64 index 6f83633130..a101415230 100644 --- a/test/latest/Dockerfile.arm64 +++ b/test/latest/Dockerfile.arm64 @@ -72,6 +72,24 @@ FROM base AS test-apm # renovate: datasource=github-releases packageName=microsoft/apm RUN install-tool apm 0.26.0 +#-------------------------------------- +# Image: aube +#-------------------------------------- +FROM base AS test-aube + +# renovate: datasource=github-releases packageName=jdx/aube +RUN install-tool aube 1.32.0 + +COPY --chown=12021:0 test/latest/src/test/aube /tmp/aube + +USER 12021 + +WORKDIR /tmp/aube + +RUN aube install + +RUN aube install --ignore-scripts + #-------------------------------------- # Image: devbox #-------------------------------------- @@ -215,6 +233,7 @@ COPY --from=test-bun /.dummy /.dummy COPY --from=test-deno /.dummy /.dummy COPY --from=test-apko /.dummy /.dummy COPY --from=test-apm /.dummy /.dummy +COPY --from=test-aube /.dummy /.dummy COPY --from=test-devbox /.dummy /.dummy COPY --from=test-docker /.dummy /.dummy COPY --from=test-git /.dummy /.dummy diff --git a/test/latest/src/test/aube/package.json b/test/latest/src/test/aube/package.json new file mode 100644 index 0000000000..463ed72140 --- /dev/null +++ b/test/latest/src/test/aube/package.json @@ -0,0 +1,4 @@ +{ + "name": "containerbase-aube-test", + "private": true +}