Skip to content

Commit

Permalink
Add ruby-image option
Browse files Browse the repository at this point in the history
  • Loading branch information
toote committed Oct 28, 2022
1 parent 5348c36 commit 210a0bf
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,12 @@ Default: `0`

Include the specified number of slowest tests in the annotation. The annotation will always be shown.

### `ruby-image` (optional)

The docker image to use for running the analysis code. Must be a valid image reference that can run the corresponding ruby code and the agent running the step must be able to pull it if not already present.

Default: `ruby:3.1-alpine@sha256:a39e26d0598837f08c75a42c8b0886d9ed5cc862c4b535662922ee1d05272fca`

## Developing

To test the plugin hooks (in Bash) and the junit parser (in Ruby):
Expand Down
3 changes: 2 additions & 1 deletion hooks/command
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ fi

PLUGIN_DIR="$(cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd)/.."
MAX_SIZE=1024 # in KB
RUBY_IMAGE="${BUILDKITE_PLUGIN_JUNIT_ANNOTATE_RUBY_IMAGE:-'ruby:3.1-alpine@sha256:a39e26d0598837f08c75a42c8b0886d9ed5cc862c4b535662922ee1d05272fca'}"

artifacts_dir="$(pwd)/$(mktemp -d "junit-annotate-plugin-artifacts-tmp.XXXXXXXXXX")"
annotation_dir="$(pwd)/$(mktemp -d "junit-annotate-plugin-annotation-tmp.XXXXXXXXXX")"
Expand Down Expand Up @@ -49,7 +50,7 @@ docker \
--env "BUILDKITE_PLUGIN_JUNIT_ANNOTATE_JOB_UUID_FILE_PATTERN=${BUILDKITE_PLUGIN_JUNIT_ANNOTATE_JOB_UUID_FILE_PATTERN:-}" \
--env "BUILDKITE_PLUGIN_JUNIT_ANNOTATE_FAILURE_FORMAT=${BUILDKITE_PLUGIN_JUNIT_ANNOTATE_FAILURE_FORMAT:-}" \
--env "BUILDKITE_PLUGIN_JUNIT_ANNOTATE_REPORT_SLOWEST=${BUILDKITE_PLUGIN_JUNIT_ANNOTATE_REPORT_SLOWEST:-}" \
ruby:2.7-alpine ruby /src/bin/annotate /junits \
"${RUBY_IMAGE}" ruby /src/bin/annotate /junits \
> "$annotation_path"

exit_code=$?
Expand Down
2 changes: 2 additions & 0 deletions plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ configuration:
type: string
report-slowest:
type: integer
ruby-image:
type: string
required:
- artifacts
additionalProperties: false

0 comments on commit 210a0bf

Please sign in to comment.