testcontainers 9.12.0 → 10.0.0-beta.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{dist/src → build/common}/clock.js +1 -0
- package/build/common/clock.js.map +1 -0
- package/build/common/file-lock.js +58 -0
- package/build/common/file-lock.js.map +1 -0
- package/build/common/hash.d.ts +1 -0
- package/{dist/src → build/common}/hash.js +3 -2
- package/build/common/hash.js.map +1 -0
- package/build/common/index.d.ts +7 -0
- package/build/common/index.js +37 -0
- package/build/common/index.js.map +1 -0
- package/{dist/src → build/common}/logger.d.ts +5 -6
- package/{dist/src → build/common}/logger.js +5 -2
- package/build/common/logger.js.map +1 -0
- package/{dist/src/retry-strategy.d.ts → build/common/retry.d.ts} +3 -3
- package/build/common/retry.js +38 -0
- package/build/common/retry.js.map +1 -0
- package/build/common/streams.js +13 -0
- package/build/common/streams.js.map +1 -0
- package/{dist/src → build/common}/type-guards.js +1 -0
- package/build/common/type-guards.js.map +1 -0
- package/{dist/src → build/common}/uuid.js +1 -0
- package/build/common/uuid.js.map +1 -0
- package/build/container-runtime/auth/auths.d.ts +7 -0
- package/build/container-runtime/auth/auths.js +45 -0
- package/build/container-runtime/auth/auths.js.map +1 -0
- package/build/container-runtime/auth/cred-helpers.d.ts +6 -0
- package/{dist/src/registry-auth-locator → build/container-runtime/auth}/cred-helpers.js +1 -0
- package/build/container-runtime/auth/cred-helpers.js.map +1 -0
- package/{dist/src/registry-auth-locator → build/container-runtime/auth}/credential-provider.d.ts +3 -4
- package/build/container-runtime/auth/credential-provider.js +71 -0
- package/build/container-runtime/auth/credential-provider.js.map +1 -0
- package/build/container-runtime/auth/creds-store.d.ts +6 -0
- package/{dist/src/registry-auth-locator → build/container-runtime/auth}/creds-store.js +1 -0
- package/build/container-runtime/auth/creds-store.js.map +1 -0
- package/{dist/src/registry-auth-locator → build/container-runtime/auth}/get-auth-config.d.ts +1 -1
- package/{dist/src/registry-auth-locator → build/container-runtime/auth}/get-auth-config.js +11 -19
- package/build/container-runtime/auth/get-auth-config.js.map +1 -0
- package/build/container-runtime/auth/registry-auth-locator.d.ts +5 -0
- package/build/container-runtime/auth/registry-auth-locator.js +3 -0
- package/build/container-runtime/auth/registry-auth-locator.js.map +1 -0
- package/{dist/src/registry-auth-locator → build/container-runtime/auth}/registry-matches.js +1 -0
- package/build/container-runtime/auth/registry-matches.js.map +1 -0
- package/{dist/src/registry-auth-locator → build/container-runtime/auth}/types.d.ts +13 -1
- package/{dist/src/registry-auth-locator → build/container-runtime/auth}/types.js +1 -0
- package/build/container-runtime/auth/types.js.map +1 -0
- package/build/container-runtime/clients/client.d.ts +14 -0
- package/build/container-runtime/clients/client.js +105 -0
- package/build/container-runtime/clients/client.js.map +1 -0
- package/build/container-runtime/clients/compose/compose-client.d.ts +11 -0
- package/build/container-runtime/clients/compose/compose-client.js +238 -0
- package/build/container-runtime/clients/compose/compose-client.js.map +1 -0
- package/build/container-runtime/clients/compose/default-compose-options.d.ts +4 -0
- package/build/container-runtime/clients/compose/default-compose-options.js +31 -0
- package/build/container-runtime/clients/compose/default-compose-options.js.map +1 -0
- package/build/container-runtime/clients/compose/parse-compose-container-name.d.ts +1 -0
- package/{dist/src/docker-compose/container-name-resolver.js → build/container-runtime/clients/compose/parse-compose-container-name.js} +5 -4
- package/build/container-runtime/clients/compose/parse-compose-container-name.js.map +1 -0
- package/build/container-runtime/clients/compose/types.d.ts +15 -0
- package/{dist/src/docker → build/container-runtime/clients/compose}/types.js +1 -0
- package/build/container-runtime/clients/compose/types.js.map +1 -0
- package/build/container-runtime/clients/container/container-client.d.ts +32 -0
- package/build/container-runtime/clients/container/container-client.js +3 -0
- package/build/container-runtime/clients/container/container-client.js.map +1 -0
- package/build/container-runtime/clients/container/docker-container-client.d.ts +35 -0
- package/build/container-runtime/clients/container/docker-container-client.js +276 -0
- package/build/container-runtime/clients/container/docker-container-client.js.map +1 -0
- package/build/container-runtime/clients/container/podman-container-client.d.ts +8 -0
- package/build/container-runtime/clients/container/podman-container-client.js +43 -0
- package/build/container-runtime/clients/container/podman-container-client.js.map +1 -0
- package/build/container-runtime/clients/container/types.d.ts +4 -0
- package/{dist/src/docker/client/docker-client-types.js → build/container-runtime/clients/container/types.js} +1 -0
- package/build/container-runtime/clients/container/types.js.map +1 -0
- package/build/container-runtime/clients/image/docker-image-client.d.ts +16 -0
- package/build/container-runtime/clients/image/docker-image-client.js +119 -0
- package/build/container-runtime/clients/image/docker-image-client.js.map +1 -0
- package/build/container-runtime/clients/image/image-client.d.ts +9 -0
- package/build/container-runtime/clients/image/image-client.js +3 -0
- package/build/container-runtime/clients/image/image-client.js.map +1 -0
- package/build/container-runtime/clients/network/docker-network-client.d.ts +9 -0
- package/build/container-runtime/clients/network/docker-network-client.js +50 -0
- package/build/container-runtime/clients/network/docker-network-client.js.map +1 -0
- package/build/container-runtime/clients/network/network-client.d.ts +6 -0
- package/build/container-runtime/clients/network/network-client.js +3 -0
- package/build/container-runtime/clients/network/network-client.js.map +1 -0
- package/build/container-runtime/clients/types.d.ts +30 -0
- package/{dist/src/docker/client/strategy/docker-client-strategy.js → build/container-runtime/clients/types.js} +1 -0
- package/build/container-runtime/clients/types.js.map +1 -0
- package/build/container-runtime/image-name.d.ts +11 -0
- package/{dist/src/docker-image-name.js → build/container-runtime/image-name.js} +11 -17
- package/build/container-runtime/image-name.js.map +1 -0
- package/build/container-runtime/index.d.ts +6 -0
- package/build/container-runtime/index.js +13 -0
- package/build/container-runtime/index.js.map +1 -0
- package/build/container-runtime/strategies/configuration-strategy.d.ts +9 -0
- package/build/container-runtime/strategies/configuration-strategy.js +53 -0
- package/build/container-runtime/strategies/configuration-strategy.js.map +1 -0
- package/build/container-runtime/strategies/npipe-socket-strategy.d.ts +6 -0
- package/build/container-runtime/strategies/npipe-socket-strategy.js +21 -0
- package/build/container-runtime/strategies/npipe-socket-strategy.js.map +1 -0
- package/build/container-runtime/strategies/rootless-unix-socket-strategy.d.ts +14 -0
- package/build/container-runtime/strategies/rootless-unix-socket-strategy.js +63 -0
- package/build/container-runtime/strategies/rootless-unix-socket-strategy.js.map +1 -0
- package/build/container-runtime/strategies/strategy.d.ts +5 -0
- package/{dist/src/registry-auth-locator/registry-auth-locator.js → build/container-runtime/strategies/strategy.js} +1 -0
- package/build/container-runtime/strategies/strategy.js.map +1 -0
- package/build/container-runtime/strategies/testcontainers-host-strategy.d.ts +6 -0
- package/build/container-runtime/strategies/testcontainers-host-strategy.js +30 -0
- package/build/container-runtime/strategies/testcontainers-host-strategy.js.map +1 -0
- package/build/container-runtime/strategies/types.d.ts +8 -0
- package/build/container-runtime/strategies/types.js +3 -0
- package/build/container-runtime/strategies/types.js.map +1 -0
- package/build/container-runtime/strategies/unix-socket-strategy.d.ts +6 -0
- package/build/container-runtime/strategies/unix-socket-strategy.js +22 -0
- package/build/container-runtime/strategies/unix-socket-strategy.js.map +1 -0
- package/build/container-runtime/strategies/utils/config.d.ts +9 -0
- package/build/container-runtime/strategies/utils/config.js +75 -0
- package/build/container-runtime/strategies/utils/config.js.map +1 -0
- package/build/container-runtime/utils/attach-container.js +17 -0
- package/build/container-runtime/utils/attach-container.js.map +1 -0
- package/build/container-runtime/utils/demux-stream.d.ts +4 -0
- package/build/container-runtime/utils/demux-stream.js +24 -0
- package/build/container-runtime/utils/demux-stream.js.map +1 -0
- package/build/container-runtime/utils/image-exists.d.ts +3 -0
- package/build/container-runtime/utils/image-exists.js +29 -0
- package/build/container-runtime/utils/image-exists.js.map +1 -0
- package/build/container-runtime/utils/lookup-host-ips.d.ts +2 -0
- package/build/container-runtime/utils/lookup-host-ips.js +18 -0
- package/build/container-runtime/utils/lookup-host-ips.js.map +1 -0
- package/{dist/src/docker/functions/image → build/container-runtime/utils}/pull-image.d.ts +2 -2
- package/build/container-runtime/utils/pull-image.js +35 -0
- package/build/container-runtime/utils/pull-image.js.map +1 -0
- package/build/container-runtime/utils/remote-container-runtime-socket-path.d.ts +7 -0
- package/build/container-runtime/utils/remote-container-runtime-socket-path.js +23 -0
- package/build/container-runtime/utils/remote-container-runtime-socket-path.js.map +1 -0
- package/build/container-runtime/utils/resolve-host.d.ts +8 -0
- package/build/container-runtime/utils/resolve-host.js +54 -0
- package/build/container-runtime/utils/resolve-host.js.map +1 -0
- package/build/container-runtime/utils/run-in-container.js +30 -0
- package/build/container-runtime/utils/run-in-container.js.map +1 -0
- package/build/container-runtime/utils/start-container.js +15 -0
- package/build/container-runtime/utils/start-container.js.map +1 -0
- package/{dist/src → build}/docker-compose-environment/docker-compose-environment.d.ts +5 -5
- package/build/docker-compose-environment/docker-compose-environment.js +144 -0
- package/build/docker-compose-environment/docker-compose-environment.js.map +1 -0
- package/{dist/src → build}/docker-compose-environment/downed-docker-compose-environment.js +1 -0
- package/build/docker-compose-environment/downed-docker-compose-environment.js.map +1 -0
- package/{dist/src → build}/docker-compose-environment/started-docker-compose-environment.d.ts +3 -3
- package/build/docker-compose-environment/started-docker-compose-environment.js +37 -0
- package/build/docker-compose-environment/started-docker-compose-environment.js.map +1 -0
- package/build/docker-compose-environment/stopped-docker-compose-environment.d.ts +7 -0
- package/build/docker-compose-environment/stopped-docker-compose-environment.js +19 -0
- package/build/docker-compose-environment/stopped-docker-compose-environment.js.map +1 -0
- package/{dist/src/modules → build/generic-container}/abstract-started-container.d.ts +1 -1
- package/build/generic-container/abstract-started-container.js +69 -0
- package/build/generic-container/abstract-started-container.js.map +1 -0
- package/{dist/src/modules → build/generic-container}/abstract-stopped-container.js +2 -0
- package/build/generic-container/abstract-stopped-container.js.map +1 -0
- package/{dist/src → build}/generic-container/generic-container-builder.d.ts +4 -4
- package/build/generic-container/generic-container-builder.js +87 -0
- package/build/generic-container/generic-container-builder.js.map +1 -0
- package/{dist/src → build}/generic-container/generic-container.d.ts +18 -22
- package/build/generic-container/generic-container.js +350 -0
- package/build/generic-container/generic-container.js.map +1 -0
- package/{dist/src → build}/generic-container/started-generic-container.d.ts +6 -6
- package/build/generic-container/started-generic-container.js +161 -0
- package/build/generic-container/started-generic-container.js.map +1 -0
- package/build/generic-container/stopped-generic-container.js +23 -0
- package/build/generic-container/stopped-generic-container.js.map +1 -0
- package/build/index.d.ts +16 -0
- package/build/index.js +35 -0
- package/build/index.js.map +1 -0
- package/build/network/network.d.ts +19 -0
- package/build/network/network.js +61 -0
- package/build/network/network.js.map +1 -0
- package/{dist/src → build/port-forwarder}/port-forwarder.d.ts +2 -1
- package/build/port-forwarder/port-forwarder.js +73 -0
- package/build/port-forwarder/port-forwarder.js.map +1 -0
- package/build/reaper/reaper.d.ts +8 -0
- package/build/reaper/reaper.js +119 -0
- package/build/reaper/reaper.js.map +1 -0
- package/{dist/src → build}/test-container.d.ts +6 -6
- package/{dist/src → build}/test-container.js +1 -0
- package/build/test-container.js.map +1 -0
- package/build/test-containers.js +12 -0
- package/build/test-containers.js.map +1 -0
- package/{dist/src/docker → build}/types.d.ts +16 -0
- package/build/types.js +3 -0
- package/build/types.js.map +1 -0
- package/{dist/src → build/utils}/bound-ports.d.ts +4 -3
- package/{dist/src → build/utils}/bound-ports.js +22 -5
- package/build/utils/bound-ports.js.map +1 -0
- package/build/utils/dockerfile-parser.d.ts +3 -0
- package/build/utils/dockerfile-parser.js +28 -0
- package/build/utils/dockerfile-parser.js.map +1 -0
- package/{dist/src → build/utils}/labels.d.ts +1 -0
- package/build/utils/labels.js +18 -0
- package/build/utils/labels.js.map +1 -0
- package/build/utils/map-inspect-result.d.ts +3 -0
- package/build/utils/map-inspect-result.js +55 -0
- package/build/utils/map-inspect-result.js.map +1 -0
- package/build/utils/port-generator.js +43 -0
- package/build/utils/port-generator.js.map +1 -0
- package/{dist/src → build/utils}/port.d.ts +0 -3
- package/build/utils/port.js +10 -0
- package/build/utils/port.js.map +1 -0
- package/build/utils/pull-policy.d.ts +7 -0
- package/build/utils/pull-policy.js +23 -0
- package/build/utils/pull-policy.js.map +1 -0
- package/build/utils/test-helper.d.ts +19 -0
- package/build/utils/test-helper.js +107 -0
- package/build/utils/test-helper.js.map +1 -0
- package/build/version.d.ts +1 -0
- package/build/version.js +5 -0
- package/build/version.js.map +1 -0
- package/{dist/src/wait-strategy → build/wait-strategies}/composite-wait-strategy.d.ts +1 -1
- package/build/wait-strategies/composite-wait-strategy.js +49 -0
- package/build/wait-strategies/composite-wait-strategy.js.map +1 -0
- package/build/wait-strategies/health-check-wait-strategy.js +26 -0
- package/build/wait-strategies/health-check-wait-strategy.js.map +1 -0
- package/{dist/src/wait-strategy → build/wait-strategies}/host-port-wait-strategy.d.ts +1 -1
- package/build/wait-strategies/host-port-wait-strategy.js +42 -0
- package/build/wait-strategies/host-port-wait-strategy.js.map +1 -0
- package/{dist/src/wait-strategy → build/wait-strategies}/http-wait-strategy.d.ts +1 -1
- package/build/wait-strategies/http-wait-strategy.js +111 -0
- package/build/wait-strategies/http-wait-strategy.js.map +1 -0
- package/{dist/src/wait-strategy → build/wait-strategies}/log-wait-strategy.d.ts +1 -1
- package/build/wait-strategies/log-wait-strategy.js +62 -0
- package/build/wait-strategies/log-wait-strategy.js.map +1 -0
- package/build/wait-strategies/shell-wait-strategy.js +30 -0
- package/build/wait-strategies/shell-wait-strategy.js.map +1 -0
- package/{dist/src/wait-strategy → build/wait-strategies}/startup-check-strategy.d.ts +3 -0
- package/build/wait-strategies/startup-check-strategy.js +27 -0
- package/build/wait-strategies/startup-check-strategy.js.map +1 -0
- package/{dist/src → build/wait-strategies/utils}/port-check.d.ts +5 -6
- package/build/wait-strategies/utils/port-check.js +81 -0
- package/build/wait-strategies/utils/port-check.js.map +1 -0
- package/build/wait-strategies/wait-for-container.d.ts +5 -0
- package/build/wait-strategies/wait-for-container.js +24 -0
- package/build/wait-strategies/wait-for-container.js.map +1 -0
- package/{dist/src/wait-strategy → build/wait-strategies}/wait-strategy.d.ts +1 -1
- package/{dist/src/wait-strategy → build/wait-strategies}/wait-strategy.js +3 -4
- package/build/wait-strategies/wait-strategy.js.map +1 -0
- package/{dist/src/wait-strategy → build/wait-strategies}/wait.js +1 -0
- package/build/wait-strategies/wait.js.map +1 -0
- package/package.json +18 -63
- package/LICENSE +0 -21
- package/README.md +0 -27
- package/dist/package.json +0 -104
- package/dist/src/docker/client/docker-client-config.d.ts +0 -9
- package/dist/src/docker/client/docker-client-config.js +0 -82
- package/dist/src/docker/client/docker-client-types.d.ts +0 -23
- package/dist/src/docker/client/docker-client.d.ts +0 -2
- package/dist/src/docker/client/docker-client.js +0 -133
- package/dist/src/docker/client/strategy/configuration-strategy.d.ts +0 -11
- package/dist/src/docker/client/strategy/configuration-strategy.js +0 -66
- package/dist/src/docker/client/strategy/docker-client-strategy.d.ts +0 -7
- package/dist/src/docker/client/strategy/npipe-socket-strategy.d.ts +0 -7
- package/dist/src/docker/client/strategy/npipe-socket-strategy.js +0 -31
- package/dist/src/docker/client/strategy/rootless-unix-socket-strategy.d.ts +0 -18
- package/dist/src/docker/client/strategy/rootless-unix-socket-strategy.js +0 -77
- package/dist/src/docker/client/strategy/testcontainers-host-strategy.d.ts +0 -9
- package/dist/src/docker/client/strategy/testcontainers-host-strategy.js +0 -47
- package/dist/src/docker/client/strategy/unix-socket-strategy.d.ts +0 -7
- package/dist/src/docker/client/strategy/unix-socket-strategy.js +0 -32
- package/dist/src/docker/functions/container/attach-container.js +0 -25
- package/dist/src/docker/functions/container/container-logs.d.ts +0 -6
- package/dist/src/docker/functions/container/container-logs.js +0 -32
- package/dist/src/docker/functions/container/create-container.d.ts +0 -31
- package/dist/src/docker/functions/container/create-container.js +0 -117
- package/dist/src/docker/functions/container/exec-container.d.ts +0 -3
- package/dist/src/docker/functions/container/exec-container.js +0 -66
- package/dist/src/docker/functions/container/get-container-archive.d.ts +0 -11
- package/dist/src/docker/functions/container/get-container-archive.js +0 -23
- package/dist/src/docker/functions/container/get-container.d.ts +0 -3
- package/dist/src/docker/functions/container/get-container.js +0 -49
- package/dist/src/docker/functions/container/inspect-container.d.ts +0 -19
- package/dist/src/docker/functions/container/inspect-container.js +0 -67
- package/dist/src/docker/functions/container/list-containers.d.ts +0 -2
- package/dist/src/docker/functions/container/list-containers.js +0 -25
- package/dist/src/docker/functions/container/put-container-archive.d.ts +0 -9
- package/dist/src/docker/functions/container/put-container-archive.js +0 -26
- package/dist/src/docker/functions/container/remove-container.d.ts +0 -5
- package/dist/src/docker/functions/container/remove-container.js +0 -23
- package/dist/src/docker/functions/container/restart-container.d.ts +0 -5
- package/dist/src/docker/functions/container/restart-container.js +0 -23
- package/dist/src/docker/functions/container/start-container.js +0 -23
- package/dist/src/docker/functions/container/stop-container.d.ts +0 -5
- package/dist/src/docker/functions/container/stop-container.js +0 -29
- package/dist/src/docker/functions/create-labels.d.ts +0 -2
- package/dist/src/docker/functions/create-labels.js +0 -13
- package/dist/src/docker/functions/demux-stream.d.ts +0 -3
- package/dist/src/docker/functions/demux-stream.js +0 -32
- package/dist/src/docker/functions/get-info.d.ts +0 -11
- package/dist/src/docker/functions/get-info.js +0 -38
- package/dist/src/docker/functions/image/build-image.d.ts +0 -14
- package/dist/src/docker/functions/image/build-image.js +0 -81
- package/dist/src/docker/functions/image/image-exists.d.ts +0 -3
- package/dist/src/docker/functions/image/image-exists.js +0 -37
- package/dist/src/docker/functions/image/pull-image.js +0 -48
- package/dist/src/docker/functions/network/connect-network.d.ts +0 -6
- package/dist/src/docker/functions/network/connect-network.js +0 -28
- package/dist/src/docker/functions/network/create-network.d.ts +0 -16
- package/dist/src/docker/functions/network/create-network.js +0 -39
- package/dist/src/docker/functions/network/remove-network.d.ts +0 -1
- package/dist/src/docker/functions/network/remove-network.js +0 -31
- package/dist/src/docker/functions/run-in-container.js +0 -39
- package/dist/src/docker/lookup-host-ips.d.ts +0 -5
- package/dist/src/docker/lookup-host-ips.js +0 -26
- package/dist/src/docker/remote-docker-unix-socket-path.d.ts +0 -7
- package/dist/src/docker/remote-docker-unix-socket-path.js +0 -22
- package/dist/src/docker/resolve-host.d.ts +0 -8
- package/dist/src/docker/resolve-host.js +0 -63
- package/dist/src/docker-compose/container-name-resolver.d.ts +0 -1
- package/dist/src/docker-compose/docker-compose-client.d.ts +0 -9
- package/dist/src/docker-compose/docker-compose-client.js +0 -221
- package/dist/src/docker-compose/docker-compose-options.d.ts +0 -17
- package/dist/src/docker-compose/docker-compose-options.js +0 -51
- package/dist/src/docker-compose-environment/docker-compose-environment.js +0 -146
- package/dist/src/docker-compose-environment/started-docker-compose-environment.js +0 -47
- package/dist/src/docker-compose-environment/stopped-docker-compose-environment.d.ts +0 -7
- package/dist/src/docker-compose-environment/stopped-docker-compose-environment.js +0 -28
- package/dist/src/docker-image-name.d.ts +0 -15
- package/dist/src/dockerfile-parser.d.ts +0 -3
- package/dist/src/dockerfile-parser.js +0 -39
- package/dist/src/file-lock.js +0 -47
- package/dist/src/generic-container/create-container-options.d.ts +0 -3
- package/dist/src/generic-container/create-container-options.js +0 -18
- package/dist/src/generic-container/generic-container-builder.js +0 -97
- package/dist/src/generic-container/generic-container.js +0 -329
- package/dist/src/generic-container/started-generic-container.js +0 -168
- package/dist/src/generic-container/stopped-generic-container.js +0 -20
- package/dist/src/hash.d.ts +0 -1
- package/dist/src/images.d.ts +0 -2
- package/dist/src/images.js +0 -6
- package/dist/src/index.d.ts +0 -25
- package/dist/src/index.js +0 -66
- package/dist/src/labels.js +0 -8
- package/dist/src/modules/abstract-started-container.js +0 -86
- package/dist/src/modules/arangodb/arangodb-container.d.ts +0 -19
- package/dist/src/modules/arangodb/arangodb-container.js +0 -60
- package/dist/src/modules/elasticsearch/elasticsearch-container.d.ts +0 -12
- package/dist/src/modules/elasticsearch/elasticsearch-container.js +0 -49
- package/dist/src/modules/hivemq/hivemq-container.d.ts +0 -15
- package/dist/src/modules/hivemq/hivemq-container.js +0 -79
- package/dist/src/modules/kafka/kafka-container.d.ts +0 -45
- package/dist/src/modules/kafka/kafka-container.js +0 -177
- package/dist/src/modules/mongodb/mongodb-container.d.ts +0 -19
- package/dist/src/modules/mongodb/mongodb-container.js +0 -85
- package/dist/src/modules/mysql/mysql-container.d.ts +0 -30
- package/dist/src/modules/mysql/mysql-container.js +0 -111
- package/dist/src/modules/nats/nats-container.d.ts +0 -55
- package/dist/src/modules/nats/nats-container.js +0 -99
- package/dist/src/modules/neo4j/neo4j-container.d.ts +0 -23
- package/dist/src/modules/neo4j/neo4j-container.js +0 -82
- package/dist/src/modules/postgresql/postgresql-container.d.ts +0 -28
- package/dist/src/modules/postgresql/postgresql-container.js +0 -87
- package/dist/src/modules/selenium/selenium-container.d.ts +0 -38
- package/dist/src/modules/selenium/selenium-container.js +0 -161
- package/dist/src/network.d.ts +0 -18
- package/dist/src/network.js +0 -60
- package/dist/src/port-check.js +0 -90
- package/dist/src/port-forwarder.js +0 -83
- package/dist/src/port-generator.js +0 -51
- package/dist/src/port.js +0 -47
- package/dist/src/pull-policy.d.ts +0 -9
- package/dist/src/pull-policy.js +0 -15
- package/dist/src/reaper.d.ts +0 -5
- package/dist/src/reaper.js +0 -157
- package/dist/src/registry-auth-locator/auths.d.ts +0 -8
- package/dist/src/registry-auth-locator/auths.js +0 -56
- package/dist/src/registry-auth-locator/cred-helpers.d.ts +0 -6
- package/dist/src/registry-auth-locator/credential-provider.js +0 -81
- package/dist/src/registry-auth-locator/creds-store.d.ts +0 -6
- package/dist/src/registry-auth-locator/registry-auth-locator.d.ts +0 -6
- package/dist/src/retry-strategy.js +0 -46
- package/dist/src/stream-utils.js +0 -46
- package/dist/src/system-info.d.ts +0 -19
- package/dist/src/system-info.js +0 -80
- package/dist/src/test-containers.js +0 -22
- package/dist/src/wait-for-container.d.ts +0 -4
- package/dist/src/wait-for-container.js +0 -34
- package/dist/src/wait-strategy/composite-wait-strategy.js +0 -57
- package/dist/src/wait-strategy/health-check-wait-strategy.js +0 -36
- package/dist/src/wait-strategy/host-port-wait-strategy.js +0 -59
- package/dist/src/wait-strategy/http-wait-strategy.js +0 -120
- package/dist/src/wait-strategy/log-wait-strategy.js +0 -69
- package/dist/src/wait-strategy/shell-wait-strategy.js +0 -39
- package/dist/src/wait-strategy/startup-check-strategy.js +0 -35
- /package/{dist/src → build/common}/clock.d.ts +0 -0
- /package/{dist/src → build/common}/file-lock.d.ts +0 -0
- /package/{dist/src/stream-utils.d.ts → build/common/streams.d.ts} +0 -0
- /package/{dist/src → build/common}/type-guards.d.ts +0 -0
- /package/{dist/src → build/common}/uuid.d.ts +0 -0
- /package/{dist/src/registry-auth-locator → build/container-runtime/auth}/registry-matches.d.ts +0 -0
- /package/{dist/src/docker/functions/container → build/container-runtime/utils}/attach-container.d.ts +0 -0
- /package/{dist/src/docker/functions → build/container-runtime/utils}/run-in-container.d.ts +0 -0
- /package/{dist/src/docker/functions/container → build/container-runtime/utils}/start-container.d.ts +0 -0
- /package/{dist/src → build}/docker-compose-environment/downed-docker-compose-environment.d.ts +0 -0
- /package/{dist/src/modules → build/generic-container}/abstract-stopped-container.d.ts +0 -0
- /package/{dist/src → build}/generic-container/stopped-generic-container.d.ts +0 -0
- /package/{dist/src → build}/test-containers.d.ts +0 -0
- /package/{dist/src → build/utils}/port-generator.d.ts +0 -0
- /package/{dist/src/wait-strategy → build/wait-strategies}/health-check-wait-strategy.d.ts +0 -0
- /package/{dist/src/wait-strategy → build/wait-strategies}/shell-wait-strategy.d.ts +0 -0
- /package/{dist/src/wait-strategy → build/wait-strategies}/wait.d.ts +0 -0
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.TestContainers = void 0;
|
|
13
|
-
const port_forwarder_1 = require("./port-forwarder");
|
|
14
|
-
class TestContainers {
|
|
15
|
-
static exposeHostPorts(...ports) {
|
|
16
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
17
|
-
const portForwarder = yield port_forwarder_1.PortForwarderInstance.getInstance();
|
|
18
|
-
yield Promise.all(ports.map((port) => portForwarder.exposeHostPort(port)));
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
exports.TestContainers = TestContainers;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import Dockerode from "dockerode";
|
|
2
|
-
import { BoundPorts } from "./bound-ports";
|
|
3
|
-
import { WaitStrategy } from "./wait-strategy/wait-strategy";
|
|
4
|
-
export declare const waitForContainer: (container: Dockerode.Container, waitStrategy: WaitStrategy, boundPorts: BoundPorts, startTime?: Date) => Promise<void>;
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.waitForContainer = void 0;
|
|
13
|
-
const logger_1 = require("./logger");
|
|
14
|
-
const stop_container_1 = require("./docker/functions/container/stop-container");
|
|
15
|
-
const remove_container_1 = require("./docker/functions/container/remove-container");
|
|
16
|
-
const waitForContainer = (container, waitStrategy, boundPorts, startTime) => __awaiter(void 0, void 0, void 0, function* () {
|
|
17
|
-
logger_1.log.debug(`Waiting for container to be ready...`, { containerId: container.id });
|
|
18
|
-
try {
|
|
19
|
-
yield waitStrategy.waitUntilReady(container, boundPorts, startTime);
|
|
20
|
-
logger_1.log.info(`Container is ready`, { containerId: container.id });
|
|
21
|
-
}
|
|
22
|
-
catch (err) {
|
|
23
|
-
logger_1.log.error(`Container failed to be ready: ${err}`, { containerId: container.id });
|
|
24
|
-
try {
|
|
25
|
-
yield (0, stop_container_1.stopContainer)(container, { timeout: 0 });
|
|
26
|
-
yield (0, remove_container_1.removeContainer)(container, { removeVolumes: true });
|
|
27
|
-
}
|
|
28
|
-
catch (stopErr) {
|
|
29
|
-
logger_1.log.error(`Failed to stop container after it failed to be ready: ${stopErr}`, { containerId: container.id });
|
|
30
|
-
}
|
|
31
|
-
throw err;
|
|
32
|
-
}
|
|
33
|
-
});
|
|
34
|
-
exports.waitForContainer = waitForContainer;
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.CompositeWaitStrategy = void 0;
|
|
13
|
-
const wait_strategy_1 = require("./wait-strategy");
|
|
14
|
-
const logger_1 = require("../logger");
|
|
15
|
-
class CompositeWaitStrategy extends wait_strategy_1.AbstractWaitStrategy {
|
|
16
|
-
constructor(waitStrategies) {
|
|
17
|
-
super();
|
|
18
|
-
this.waitStrategies = waitStrategies;
|
|
19
|
-
}
|
|
20
|
-
waitUntilReady(container, boundPorts, startTime) {
|
|
21
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
22
|
-
logger_1.log.debug(`Waiting for composite...`, { containerId: container.id });
|
|
23
|
-
return new Promise((resolve, reject) => {
|
|
24
|
-
let deadlineTimeout;
|
|
25
|
-
if (this.deadline !== undefined) {
|
|
26
|
-
deadlineTimeout = setTimeout(() => {
|
|
27
|
-
const message = `Composite wait strategy not successful after ${this.deadline}ms`;
|
|
28
|
-
logger_1.log.error(message, { containerId: container.id });
|
|
29
|
-
reject(new Error(message));
|
|
30
|
-
}, this.deadline);
|
|
31
|
-
}
|
|
32
|
-
Promise.all(this.waitStrategies.map((waitStrategy) => waitStrategy.waitUntilReady(container, boundPorts, startTime)))
|
|
33
|
-
.then(() => {
|
|
34
|
-
logger_1.log.debug(`Composite wait strategy complete`, { containerId: container.id });
|
|
35
|
-
resolve();
|
|
36
|
-
})
|
|
37
|
-
.catch((err) => reject(err))
|
|
38
|
-
.finally(() => {
|
|
39
|
-
if (deadlineTimeout) {
|
|
40
|
-
clearTimeout(deadlineTimeout);
|
|
41
|
-
}
|
|
42
|
-
});
|
|
43
|
-
});
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
withStartupTimeout(startupTimeout) {
|
|
47
|
-
this.waitStrategies
|
|
48
|
-
.filter((waitStrategy) => !waitStrategy.isStartupTimeoutSet())
|
|
49
|
-
.forEach((waitStrategy) => waitStrategy.withStartupTimeout(startupTimeout));
|
|
50
|
-
return this;
|
|
51
|
-
}
|
|
52
|
-
withDeadline(deadline) {
|
|
53
|
-
this.deadline = deadline;
|
|
54
|
-
return this;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
exports.CompositeWaitStrategy = CompositeWaitStrategy;
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.HealthCheckWaitStrategy = void 0;
|
|
13
|
-
const logger_1 = require("../logger");
|
|
14
|
-
const retry_strategy_1 = require("../retry-strategy");
|
|
15
|
-
const inspect_container_1 = require("../docker/functions/container/inspect-container");
|
|
16
|
-
const wait_strategy_1 = require("./wait-strategy");
|
|
17
|
-
class HealthCheckWaitStrategy extends wait_strategy_1.AbstractWaitStrategy {
|
|
18
|
-
waitUntilReady(container) {
|
|
19
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
20
|
-
logger_1.log.debug(`Waiting for health check...`, { containerId: container.id });
|
|
21
|
-
const status = yield new retry_strategy_1.IntervalRetryStrategy(100).retryUntil(() => __awaiter(this, void 0, void 0, function* () { return (yield (0, inspect_container_1.inspectContainer)(container)).healthCheckStatus; }), (healthCheckStatus) => healthCheckStatus === "healthy" || healthCheckStatus === "unhealthy", () => {
|
|
22
|
-
const timeout = this.startupTimeout;
|
|
23
|
-
const message = `Health check not healthy after ${timeout}ms`;
|
|
24
|
-
logger_1.log.error(message, { containerId: container.id });
|
|
25
|
-
throw new Error(message);
|
|
26
|
-
}, this.startupTimeout);
|
|
27
|
-
if (status !== "healthy") {
|
|
28
|
-
const message = `Health check failed: ${status}`;
|
|
29
|
-
logger_1.log.error(message, { containerId: container.id });
|
|
30
|
-
throw new Error(message);
|
|
31
|
-
}
|
|
32
|
-
logger_1.log.debug(`Health check wait strategy complete`, { containerId: container.id });
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
exports.HealthCheckWaitStrategy = HealthCheckWaitStrategy;
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.HostPortWaitStrategy = void 0;
|
|
13
|
-
const port_check_1 = require("../port-check");
|
|
14
|
-
const logger_1 = require("../logger");
|
|
15
|
-
const retry_strategy_1 = require("../retry-strategy");
|
|
16
|
-
const wait_strategy_1 = require("./wait-strategy");
|
|
17
|
-
const docker_client_1 = require("../docker/client/docker-client");
|
|
18
|
-
class HostPortWaitStrategy extends wait_strategy_1.AbstractWaitStrategy {
|
|
19
|
-
waitUntilReady(container, boundPorts) {
|
|
20
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
21
|
-
const { dockerode, containerRuntime, host } = yield (0, docker_client_1.getDockerClient)();
|
|
22
|
-
const hostPortCheck = new port_check_1.HostPortCheck(host);
|
|
23
|
-
const internalPortCheck = new port_check_1.InternalPortCheck(dockerode, containerRuntime, container);
|
|
24
|
-
yield Promise.all([
|
|
25
|
-
this.waitForHostPorts(hostPortCheck, container, boundPorts),
|
|
26
|
-
this.waitForInternalPorts(internalPortCheck, container, boundPorts),
|
|
27
|
-
]);
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
waitForHostPorts(portCheck, container, boundPorts) {
|
|
31
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
32
|
-
for (const [, hostPort] of boundPorts.iterator()) {
|
|
33
|
-
logger_1.log.debug(`Waiting for host port ${hostPort}...`, { containerId: container.id });
|
|
34
|
-
yield this.waitForPort(container, hostPort, portCheck);
|
|
35
|
-
logger_1.log.debug(`Host port ${hostPort} ready`, { containerId: container.id });
|
|
36
|
-
}
|
|
37
|
-
logger_1.log.debug(`Host port wait strategy complete`, { containerId: container.id });
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
waitForInternalPorts(portCheck, container, boundPorts) {
|
|
41
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
42
|
-
for (const [internalPort] of boundPorts.iterator()) {
|
|
43
|
-
logger_1.log.debug(`Waiting for internal port ${internalPort}...`, { containerId: container.id });
|
|
44
|
-
yield this.waitForPort(container, internalPort, portCheck);
|
|
45
|
-
logger_1.log.debug(`Internal port ${internalPort} ready`, { containerId: container.id });
|
|
46
|
-
}
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
waitForPort(container, port, portCheck) {
|
|
50
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
51
|
-
yield new retry_strategy_1.IntervalRetryStrategy(100).retryUntil(() => portCheck.isBound(port), (isBound) => isBound, () => {
|
|
52
|
-
const message = `Port ${port} not bound after ${this.startupTimeout}ms`;
|
|
53
|
-
logger_1.log.error(message, { containerId: container.id });
|
|
54
|
-
throw new Error(message);
|
|
55
|
-
}, this.startupTimeout);
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
exports.HostPortWaitStrategy = HostPortWaitStrategy;
|
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.HttpWaitStrategy = void 0;
|
|
16
|
-
const wait_strategy_1 = require("./wait-strategy");
|
|
17
|
-
const retry_strategy_1 = require("../retry-strategy");
|
|
18
|
-
const node_fetch_1 = __importDefault(require("node-fetch"));
|
|
19
|
-
const https_1 = __importDefault(require("https"));
|
|
20
|
-
const docker_client_1 = require("../docker/client/docker-client");
|
|
21
|
-
const logger_1 = require("../logger");
|
|
22
|
-
class HttpWaitStrategy extends wait_strategy_1.AbstractWaitStrategy {
|
|
23
|
-
constructor(path, port) {
|
|
24
|
-
super();
|
|
25
|
-
this.protocol = "http";
|
|
26
|
-
this.method = "GET";
|
|
27
|
-
this.headers = {};
|
|
28
|
-
this.predicates = [];
|
|
29
|
-
this._allowInsecure = false;
|
|
30
|
-
this.readTimeout = 1000;
|
|
31
|
-
this.path = path;
|
|
32
|
-
this.port = port;
|
|
33
|
-
}
|
|
34
|
-
forStatusCode(statusCode) {
|
|
35
|
-
this.predicates.push((response) => __awaiter(this, void 0, void 0, function* () { return response.status === statusCode; }));
|
|
36
|
-
return this;
|
|
37
|
-
}
|
|
38
|
-
forStatusCodeMatching(predicate) {
|
|
39
|
-
this.predicates.push((response) => __awaiter(this, void 0, void 0, function* () { return predicate(response.status); }));
|
|
40
|
-
return this;
|
|
41
|
-
}
|
|
42
|
-
forResponsePredicate(predicate) {
|
|
43
|
-
this.predicates.push((response) => __awaiter(this, void 0, void 0, function* () { return predicate(yield response.text()); }));
|
|
44
|
-
return this;
|
|
45
|
-
}
|
|
46
|
-
withMethod(method) {
|
|
47
|
-
this.method = method;
|
|
48
|
-
return this;
|
|
49
|
-
}
|
|
50
|
-
withHeaders(headers) {
|
|
51
|
-
this.headers = Object.assign(Object.assign({}, this.headers), headers);
|
|
52
|
-
return this;
|
|
53
|
-
}
|
|
54
|
-
withBasicCredentials(username, password) {
|
|
55
|
-
const base64Encoded = Buffer.from(`${username}:${password}`).toString("base64");
|
|
56
|
-
this.headers = Object.assign(Object.assign({}, this.headers), { Authorization: `Basic ${base64Encoded}` });
|
|
57
|
-
return this;
|
|
58
|
-
}
|
|
59
|
-
withReadTimeout(readTimeout) {
|
|
60
|
-
this.readTimeout = readTimeout;
|
|
61
|
-
return this;
|
|
62
|
-
}
|
|
63
|
-
usingTls() {
|
|
64
|
-
this.protocol = "https";
|
|
65
|
-
return this;
|
|
66
|
-
}
|
|
67
|
-
allowInsecure() {
|
|
68
|
-
this._allowInsecure = true;
|
|
69
|
-
return this;
|
|
70
|
-
}
|
|
71
|
-
waitUntilReady(container, boundPorts) {
|
|
72
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
73
|
-
logger_1.log.debug(`Waiting for HTTP...`, { containerId: container.id });
|
|
74
|
-
const { host } = yield (0, docker_client_1.getDockerClient)();
|
|
75
|
-
yield new retry_strategy_1.IntervalRetryStrategy(this.readTimeout).retryUntil(() => __awaiter(this, void 0, void 0, function* () {
|
|
76
|
-
try {
|
|
77
|
-
const url = `${this.protocol}://${host}:${boundPorts.getBinding(this.port)}${this.path}`;
|
|
78
|
-
return yield (0, node_fetch_1.default)(url, {
|
|
79
|
-
method: this.method,
|
|
80
|
-
timeout: this.readTimeout,
|
|
81
|
-
headers: this.headers,
|
|
82
|
-
agent: this.getAgent(),
|
|
83
|
-
});
|
|
84
|
-
}
|
|
85
|
-
catch (_a) {
|
|
86
|
-
return undefined;
|
|
87
|
-
}
|
|
88
|
-
}), (response) => __awaiter(this, void 0, void 0, function* () {
|
|
89
|
-
if (response === undefined) {
|
|
90
|
-
return false;
|
|
91
|
-
}
|
|
92
|
-
else if (!this.predicates.length) {
|
|
93
|
-
return response.ok;
|
|
94
|
-
}
|
|
95
|
-
else {
|
|
96
|
-
for (const predicate of this.predicates) {
|
|
97
|
-
const result = yield predicate(response);
|
|
98
|
-
if (!result) {
|
|
99
|
-
return false;
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
return true;
|
|
103
|
-
}
|
|
104
|
-
}), () => {
|
|
105
|
-
const message = `URL ${this.path} not accessible after ${this.startupTimeout}ms`;
|
|
106
|
-
logger_1.log.error(message, { containerId: container.id });
|
|
107
|
-
throw new Error(message);
|
|
108
|
-
}, this.startupTimeout);
|
|
109
|
-
logger_1.log.debug(`HTTP wait strategy complete`, { containerId: container.id });
|
|
110
|
-
});
|
|
111
|
-
}
|
|
112
|
-
getAgent() {
|
|
113
|
-
if (this._allowInsecure) {
|
|
114
|
-
return new https_1.default.Agent({
|
|
115
|
-
rejectUnauthorized: false,
|
|
116
|
-
});
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
exports.HttpWaitStrategy = HttpWaitStrategy;
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.LogWaitStrategy = void 0;
|
|
16
|
-
const logger_1 = require("../logger");
|
|
17
|
-
const container_logs_1 = require("../docker/functions/container/container-logs");
|
|
18
|
-
const byline_1 = __importDefault(require("byline"));
|
|
19
|
-
const wait_strategy_1 = require("./wait-strategy");
|
|
20
|
-
class LogWaitStrategy extends wait_strategy_1.AbstractWaitStrategy {
|
|
21
|
-
constructor(message, times) {
|
|
22
|
-
super();
|
|
23
|
-
this.message = message;
|
|
24
|
-
this.times = times;
|
|
25
|
-
}
|
|
26
|
-
waitUntilReady(container, boundPorts, startTime) {
|
|
27
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
28
|
-
logger_1.log.debug(`Waiting for log message "${this.message}"...`, { containerId: container.id });
|
|
29
|
-
const stream = yield (0, container_logs_1.containerLogs)(container, { since: startTime });
|
|
30
|
-
return new Promise((resolve, reject) => {
|
|
31
|
-
const timeout = setTimeout(() => {
|
|
32
|
-
const message = `Log message "${this.message}" not received after ${this.startupTimeout}ms`;
|
|
33
|
-
logger_1.log.error(message, { containerId: container.id });
|
|
34
|
-
reject(new Error(message));
|
|
35
|
-
}, this.startupTimeout);
|
|
36
|
-
const comparisonFn = (line) => {
|
|
37
|
-
if (this.message instanceof RegExp) {
|
|
38
|
-
return this.message.test(line);
|
|
39
|
-
}
|
|
40
|
-
else {
|
|
41
|
-
return line.includes(this.message);
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
let count = 0;
|
|
45
|
-
const lineProcessor = (line) => {
|
|
46
|
-
if (comparisonFn(line)) {
|
|
47
|
-
if (++count === this.times) {
|
|
48
|
-
stream.destroy();
|
|
49
|
-
clearTimeout(timeout);
|
|
50
|
-
logger_1.log.debug(`Log wait strategy complete`, { containerId: container.id });
|
|
51
|
-
resolve();
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
};
|
|
55
|
-
(0, byline_1.default)(stream)
|
|
56
|
-
.on("data", lineProcessor)
|
|
57
|
-
.on("err", lineProcessor)
|
|
58
|
-
.on("end", () => {
|
|
59
|
-
stream.destroy();
|
|
60
|
-
clearTimeout(timeout);
|
|
61
|
-
const message = `Log stream ended and message "${this.message}" was not received`;
|
|
62
|
-
logger_1.log.error(message, { containerId: container.id });
|
|
63
|
-
reject(new Error(message));
|
|
64
|
-
});
|
|
65
|
-
});
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
exports.LogWaitStrategy = LogWaitStrategy;
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.ShellWaitStrategy = void 0;
|
|
13
|
-
const logger_1 = require("../logger");
|
|
14
|
-
const wait_strategy_1 = require("./wait-strategy");
|
|
15
|
-
const retry_strategy_1 = require("../retry-strategy");
|
|
16
|
-
const exec_container_1 = require("../docker/functions/container/exec-container");
|
|
17
|
-
const docker_client_1 = require("../docker/client/docker-client");
|
|
18
|
-
class ShellWaitStrategy extends wait_strategy_1.AbstractWaitStrategy {
|
|
19
|
-
constructor(command) {
|
|
20
|
-
super();
|
|
21
|
-
this.command = command;
|
|
22
|
-
}
|
|
23
|
-
waitUntilReady(container) {
|
|
24
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
25
|
-
logger_1.log.debug(`Waiting for successful shell command "${this.command}"...`, { containerId: container.id });
|
|
26
|
-
const { dockerode, containerRuntime } = yield (0, docker_client_1.getDockerClient)();
|
|
27
|
-
yield new retry_strategy_1.IntervalRetryStrategy(100).retryUntil(() => __awaiter(this, void 0, void 0, function* () {
|
|
28
|
-
const { exitCode } = yield (0, exec_container_1.execContainer)(dockerode, containerRuntime, container, ["/bin/sh", "-c", this.command], false);
|
|
29
|
-
return exitCode;
|
|
30
|
-
}), (exitCode) => exitCode === 0, () => {
|
|
31
|
-
const message = `Shell command "${this.command}" not successful after ${this.startupTimeout}ms`;
|
|
32
|
-
logger_1.log.error(message, { containerId: container.id });
|
|
33
|
-
throw new Error(message);
|
|
34
|
-
}, this.startupTimeout);
|
|
35
|
-
logger_1.log.debug(`Shell wait strategy complete`, { containerId: container.id });
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
exports.ShellWaitStrategy = ShellWaitStrategy;
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.StartupCheckStrategy = void 0;
|
|
13
|
-
const wait_strategy_1 = require("./wait-strategy");
|
|
14
|
-
const retry_strategy_1 = require("../retry-strategy");
|
|
15
|
-
const docker_client_1 = require("../docker/client/docker-client");
|
|
16
|
-
const logger_1 = require("../logger");
|
|
17
|
-
class StartupCheckStrategy extends wait_strategy_1.AbstractWaitStrategy {
|
|
18
|
-
waitUntilReady(container) {
|
|
19
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
20
|
-
const { dockerode } = yield (0, docker_client_1.getDockerClient)();
|
|
21
|
-
const startupStatus = yield new retry_strategy_1.IntervalRetryStrategy(1000).retryUntil(() => __awaiter(this, void 0, void 0, function* () { return yield this.checkStartupState(dockerode, container.id); }), (startupStatus) => startupStatus === "SUCCESS" || startupStatus === "FAIL", () => {
|
|
22
|
-
const message = `Container not accessible after ${this.startupTimeout}ms`;
|
|
23
|
-
logger_1.log.error(message, { containerId: container.id });
|
|
24
|
-
return new Error(message);
|
|
25
|
-
}, this.startupTimeout);
|
|
26
|
-
if (startupStatus instanceof Error) {
|
|
27
|
-
throw startupStatus;
|
|
28
|
-
}
|
|
29
|
-
else if (startupStatus === "FAIL") {
|
|
30
|
-
throw new Error(`Container failed to start for ${container.id}`);
|
|
31
|
-
}
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
exports.StartupCheckStrategy = StartupCheckStrategy;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/{dist/src/registry-auth-locator → build/container-runtime/auth}/registry-matches.d.ts
RENAMED
|
File without changes
|
/package/{dist/src/docker/functions/container → build/container-runtime/utils}/attach-container.d.ts
RENAMED
|
File without changes
|
|
File without changes
|
/package/{dist/src/docker/functions/container → build/container-runtime/utils}/start-container.d.ts
RENAMED
|
File without changes
|
/package/{dist/src → build}/docker-compose-environment/downed-docker-compose-environment.d.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|