Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions pages/agent/v3/help/_annotate.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,12 @@ body entirely and providing a new style value.

### Example

$ buildkite-agent annotate "All tests passed! :rocket:"
$ cat annotation.md | buildkite-agent annotate --style "warning"
$ buildkite-agent annotate --style "success" --context "junit"
$ ./script/dynamic_annotation_generator | buildkite-agent annotate --style "success"
```shell
$ buildkite-agent annotate "All tests passed! :rocket:"
$ cat annotation.md | buildkite-agent annotate --style "warning"
$ buildkite-agent annotate --style "success" --context "junit"
$ ./script/dynamic_annotation_generator | buildkite-agent annotate --style "success"
```

### Options

Expand Down
6 changes: 4 additions & 2 deletions pages/agent/v3/help/_annotation_remove.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,10 @@ If you leave context blank, it will use the default context.

### Example

$ buildkite-agent annotation remove
$ buildkite-agent annotation remove --context "remove-me"
```shell
$ buildkite-agent annotation remove
$ buildkite-agent annotation remove --context "remove-me"
```

### Options

Expand Down
8 changes: 6 additions & 2 deletions pages/agent/v3/help/_artifact_download.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,19 @@ artifact paths.

### Example

$ buildkite-agent artifact download "pkg/*.tar.gz" . --build xxx
```shell
$ buildkite-agent artifact download "pkg/*.tar.gz" . --build xxx
```

This will search across all the artifacts for the build with files that match that part.
The first argument is the search query, and the second argument is the download destination.

If you're trying to download a specific file, and there are multiple artifacts from different
jobs, you can target the particular job you want to download the artifact from:

$ buildkite-agent artifact download "pkg/*.tar.gz" . --step "tests" --build xxx
```shell
$ buildkite-agent artifact download "pkg/*.tar.gz" . --step "tests" --build xxx
```

You can also use the step's jobs id (provided by the environment variable $BUILDKITE_JOB_ID)

Expand Down
12 changes: 9 additions & 3 deletions pages/agent/v3/help/_artifact_search.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,27 @@ which will break the search.

### Example

$ buildkite-agent artifact search "pkg/*.tar.gz" --build xxx
```shell
$ buildkite-agent artifact search "pkg/*.tar.gz" --build xxx
```

This will search across all uploaded artifacts in a build for files that match that query.
The first argument is the search query.

If you're trying to find a specific file, and there are multiple artifacts from different
jobs, you can target the particular job you want to search the artifacts from using --step:

$ buildkite-agent artifact search "pkg/*.tar.gz" --step "tests" --build xxx
```shell
$ buildkite-agent artifact search "pkg/*.tar.gz" --step "tests" --build xxx
```

You can also use the step's job id (provided by the environment variable $BUILDKITE_JOB_ID)

Output formatting can be altered with the -format flag as follows:

$ buildkite-agent artifact search "*" -format "%p\n"
```shell
$ buildkite-agent artifact search "*" -format "%p\n"
```

The above will return a list of filenames separated by newline.

Expand Down
10 changes: 7 additions & 3 deletions pages/agent/v3/help/_artifact_shasum.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ which will break the download.

### Example

$ buildkite-agent artifact shasum "pkg/release.tar.gz" --build xxx
```shell
$ buildkite-agent artifact shasum "pkg/release.tar.gz" --build xxx
```

This will search for all files in the build with path "pkg/release.tar.gz",
and if exactly one match is found, the SHA-1 hash generated during upload
Expand All @@ -41,11 +43,13 @@ is printed.
If you would like to target artifacts from a specific build step, you can do
so by using the --step argument.

$ buildkite-agent artifact shasum "pkg/release.tar.gz" --step "release" --build xxx
```shell
$ buildkite-agent artifact shasum "pkg/release.tar.gz" --step "release" --build xxx
```

You can also use the step's job ID (provided by the environment variable $BUILDKITE_JOB_ID)

The --sha256 argument requests SHA-256 instead of SHA-1; this is only
The `--sha256` argument requests SHA-256 instead of SHA-1; this is only
available for artifacts uploaded since SHA-256 support was added to the
agent.

Expand Down
50 changes: 32 additions & 18 deletions pages/agent/v3/help/_artifact_upload.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,42 +32,56 @@ Buildkite-managed Amazon S3 bucket, where they’re retained for six months.

### Example

$ buildkite-agent artifact upload "log/**/*.log"
```shell
$ buildkite-agent artifact upload "log/**/*.log"
```

You can also upload directly to Amazon S3 if you'd like to host your own artifacts:

