Skip to content

Commit

Permalink
Merge pull request #8 from buildkite-plugins/switch-to-id
Browse files Browse the repository at this point in the history
Switch to `id` to match plugin-linter
  • Loading branch information
toolmantim authored May 15, 2018
2 parents 085844e + 945708b commit 855f660
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ steps:
- label: ":sparkles: Lint"
plugins:
$BUILDKITE_REPO#$BUILDKITE_COMMIT:
name: plugin-linter
id: plugin-linter

- label: ":bash: Shellcheck"
plugins:
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion hooks/command
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ requirements:
- docker
configuration:
properties:
name:
id:
type: string
readme:
type: string
required:
- name
- id
additionalProperties: false
8 changes: 4 additions & 4 deletions tests/command.bats
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

Expand Down

0 comments on commit 855f660

Please sign in to comment.