From c1fa127eca945c1e3061d5d6debf8eec34755900 Mon Sep 17 00:00:00 2001 From: coffeegoddd Date: Wed, 31 Jan 2024 10:23:53 -0800 Subject: [PATCH] /{docs,modules}: pr feedback, cleanup --- docs/modules/dolt.md | 2 +- modules/dolt/dolt.go | 2 -- modules/dolt/testdata/clone-db.sh | 9 +++++++++ 3 files changed, 10 insertions(+), 3 deletions(-) create mode 100644 modules/dolt/testdata/clone-db.sh diff --git a/docs/modules/dolt.md b/docs/modules/dolt.md index 47309886b2..3e7fdfc43e 100644 --- a/docs/modules/dolt.md +++ b/docs/modules/dolt.md @@ -62,7 +62,7 @@ scripts to the container request, using the `WithScripts(scriptPaths ...string)` the remote to clone, and use `WithDoltCredsPublicKey(key string)` along with `WithCredsFile(credsFile string)` to authorize the Dolt container to clone from the remote. -[Example of Init script](../../modules/dolt/testdata/schema.sql) +[Example of Clone script](../../modules/dolt/testdata/clone-db.sh) #### Custom configuration diff --git a/modules/dolt/dolt.go b/modules/dolt/dolt.go index e7770330a1..4e7a2d6200 100644 --- a/modules/dolt/dolt.go +++ b/modules/dolt/dolt.go @@ -74,8 +74,6 @@ func RunContainer(ctx context.Context, opts ...testcontainers.ContainerCustomize return nil, fmt.Errorf("empty password can be used only with the root user") } - req.Env["SOME_BS"] = "wtfmaaaaaan" - container, err := testcontainers.GenericContainer(ctx, genericContainerReq) if err != nil { return nil, err diff --git a/modules/dolt/testdata/clone-db.sh b/modules/dolt/testdata/clone-db.sh new file mode 100644 index 0000000000..aea3172e7a --- /dev/null +++ b/modules/dolt/testdata/clone-db.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +# use credentials for remote +if [ -n "$DOLT_CREDS_PUB_KEY" ]; then + dolt creds use "$DOLT_CREDS_PUB_KEY" +fi + +# clone +dolt sql -q "CALL DOLT_CLONE('$DOLT_REMOTE_CLONE_URL', '$DOLT_DATABASE');"