-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Matt Anderson
committed
Jun 12, 2022
1 parent
1ac3a70
commit cac746a
Showing
9 changed files
with
104 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
|
||
steps: | ||
- label: ":shell: Shellcheck" | ||
plugins: | ||
shellcheck#v1.1.2: | ||
files: | ||
- hooks/** | ||
|
||
- label: ":rocket: Test" | ||
plugins: | ||
docker-compose#v3.7.0: | ||
run: tests | ||
|
||
- label: ":sparkles: Lint" | ||
plugins: | ||
plugin-linter#v2.0.0: | ||
id: docker-login |
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# * @equinixmetal-buildkite/team |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,29 @@ | ||
# template-buildkite-plugin | ||
A template repo that can help bootstrap a new buildkite plugin | ||
# Buildkite Plugin Template | ||
|
||
Check the [buildkite organization](https://github.com/buildkite-plugins) or [website](https://buildkite.com/plugins) to see if your plugin already exists or we can contribute to it ! | ||
|
||
Be sure to update this readme with your plugin information after using the template repository. | ||
|
||
## Example | ||
|
||
Provide an example of using this plugin, like so: | ||
|
||
Add the following to your `pipeline.yml`: | ||
|
||
```yml | ||
steps: | ||
- command: ls | ||
plugins: | ||
- a-github-user/file-counter#v1.0.0: | ||
pattern: '*.md' | ||
``` | ||
## Developing | ||
Provide examples on how to modify and test, e.g.: | ||
To run the tests: | ||
```shell | ||
docker-compose run --rm tests | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
version: '3.8' | ||
services: | ||
tests: | ||
image: buildkite/plugin-tester | ||
volumes: | ||
- ".:/plugin" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/bash | ||
|
||
set -o errexit # script exits when a command fails == set -e | ||
set -o nounset # script exits when tries to use undeclared variables == set -u | ||
set -o xtrace # trace what's executed == set -x (useful for debugging) | ||
set -o pipefail # causes pipelines to retain / set the last non-zero status |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
name: your name | ||
description: what your plugin does | ||
author: Equinix Metal | ||
requirements: | ||
- if you have requirements | ||
configuration: | ||
properties: | ||
propertyname: | ||
type: string | ||
required: | ||
- if any properties are required | ||
dependencies: | ||
dependencyname: [dep] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"extends": [ | ||
"config:base" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -euo pipefail | ||
|
||
cd "$(dirname "$0")/.." | ||
|
||
if [[ "${DEBUG:-}" -gt 0 ]] | ||
then | ||
set -x | ||
fi | ||
|
||
echo "--- BATS" | ||
docker-compose run --rm tests | ||
|
||
echo "--- Plugin Lint" | ||
docker-compose run --rm lint | ||
|
||
echo "--- Shellcheck" | ||
docker run --rm -v "${PWD}:/mnt" --workdir /mnt koalaman/shellcheck:stable hooks/** scripts/** | ||
|
||
echo "--- Checking Markdown files (meta)..." | ||
./hooks/command |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/usr/bin/env bats | ||
|
||
PROJECT_DIR=$(cd "${BATS_TEST_DIRNAME}/.." && pwd) |