diff --git a/.buildkite/pipeline.extra-steps.gradle b/.buildkite/pipeline.extra-steps.gradle index bd92d91..3ade4f9 100644 --- a/.buildkite/pipeline.extra-steps.gradle +++ b/.buildkite/pipeline.extra-steps.gradle @@ -29,6 +29,12 @@ commandStep { // Common Buildkite plugins are also part of the DSL. dockerCompose { run 'unit' + // Passthrough variables + environment( + 'FOO', + 'BAR', + 'BAZ', + ) } } diff --git a/buildSrc/src/main/groovy/com/widen/plugins/buildkite/BuildkitePipeline.groovy b/buildSrc/src/main/groovy/com/widen/plugins/buildkite/BuildkitePipeline.groovy index 5075d7b..79fe91b 100644 --- a/buildSrc/src/main/groovy/com/widen/plugins/buildkite/BuildkitePipeline.groovy +++ b/buildSrc/src/main/groovy/com/widen/plugins/buildkite/BuildkitePipeline.groovy @@ -259,12 +259,12 @@ class BuildkitePipeline implements ConfigurableEnvironment { } /** - * Set an environment variable to pass into the Docker container. + * Set one or more environment variables to pass into the Docker container. * - * @param name The variable name. + * @param name The variable names. */ - void environment(String name) { - model.get('environment', []) << name + void environment(String... names) { + model.get('environment', []).addAll(names) } /** @@ -383,10 +383,12 @@ class BuildkitePipeline implements ConfigurableEnvironment { } /** - * Set an environment variable to pass into the container. + * Set one or more environment variables to pass into the Docker container. + * + * @param name The variable names. */ - void environment(String name) { - model.get('env', []) << name + void environment(String... names) { + model.get('env', []).addAll(names) } /**