Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/cli/install-tool/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import { DockerInstallService } from '../tools/docker';
import { BuildxInstallService } from '../tools/docker/buildx';
import { DockerComposeInstallService } from '../tools/docker/compose';
import { DotnetInstallService } from '../tools/dotnet';
import { PaketInstallService } from '../tools/dotnet/paket';
import { ErlangInstallService } from '../tools/erlang';
import { ElixirInstallService } from '../tools/erlang/elixir';
import { FlutterInstallService } from '../tools/flutter';
Expand Down Expand Up @@ -143,6 +144,7 @@ async function prepareInstallContainer(): Promise<Container> {
container.bind(INSTALL_TOOL_TOKEN).to(MavenInstallService);
container.bind(INSTALL_TOOL_TOKEN).to(NixInstallService);
container.bind(INSTALL_TOOL_TOKEN).to(NodeInstallService);
container.bind(INSTALL_TOOL_TOKEN).to(PaketInstallService);
container.bind(INSTALL_TOOL_TOKEN).to(PhpInstallService);
container.bind(INSTALL_TOOL_TOKEN).to(PixiInstallService);
container.bind(INSTALL_TOOL_TOKEN).to(PowershellInstallService);
Expand Down
11 changes: 11 additions & 0 deletions src/cli/tools/dotnet/paket.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { injectFromHierarchy, injectable } from 'inversify';
import { V2ToolInstallService } from '../../install-tool/install-legacy-tool.service';
import { v2Tool } from '../../utils/v2-tool';

@injectable()
@injectFromHierarchy()
@v2Tool('paket')
export class PaketInstallService extends V2ToolInstallService {
override readonly name = 'paket';
override readonly parent = 'dotnet';
}
1 change: 1 addition & 0 deletions src/cli/tools/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export const NoPrepareTools = [
'maven',
'nix',
'npm',
'paket',
'pdm',
'pip-tools',
'pipenv',
Expand Down
18 changes: 18 additions & 0 deletions src/usr/local/containerbase/tools/v2/paket.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash

function check_tool_requirements () {
check_command dotnet
check_semver "$TOOL_VERSION" "all"
}

function install_tool () {
dotnet tool install -g paket --version "${TOOL_VERSION}"
}

function link_tool () {
shell_wrapper paket "/root/.dotnet/tools"
}

function test_tool () {
DOTNET_ROOT=/opt/containerbase/tools/dotnet paket --version
}
14 changes: 14 additions & 0 deletions test/dotnet/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,19 @@ RUN set -ex; \
dotnet add package Newtonsoft.Json --version 12.0.3; \
dotnet restore --force-evaluate

#--------------------------------------
# test: paket
#--------------------------------------
FROM build AS test-others

# renovate: datasource=nuget packageName=Paket
RUN install-tool paket 9.0.2

WORKDIR /test
RUN set -ex; \
ls -la; env; \
paket init

#--------------------------------------
# final
#--------------------------------------
Expand All @@ -138,3 +151,4 @@ COPY --from=testa /.dummy /.dummy
COPY --from=testb /.dummy /.dummy
COPY --from=testc /.dummy /.dummy
COPY --from=testd /.dummy /.dummy
COPY --from=test-others /.dummy /.dummy
17 changes: 17 additions & 0 deletions test/dotnet/Dockerfile.arm64
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,26 @@ FROM base AS test-dotnet
# renovate: datasource=dotnet packageName=dotnet-sdk
RUN install-tool dotnet 10.0.100

#--------------------------------------
# test: paket
#--------------------------------------
FROM base AS test-others

# renovate: datasource=dotnet packageName=dotnet-sdk
RUN install-tool dotnet 10.0.100

# renovate: datasource=nuget packageName=Paket
RUN install-tool paket 9.0.2

WORKDIR /test
RUN set -ex; \
ls -la; env; \
paket init

#--------------------------------------
# Image: final
#--------------------------------------
FROM base

COPY --from=test-dotnet /.dummy /.dummy
COPY --from=test-others /.dummy /.dummy