-
-
Notifications
You must be signed in to change notification settings - Fork 203
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
77 changed files
with
9,846 additions
and
322 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"compilerOptions": { | ||
"checkJs": false | ||
}, | ||
"tasks": { | ||
"dev": "deno run --allow-env --allow-read --allow-sys --allow-net --watch src/index.ts", | ||
"test": "deno test --allow-env --allow-sys --allow-read --allow-net --no-check main_test.ts" | ||
}, | ||
"imports": { | ||
"@std/assert": "jsr:@std/assert@1" | ||
} | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
export function add(a: number, b: number): number { | ||
return a + b; | ||
} | ||
|
||
// Learn more at https://docs.deno.com/runtime/manual/examples/module_metadata#concepts | ||
if (import.meta.main) { | ||
console.log("Add 2 + 3 =", add(2, 3)); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { assertEquals } from "@std/assert"; | ||
import { add } from "./main.ts"; | ||
import { GenericContainer } from "./src/index.ts"; | ||
|
||
Deno.test(async function addTest() { | ||
assertEquals(add(2, 3), 5); | ||
await new GenericContainer("redis") | ||
.withExposedPorts(6379) | ||
.start(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
export { Logger, log, buildLog, composeLog, pullLog, execLog, containerLog } from "./logger"; | ||
export * from "./type-guards"; | ||
export { hash } from "./hash"; | ||
export { Uuid, RandomUuid } from "./uuid"; | ||
export { streamToString } from "./streams"; | ||
export { withFileLock } from "./file-lock"; | ||
export { Retry, IntervalRetry } from "./retry"; | ||
export { Logger, log, buildLog, composeLog, pullLog, execLog, containerLog } from "./logger.ts"; | ||
export * from "./type-guards.ts"; | ||
export { hash } from "./hash.ts"; | ||
export { RandomUuid } from "./uuid.ts"; | ||
export type { Uuid } from "./uuid.ts"; | ||
export { streamToString } from "./streams.ts"; | ||
export { withFileLock } from "./file-lock.ts"; | ||
export { IntervalRetry } from "./retry.ts"; | ||
export type { Retry } from "./retry.ts"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import { Readable } from "stream"; | ||
import { Readable } from "node:stream"; | ||
|
||
type Options = { trim: boolean }; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
packages/testcontainers/src/container-runtime/auth/cred-helpers.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
packages/testcontainers/src/container-runtime/auth/creds-store.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 11 additions & 10 deletions
21
packages/testcontainers/src/container-runtime/auth/get-auth-config.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
packages/testcontainers/src/container-runtime/auth/registry-auth-locator.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 4 additions & 4 deletions
8
packages/testcontainers/src/container-runtime/clients/compose/compose-client.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 4 additions & 3 deletions
7
packages/testcontainers/src/container-runtime/clients/compose/default-compose-options.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
packages/testcontainers/src/container-runtime/clients/compose/types.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
packages/testcontainers/src/container-runtime/clients/container/podman-container-client.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,15 @@ | ||
import Dockerode, { ImageBuildOptions } from "dockerode"; | ||
import byline from "byline"; | ||
import tar from "tar-fs"; | ||
import path from "path"; | ||
import { existsSync, promises as fs } from "fs"; | ||
import tar from "npm:tar-fs"; | ||
import path from "node:path"; | ||
import { existsSync, promises as fs } from "node:fs"; | ||
import dockerIgnore from "@balena/dockerignore"; | ||
import { getAuthConfig } from "../../auth/get-auth-config"; | ||
import { ImageName } from "../../image-name"; | ||
import { ImageClient } from "./image-client"; | ||
import AsyncLock from "async-lock"; | ||
import { log, buildLog, pullLog } from "../../../common"; | ||
import { getAuthConfig } from "../../auth/get-auth-config.ts"; | ||
import { ImageName } from "../../image-name.ts"; | ||
import { ImageClient } from "./image-client.ts"; | ||
// @ts-ignore missing types | ||
Check failure on line 10 in packages/testcontainers/src/container-runtime/clients/image/docker-image-client.ts GitHub Actions / lint
|
||
import AsyncLock from "npm:async-lock"; | ||
import { log, buildLog, pullLog } from "../../../common/index.ts"; | ||
|
||
export class DockerImageClient implements ImageClient { | ||
private readonly existingImages = new Set<string>(); | ||
|
@@ -21,7 +22,7 @@ export class DockerImageClient implements ImageClient { | |
log.debug(`Building image "${opts.t}" with context "${context}"...`); | ||
const isDockerIgnored = await this.createIsDockerIgnoredFunction(context); | ||
const tarStream = tar.pack(context, { | ||
ignore: (aPath) => { | ||
ignore: (aPath: string) => { | ||
const relativePath = path.relative(context, aPath); | ||
if (relativePath === opts.dockerfile) { | ||
return false; | ||
|
@@ -58,6 +59,7 @@ export class DockerImageClient implements ImageClient { | |
} | ||
|
||
const dockerIgnorePatterns = await fs.readFile(dockerIgnoreFilePath, { encoding: "utf-8" }); | ||
// @ts-ignore ignorecase is not in the types | ||
Check failure on line 62 in packages/testcontainers/src/container-runtime/clients/image/docker-image-client.ts GitHub Actions / lint
|
||
const instance = dockerIgnore({ ignorecase: false }); | ||
instance.add(dockerIgnorePatterns); | ||
const filter = instance.createFilter(); | ||
|
2 changes: 1 addition & 1 deletion
2
packages/testcontainers/src/container-runtime/clients/image/image-client.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
packages/testcontainers/src/container-runtime/clients/network/docker-network-client.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.