$ export BUILDKITE_S3_ACCESS_KEY_ID=xxx
$ export BUILDKITE_S3_SECRET_ACCESS_KEY=yyy
$ export BUILDKITE_S3_DEFAULT_REGION=eu-central-1 # default is us-east-1
$ export BUILDKITE_S3_ACL=private # default is public-read
$ buildkite-agent artifact upload "log/**/*.log" s3://name-of-your-s3-bucket/$BUILDKITE_JOB_ID
```shell
$ export BUILDKITE_S3_ACCESS_KEY_ID=xxx
$ export BUILDKITE_S3_SECRET_ACCESS_KEY=yyy
$ export BUILDKITE_S3_DEFAULT_REGION=eu-central-1 # default is us-east-1
$ export BUILDKITE_S3_ACL=private # default is public-read
$ buildkite-agent artifact upload "log/**/*.log" s3://name-of-your-s3-bucket/$BUILDKITE_JOB_ID
```

You can use Amazon IAM assumed roles by specifying the session token:

$ export BUILDKITE_S3_SESSION_TOKEN=zzz
```shell
$ export BUILDKITE_S3_SESSION_TOKEN=zzz
```

Or upload directly to Google Cloud Storage:

$ export BUILDKITE_GS_ACL=private
$ buildkite-agent artifact upload "log/**/*.log" gs://name-of-your-gs-bucket/$BUILDKITE_JOB_ID
```shell
$ export BUILDKITE_GS_ACL=private
$ buildkite-agent artifact upload "log/**/*.log" gs://name-of-your-gs-bucket/$BUILDKITE_JOB_ID
```

Or upload directly to Artifactory:

$ export BUILDKITE_ARTIFACTORY_URL=http://my-artifactory-instance.com/artifactory
$ export BUILDKITE_ARTIFACTORY_USER=carol-danvers
$ export BUILDKITE_ARTIFACTORY_PASSWORD=xxx
$ buildkite-agent artifact upload "log/**/*.log" rt://name-of-your-artifactory-repo/$BUILDKITE_JOB_ID
```shell
$ export BUILDKITE_ARTIFACTORY_URL=http://my-artifactory-instance.com/artifactory
$ export BUILDKITE_ARTIFACTORY_USER=carol-danvers
$ export BUILDKITE_ARTIFACTORY_PASSWORD=xxx
$ buildkite-agent artifact upload "log/**/*.log" rt://name-of-your-artifactory-repo/$BUILDKITE_JOB_ID
```

By default, symlinks to directories will not be explored when resolving the glob, but symlinks to files will be uploaded as the linked files.
To ignore symlinks to files use:
By default, symlinks to directories will not be explored when resolving the glob, but symlinks to
files will be uploaded as the linked files. To ignore symlinks to files use:

$ buildkite-agent artifact upload --upload-skip-symlinks "log/**/*.log"
```shell
$ buildkite-agent artifact upload --upload-skip-symlinks "log/**/*.log"
```

Note: uploading symlinks to files without following them is not supported.
If you need to preserve them in a directory, we recommend creating a tar archive:

$ tar -cvf log.tar log/**/*
$ buildkite-agent upload log.tar
```shell
$ tar -cvf log.tar log/**/*
$ buildkite-agent upload log.tar
```

### Options

Expand Down
10 changes: 7 additions & 3 deletions pages/agent/v3/help/_bootstrap.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,13 @@ See https://buildkite.com/docs/agent/v3/hooks for more details.

### Example

$ eval $(curl -s -H "Authorization: Bearer xxx" \
"https://api.buildkite.com/v2/organizations/[org]/pipelines/[proj]/builds/[build]/jobs/[job]/env.txt" | sed 's/^/export /')
$ buildkite-agent bootstrap --build-path builds
```shell
$ eval $(curl -s -H "Authorization: Bearer xxx" \
"https://api.buildkite.com/v2/organizations/[org]/pipelines/[proj]/builds/[build]/jobs/[job]/env.txt" | \
sed 's/^/export /' \
)
$ buildkite-agent bootstrap --build-path builds
```

### Options

Expand Down
1 change: 1 addition & 0 deletions pages/agent/v3/help/_env_dump.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ script.
`buildkite-agent env dump [options]`

### Description

Prints out the environment of the current process as a JSON object, easily
parsable by other programs. Used when executing hooks to discover changes
that hooks make to the environment.
Expand Down
2 changes: 2 additions & 0 deletions pages/agent/v3/help/_env_get.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ script.
`buildkite-agent env get [variables]`

### Description

Retrieves environment variables and their current values from the current job
execution environment.

Expand All @@ -28,6 +29,7 @@ phases of the job. However, `env get` can be used to inspect the changes made
with `env set` and `env unset`.

### Examples

Getting all variables in key=value format:

