diff --git a/README.md b/README.md index aca2fa7..03743c4 100644 --- a/README.md +++ b/README.md @@ -70,6 +70,10 @@ Important: By default the plugin will not follow symlinked folders, set this option to `true` to do so. This will add the `-L` option to the `find` command used to get the files to upload. +#### `job-id` (string) + +The buildkite job id for which the results should be linked to. Defaults to the current job. + #### `missing-error` (integer) Exit code of the hook when no files are found to upload as long as the step's command has not failed already. @@ -153,7 +157,7 @@ You can also use build artifacts generated in a previous step: ```yaml steps: - # Run tests and upload + # Run tests and upload - label: "🔨 Test" command: "make test --junit=tests-N.xml" artifact_paths: "tests-*.xml" diff --git a/hooks/pre-exit b/hooks/pre-exit index 22b4484..c2f0ea2 100755 --- a/hooks/pre-exit +++ b/hooks/pre-exit @@ -7,6 +7,7 @@ TIMEOUT="${BUILDKITE_PLUGIN_TEST_COLLECTOR_TIMEOUT:-30}" BASE_PATH="${BUILDKITE_PLUGIN_TEST_COLLECTOR_BASE_PATH:-.}" ANNOTATE="${BUILDKITE_PLUGIN_TEST_COLLECTOR_ANNOTATION_LINK:-false}" UPLOAD_CONCURRENCY="${BUILDKITE_PLUGIN_TEST_COLLECTOR_UPLOAD_CONCURRENCY:-1}" +JOB_ID="${BUILDKITE_PLUGIN_TEST_COLLECTOR_JOB_ID:-$BUILDKITE_JOB_ID}" REPORT_URLS_FILE=$(mktemp) CURL_RESP_FILE="${CURL_RESP_FILE:-}" DEBUG="false" @@ -126,7 +127,7 @@ upload() { "--form" "run_env[branch]=\"$BUILDKITE_BRANCH\"" "--form" "run_env[commit_sha]=\"$BUILDKITE_COMMIT\"" "--form" "run_env[number]=\"$BUILDKITE_BUILD_NUMBER\"" - "--form" "run_env[job_id]=\"$BUILDKITE_JOB_ID\"" + "--form" "run_env[job_id]=\"$JOB_ID\"" "--form" "run_env[message]=\"$BUILDKITE_MESSAGE\"" "--form" "run_env[collector]=test-collector-buildkite-plugin" ) diff --git a/plugin.yml b/plugin.yml index 4ff1855..7b420b6 100644 --- a/plugin.yml +++ b/plugin.yml @@ -29,6 +29,8 @@ configuration: enum: - json - junit + job-id: + type: string missing-error: type: integer timeout: