mirror of
https://github.com/docker/actions-toolkit.git
synced 2024-11-27 06:46:07 +08:00
docker/install: Remove deprecated version and channel
Use InstallSource instead Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
This commit is contained in:
parent
b8a96071a8
commit
de390e0872
@ -55,7 +55,11 @@ aarch64:https://cloud.debian.org/images/cloud/bookworm/20231013-1532/debian-12-g
|
|||||||
}
|
}
|
||||||
await expect((async () => {
|
await expect((async () => {
|
||||||
const install = new Install({
|
const install = new Install({
|
||||||
|
source: {
|
||||||
|
type: 'archive',
|
||||||
version: version,
|
version: version,
|
||||||
|
channel: 'stable',
|
||||||
|
},
|
||||||
runDir: tmpDir,
|
runDir: tmpDir,
|
||||||
contextName: 'foo',
|
contextName: 'foo',
|
||||||
daemonConfig: `{"debug":true,"features":{"containerd-snapshotter":true}}`
|
daemonConfig: `{"debug":true,"features":{"containerd-snapshotter":true}}`
|
||||||
|
@ -40,7 +40,11 @@ describe('download', () => {
|
|||||||
'acquires %p of docker (%s)', async (version, platformOS) => {
|
'acquires %p of docker (%s)', async (version, platformOS) => {
|
||||||
jest.spyOn(osm, 'platform').mockImplementation(() => platformOS as NodeJS.Platform);
|
jest.spyOn(osm, 'platform').mockImplementation(() => platformOS as NodeJS.Platform);
|
||||||
const install = new Install({
|
const install = new Install({
|
||||||
|
source: {
|
||||||
|
type: 'archive',
|
||||||
version: version,
|
version: version,
|
||||||
|
channel: 'stable',
|
||||||
|
},
|
||||||
runDir: tmpDir,
|
runDir: tmpDir,
|
||||||
});
|
});
|
||||||
const toolPath = await install.download();
|
const toolPath = await install.download();
|
||||||
|
@ -51,13 +51,6 @@ export type InstallSource = InstallSourceImage | InstallSourceArchive;
|
|||||||
export interface InstallOpts {
|
export interface InstallOpts {
|
||||||
source?: InstallSource;
|
source?: InstallSource;
|
||||||
|
|
||||||
// @deprecated
|
|
||||||
// Use `source = InstallSourceTypeArchive{version: ..., channel: ...}` instead
|
|
||||||
version?: string;
|
|
||||||
// @deprecated
|
|
||||||
// Use `source = InstallSourceTypeArchive{version: ..., channel: ...}` instead
|
|
||||||
channel?: string;
|
|
||||||
|
|
||||||
// ...
|
// ...
|
||||||
runDir: string;
|
runDir: string;
|
||||||
contextName?: string;
|
contextName?: string;
|
||||||
@ -84,8 +77,8 @@ export class Install {
|
|||||||
this.runDir = opts.runDir;
|
this.runDir = opts.runDir;
|
||||||
this.source = opts.source || {
|
this.source = opts.source || {
|
||||||
type: 'archive',
|
type: 'archive',
|
||||||
version: opts.version || 'latest',
|
version: 'latest',
|
||||||
channel: opts.channel || 'stable'
|
channel: 'stable'
|
||||||
};
|
};
|
||||||
this.contextName = opts.contextName || 'setup-docker-action';
|
this.contextName = opts.contextName || 'setup-docker-action';
|
||||||
this.daemonConfig = opts.daemonConfig;
|
this.daemonConfig = opts.daemonConfig;
|
||||||
|
Loading…
Reference in New Issue
Block a user