From 945708b6592c919bcd9e31119d72097799c9fd6c Mon Sep 17 00:00:00 2001 From: Tim Lucas Date: Tue, 15 May 2018 21:17:36 +1000 Subject: [PATCH] Switch to `id` to match plugin-linter --- .buildkite/pipeline.yml | 2 +- README.md | 6 +++--- hooks/command | 2 +- plugin.yml | 4 ++-- tests/command.bats | 8 ++++---- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 136e65c..6d97136 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -2,7 +2,7 @@ steps: - label: ":sparkles: Lint" plugins: $BUILDKITE_REPO#$BUILDKITE_COMMIT: - name: plugin-linter + id: plugin-linter - label: ":bash: Shellcheck" plugins: diff --git a/README.md b/README.md index b16b2ca..9e37f0b 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ steps: - label: ":sparkles: Lint" plugins: plugin-linter#v1.0.0: - name: my-org/my-plugin + id: my-org/my-plugin ``` Note: this will pull the latest version of the Plugin Linter each time it is run. @@ -20,9 +20,9 @@ If you want to run it locally on a command line, see the [Buildkite Plugin Linte ## Configuration -### `name` +### `id` -The name of the plugin +The id of the plugin (e.g. `my-org/my-plugin`) ### `readme` (optional) diff --git a/hooks/command b/hooks/command index 3ec01d0..dec2566 100755 --- a/hooks/command +++ b/hooks/command @@ -12,7 +12,7 @@ args=( "-it" "--rm" "--volume" "$PWD:/plugin:ro" - "--env" "PLUGIN_NAME=$BUILDKITE_PLUGIN_PLUGIN_LINTER_NAME" + "--env" "PLUGIN_ID=$BUILDKITE_PLUGIN_PLUGIN_LINTER_ID" ) if [[ -n "${BUILDKITE_PLUGIN_PLUGIN_LINTER_README:-}" ]] ; then diff --git a/plugin.yml b/plugin.yml index 4993681..0a20bce 100644 --- a/plugin.yml +++ b/plugin.yml @@ -5,10 +5,10 @@ requirements: - docker configuration: properties: - name: + id: type: string readme: type: string required: - - name + - id additionalProperties: false \ No newline at end of file diff --git a/tests/command.bats b/tests/command.bats index 5ca50dd..196efcc 100644 --- a/tests/command.bats +++ b/tests/command.bats @@ -6,11 +6,11 @@ load '/usr/local/lib/bats/load.bash' # export DOCKER_STUB_DEBUG=/dev/tty @test "Runs the linter via Docker" { - export BUILDKITE_PLUGIN_PLUGIN_LINTER_NAME=my-plugin + export BUILDKITE_PLUGIN_PLUGIN_LINTER_ID=my-plugin stub docker \ "pull buildkite/plugin-linter : echo pulled image" \ - "run -it --rm --volume /plugin:/plugin:ro --env PLUGIN_NAME=my-plugin buildkite/plugin-linter : echo linted" + "run -it --rm --volume /plugin:/plugin:ro --env PLUGIN_ID=my-plugin buildkite/plugin-linter : echo linted" run $PWD/hooks/command @@ -21,12 +21,12 @@ load '/usr/local/lib/bats/load.bash' } @test "Supports the readme option" { - export BUILDKITE_PLUGIN_PLUGIN_LINTER_NAME=my-plugin + export BUILDKITE_PLUGIN_PLUGIN_LINTER_ID=my-plugin export BUILDKITE_PLUGIN_PLUGIN_LINTER_README=some-readme.yml stub docker \ "pull buildkite/plugin-linter : echo pulled image" \ - "run -it --rm --volume /plugin:/plugin:ro --env PLUGIN_NAME=my-plugin --env PLUGIN_README=some-readme.yml buildkite/plugin-linter : echo linted" + "run -it --rm --volume /plugin:/plugin:ro --env PLUGIN_ID=my-plugin --env PLUGIN_README=some-readme.yml buildkite/plugin-linter : echo linted" run $PWD/hooks/command