Skip to content

Commit

Permalink
Merge pull request #202 from laurynaslubys/master
Browse files Browse the repository at this point in the history
Allow switching '--interactive' off
  • Loading branch information
pzeballos authored Sep 16, 2022
2 parents 23ccdfe + 0a32517 commit 8428fd7
Show file tree
Hide file tree
Showing 3 changed files with 125 additions and 62 deletions.
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ steps:
artifact_paths: "dist/**"
```

You can pass in additional environment variables and customize what is mounted into the container.
You can pass in additional environment variables and customize what is mounted into the container.

Note: If you are utilizing Buildkite's [Elastic CI Stack S3 Secrets plugin](https://github.com/buildkite/elastic-ci-stack-s3-secrets-hooks), you must specify the environment variable key names as they appear in your S3 bucket's `environment` hook in order to access the secret from within your container.

Expand Down Expand Up @@ -293,6 +293,10 @@ If set to false, doesn't allocate a TTY. This is useful in some situations where

Default: `true` for Linux and macOS, and `false` for Windows.

### `interactive` (optional, boolean)

If set to false, doesn't connect `stdin` to the process. Some scripts fall back to asking for user input in case of errors, if the process has `stdin` connected and this results in the process waiting for input indefinitely.

### `user` (optional, string)

Allows a user to be set, and override the USER entry in the Dockerfile. See https://docs.docker.com/engine/reference/run/#user for more details.
Expand Down Expand Up @@ -361,7 +365,7 @@ Example: `0.5`

### `memory` (optional, string)

Set the memory limit to apply when running the container. More information can
Set the memory limit to apply when running the container. More information can
be found in https://docs.docker.com/config/containers/resource_constraints/#limit-a-containers-access-to-memory.

Example: `2g`
Expand Down
8 changes: 6 additions & 2 deletions hooks/command
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ is_macos() {
}

tty_default='on'
interactive_default='on'
init_default='on'
mount_agent_default='on'
mount_ssh_agent=''
Expand All @@ -90,8 +91,11 @@ args=()

# Support switching tty off
if [[ "${BUILDKITE_PLUGIN_DOCKER_TTY:-$tty_default}" =~ ^(true|on|1)$ ]] ; then
args+=("-it")
else
args+=("-t")
fi

# Support switching interactive off
if [[ "${BUILDKITE_PLUGIN_DOCKER_INTERACTIVE:-$interactive_default}" =~ ^(true|on|1)$ ]] ; then
args+=("-i")
fi

Expand Down
Loading

0 comments on commit 8428fd7

Please sign in to comment.