Skip to content

Commit ec45125

Browse files
authored
Merge pull request #453 from buildkite-plugins/toote_secrets_removal
Secrets removal
2 parents a71635d + 5e25fa1 commit ec45125

File tree

5 files changed

+0
-48
lines changed

5 files changed

+0
-48
lines changed

README.md

-4
Original file line numberDiff line numberDiff line change
@@ -324,10 +324,6 @@ You may want to also add `BUILDKIT_INLINE_CACHE=1` to your build arguments (`arg
324324

325325
It will add the `--ssh` option to the build command with the passed value (if `true` it will use `default`). Note that it assumes you have a compatible docker installation and configuration in the agent (meaning you are using BuildKit and it is correctly setup).
326326

327-
#### `secrets` (build only, array of strings)
328-
329-
All elements in this array will be passed literally to the `build` command as parameters of the [`--secrets` option](https://docs.docker.com/engine/reference/commandline/buildx_build/#secret). Note that you must have BuildKit enabled for this option to have any effect and special `RUN` stanzas in your Dockerfile to actually make use of them.
330-
331327
#### `with-dependencies` (build only, boolean)
332328

333329
If set to true, docker compose will build with the `--with-dependencies` option which will also build dependencies transitively.

commands/build.sh

-5
Original file line numberDiff line numberDiff line change
@@ -105,11 +105,6 @@ if [[ "$(plugin_read_config WITH_DEPENDENCIES "false")" == "true" ]] ; then
105105
build_params+=(--with-dependencies)
106106
fi
107107

108-
# Parse the list of secrets to pass on to build command
109-
while read -r line ; do
110-
[[ -n "$line" ]] && build_params+=("--secret" "$line")
111-
done <<< "$(plugin_read_list SECRETS)"
112-
113108
if [[ "$(plugin_read_config SSH "false")" != "false" ]] ; then
114109
if [[ "${DOCKER_BUILDKIT:-}" != "1" && "${BUILDKITE_PLUGIN_DOCKER_COMPOSE_CLI_VERSION:-2}" != "2" ]]; then
115110
echo "🚨 You can not use the ssh option if you are not using buildkit"

plugin.yml

-5
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,6 @@ configuration:
9999
type: string
100100
run-labels:
101101
type: boolean
102-
secrets:
103-
type: array
104-
items:
105-
type: string
106102
service-ports:
107103
type: boolean
108104
shell:
@@ -177,7 +173,6 @@ configuration:
177173
run-labels: [ run ]
178174
service-ports: [ run ]
179175
skip-pull: [ build, run ]
180-
secrets: [ buildkit, build ]
181176
shell: [ run ]
182177
ssh: [ build ]
183178
target: [ build ]

tests/build.bats

-17
Original file line numberDiff line numberDiff line change
@@ -296,23 +296,6 @@ setup_file() {
296296
unstub docker
297297
}
298298

299-
@test "Build with secrets" {
300-
export BUILDKITE_PLUGIN_DOCKER_COMPOSE_BUILD=myservice
301-
export BUILDKITE_PLUGIN_DOCKER_COMPOSE_SECRETS_0='id=test,file=~/.test'
302-
export BUILDKITE_PLUGIN_DOCKER_COMPOSE_SECRETS_1='id=SECRET_VAR'
303-
304-
stub docker \
305-
"compose -f docker-compose.yml -p buildkite1111 build --pull --secret \* --secret \* \* : echo built \${12} with secrets \${9} and \${11}"
306-
307-
run "$PWD"/hooks/command
308-
309-
assert_success
310-
assert_output --partial "built myservice"
311-
assert_output --partial "with secrets id=test,file=~/.test and id=SECRET_VAR"
312-
313-
unstub docker
314-
}
315-
316299
@test "Build without pull" {
317300
export BUILDKITE_PLUGIN_DOCKER_COMPOSE_BUILD=myservice
318301
export BUILDKITE_PLUGIN_DOCKER_COMPOSE_SKIP_PULL=true

tests/v1/build.bats

-17
Original file line numberDiff line numberDiff line change
@@ -319,23 +319,6 @@ setup_file() {
319319
unstub docker-compose
320320
}
321321

322-
@test "Build with secrets" {
323-
export BUILDKITE_PLUGIN_DOCKER_COMPOSE_BUILD=myservice
324-
export BUILDKITE_PLUGIN_DOCKER_COMPOSE_SECRETS_0='id=test,file=~/.test'
325-
export BUILDKITE_PLUGIN_DOCKER_COMPOSE_SECRETS_1='id=SECRET_VAR'
326-
327-
stub docker-compose \
328-
"-f docker-compose.yml -p buildkite1111 build --pull --secret \* --secret \* \* : echo built \${11} with secrets \${8} and \${10}"
329-
330-
run "$PWD"/hooks/command
331-
332-
assert_success
333-
assert_output --partial "built myservice"
334-
assert_output --partial "with secrets id=test,file=~/.test and id=SECRET_VAR"
335-
336-
unstub docker-compose
337-
}
338-
339322
@test "Build without pull" {
340323
export BUILDKITE_PLUGIN_DOCKER_COMPOSE_BUILD=myservice
341324
export BUILDKITE_PLUGIN_DOCKER_COMPOSE_SKIP_PULL=true

0 commit comments

Comments
 (0)