```shell
Expand Down
1 change: 1 addition & 0 deletions pages/agent/v3/help/_env_set.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ script.
`buildkite-agent env set [variable]`

### Description

Sets environment variables in the current job execution environment.
Changes to the job environment variables only apply to subsequent phases of the job.
This command cannot unset Buildkite read-only variables.
Expand Down
1 change: 1 addition & 0 deletions pages/agent/v3/help/_env_unset.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ script.
`buildkite-agent env unset [variables]`

### Description

Unsets environment variables in the current job execution environment.
Changes to the job environment variables only apply to subsequent phases of the job.
This command cannot unset Buildkite read-only variables.
Expand Down
1 change: 1 addition & 0 deletions pages/agent/v3/help/_lock_acquire.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ script.
`buildkite-agent lock acquire [key]`

### Description

Acquires the lock for the given key. `lock acquire` will wait (potentially
forever) until it can acquire the lock, if the lock is already held by
another process. If multiple processes are waiting for the same lock, there
Expand Down
1 change: 1 addition & 0 deletions pages/agent/v3/help/_lock_do.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ script.
`buildkite-agent lock do [key]`

### Description

Begins a do-once lock. Do-once can be used by multiple processes to
wait for completion of some shared work, where only one process should do
the work.
Expand Down
1 change: 1 addition & 0 deletions pages/agent/v3/help/_lock_done.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ script.
`buildkite-agent lock done [key]`

### Description

Completes a do-once lock. This should only be used by the process performing
the work.

Expand Down
1 change: 1 addition & 0 deletions pages/agent/v3/help/_lock_get.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ script.
`buildkite-agent lock get [key]`

### Description

Retrieves the value of a lock key. Any key not in use returns an empty
string.

Expand Down
1 change: 1 addition & 0 deletions pages/agent/v3/help/_lock_release.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ script.
`buildkite-agent lock release [key] [token]`

### Description

Releases the lock for the given key. This should only be called by the
process that acquired the lock. To help prevent different processes unlocking
each other unintentionally, the output from `lock acquire` is required as the
Expand Down
4 changes: 3 additions & 1 deletion pages/agent/v3/help/_meta_data_exists.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ exit with a status of 100 if the key doesn't exist.

### Example

$ buildkite-agent meta-data exists "foo"
```shell
$ buildkite-agent meta-data exists "foo"
```

### Options

Expand Down
6 changes: 4 additions & 2 deletions pages/agent/v3/help/_meta_data_get.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,13 @@ script.

### Description

Get data from a builds key/value store.
Get data from a build's key/value store.

### Example

$ buildkite-agent meta-data get "foo"
```shell
$ buildkite-agent meta-data get "foo"
```

### Options

Expand Down
4 changes: 3 additions & 1 deletion pages/agent/v3/help/_meta_data_keys.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ and terminated with a trailing newline.

### Example

$ buildkite-agent meta-data keys
```shell
$ buildkite-agent meta-data keys
```

### Options

Expand Down
8 changes: 5 additions & 3 deletions pages/agent/v3/help/_meta_data_set.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,11 @@ characters are not allowed.

### Example

$ buildkite-agent meta-data set "foo" "bar"
$ buildkite-agent meta-data set "foo" < ./tmp/meta-data-value
$ ./script/meta-data-generator | buildkite-agent meta-data set "foo"
```shell
$ buildkite-agent meta-data set "foo" "bar"
$ buildkite-agent meta-data set "foo" < ./tmp/meta-data-value
$ ./script/meta-data-generator | buildkite-agent meta-data set "foo"
```

### Options

Expand Down
7 changes: 5 additions & 2 deletions pages/agent/v3/help/_oidc_request_token.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,20 @@ script.
`buildkite-agent oidc request-token [options...]`

### Description

Requests and prints an OIDC token from Buildkite that claims the Job ID
(amongst other things) and the specified audience. If no audience is
specified, the endpoint&#39;s default audience will be claimed.

### Example
$ buildkite-agent oidc request-token --audience sts.amazonaws.com

```shell
$ buildkite-agent oidc request-token --audience sts.amazonaws.com
```

Requests and prints an OIDC token from Buildkite that claims the Job ID
(amongst other things) and the audience &quot;sts.amazonaws.com&quot;.


### Options

<!-- vale off -->
Expand Down
8 changes: 5 additions & 3 deletions pages/agent/v3/help/_pipeline_upload.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,11 @@ must be split into multiple files and uploaded in separate steps.

### Example

$ buildkite-agent pipeline upload
$ buildkite-agent pipeline upload my-custom-pipeline.yml
$ ./script/dynamic_step_generator | buildkite-agent pipeline upload
```shell
$ buildkite-agent pipeline upload
$ buildkite-agent pipeline upload my-custom-pipeline.yml
$ ./script/dynamic_step_generator | buildkite-agent pipeline upload
```

### Options

Expand Down
4 changes: 3 additions & 1 deletion pages/agent/v3/help/_start.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ The agent will run any jobs within a PTY (pseudo terminal) if available.

### Example

$ buildkite-agent start --token xxx
```shell
$ buildkite-agent start --token xxx
```

### Options

Expand Down
Loading