Skip to content

Commit cb9c03a

Browse files
authored
Merge pull request #2406 from buildkite/pdp-1465-fix-docs-script-that-parses-agent-help-text
2 parents c01494d + bda8578 commit cb9c03a

27 files changed

+218
-119
lines changed

pages/agent/v3/help/_annotate.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,12 @@ body entirely and providing a new style value.
4141

4242
### Example
4343

44-
$ buildkite-agent annotate "All tests passed! :rocket:"
45-
$ cat annotation.md | buildkite-agent annotate --style "warning"
46-
$ buildkite-agent annotate --style "success" --context "junit"
47-
$ ./script/dynamic_annotation_generator | buildkite-agent annotate --style "success"
44+
```shell
45+
$ buildkite-agent annotate "All tests passed! :rocket:"
46+
$ cat annotation.md | buildkite-agent annotate --style "warning"
47+
$ buildkite-agent annotate --style "success" --context "junit"
48+
$ ./script/dynamic_annotation_generator | buildkite-agent annotate --style "success"
49+
```
4850

4951
### Options
5052

pages/agent/v3/help/_annotation_remove.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,10 @@ If you leave context blank, it will use the default context.
2525

2626
### Example
2727

28-
$ buildkite-agent annotation remove
29-
$ buildkite-agent annotation remove --context "remove-me"
28+
```shell
29+
$ buildkite-agent annotation remove
30+
$ buildkite-agent annotation remove --context "remove-me"
31+
```
3032

3133
### Options
3234

pages/agent/v3/help/_artifact_download.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,19 @@ artifact paths.
3737

3838
### Example
3939

40-
$ buildkite-agent artifact download "pkg/*.tar.gz" . --build xxx
40+
```shell
41+
$ buildkite-agent artifact download "pkg/*.tar.gz" . --build xxx
42+
```
4143

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

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

48-
$ buildkite-agent artifact download "pkg/*.tar.gz" . --step "tests" --build xxx
50+
```shell
51+
$ buildkite-agent artifact download "pkg/*.tar.gz" . --step "tests" --build xxx
52+
```
4953

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

pages/agent/v3/help/_artifact_search.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,21 +26,27 @@ which will break the search.
2626

2727
### Example
2828

29-
$ buildkite-agent artifact search "pkg/*.tar.gz" --build xxx
29+
```shell
30+
$ buildkite-agent artifact search "pkg/*.tar.gz" --build xxx
31+
```
3032

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

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

37-
$ buildkite-agent artifact search "pkg/*.tar.gz" --step "tests" --build xxx
39+
```shell
40+
$ buildkite-agent artifact search "pkg/*.tar.gz" --step "tests" --build xxx
41+
```
3842

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

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

43-
$ buildkite-agent artifact search "*" -format "%p\n"
47+
```shell
48+
$ buildkite-agent artifact search "*" -format "%p\n"
49+
```
4450

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

pages/agent/v3/help/_artifact_shasum.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@ which will break the download.
3232

3333
### Example
3434

35-
$ buildkite-agent artifact shasum "pkg/release.tar.gz" --build xxx
35+
```shell
36+
$ buildkite-agent artifact shasum "pkg/release.tar.gz" --build xxx
37+
```
3638

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

44-
$ buildkite-agent artifact shasum "pkg/release.tar.gz" --step "release" --build xxx
46+
```shell
47+
$ buildkite-agent artifact shasum "pkg/release.tar.gz" --step "release" --build xxx
48+
```
4549

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

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

pages/agent/v3/help/_artifact_upload.md

Lines changed: 32 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -32,42 +32,56 @@ Buildkite-managed Amazon S3 bucket, where they’re retained for six months.
3232

3333
### Example
3434

35-
$ buildkite-agent artifact upload "log/**/*.log"
35+
```shell
36+
$ buildkite-agent artifact upload "log/**/*.log"
37+
```
3638

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

39-
$ export BUILDKITE_S3_ACCESS_KEY_ID=xxx
40-
$ export BUILDKITE_S3_SECRET_ACCESS_KEY=yyy
41-
$ export BUILDKITE_S3_DEFAULT_REGION=eu-central-1 # default is us-east-1
42-
$ export BUILDKITE_S3_ACL=private # default is public-read
43-
$ buildkite-agent artifact upload "log/**/*.log" s3://name-of-your-s3-bucket/$BUILDKITE_JOB_ID
41+
```shell
42+
$ export BUILDKITE_S3_ACCESS_KEY_ID=xxx
43+
$ export BUILDKITE_S3_SECRET_ACCESS_KEY=yyy
44+
$ export BUILDKITE_S3_DEFAULT_REGION=eu-central-1 # default is us-east-1
45+
$ export BUILDKITE_S3_ACL=private # default is public-read
46+
$ buildkite-agent artifact upload "log/**/*.log" s3://name-of-your-s3-bucket/$BUILDKITE_JOB_ID
47+
```
4448

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

47-
$ export BUILDKITE_S3_SESSION_TOKEN=zzz
51+
```shell
52+
$ export BUILDKITE_S3_SESSION_TOKEN=zzz
53+
```
4854

4955
Or upload directly to Google Cloud Storage:
5056

51-
$ export BUILDKITE_GS_ACL=private
52-
$ buildkite-agent artifact upload "log/**/*.log" gs://name-of-your-gs-bucket/$BUILDKITE_JOB_ID
57+
```shell
58+
$ export BUILDKITE_GS_ACL=private
59+
$ buildkite-agent artifact upload "log/**/*.log" gs://name-of-your-gs-bucket/$BUILDKITE_JOB_ID
60+
```
5361

5462
Or upload directly to Artifactory:
5563

56-
$ export BUILDKITE_ARTIFACTORY_URL=http://my-artifactory-instance.com/artifactory
57-
$ export BUILDKITE_ARTIFACTORY_USER=carol-danvers
58-
$ export BUILDKITE_ARTIFACTORY_PASSWORD=xxx
59-
$ buildkite-agent artifact upload "log/**/*.log" rt://name-of-your-artifactory-repo/$BUILDKITE_JOB_ID
64+
```shell
65+
$ export BUILDKITE_ARTIFACTORY_URL=http://my-artifactory-instance.com/artifactory
66+
$ export BUILDKITE_ARTIFACTORY_USER=carol-danvers
67+
$ export BUILDKITE_ARTIFACTORY_PASSWORD=xxx
68+
$ buildkite-agent artifact upload "log/**/*.log" rt://name-of-your-artifactory-repo/$BUILDKITE_JOB_ID
69+
```
6070

61-
By default, symlinks to directories will not be explored when resolving the glob, but symlinks to files will be uploaded as the linked files.
62-
To ignore symlinks to files use:
71+
By default, symlinks to directories will not be explored when resolving the glob, but symlinks to
72+
files will be uploaded as the linked files. To ignore symlinks to files use:
6373

64-
$ buildkite-agent artifact upload --upload-skip-symlinks "log/**/*.log"
74+
```shell
75+
$ buildkite-agent artifact upload --upload-skip-symlinks "log/**/*.log"
76+
```
6577

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

69-
$ tar -cvf log.tar log/**/*
70-
$ buildkite-agent upload log.tar
81+
```shell
82+
$ tar -cvf log.tar log/**/*
83+
$ buildkite-agent upload log.tar
84+
```
7185

7286
### Options
7387

pages/agent/v3/help/_bootstrap.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,13 @@ See https://buildkite.com/docs/agent/v3/hooks for more details.
3434

3535
### Example
3636

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

4145
### Options
4246

pages/agent/v3/help/_env_dump.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ script.
1717
`buildkite-agent env dump [options]`
1818

1919
### Description
20+
2021
Prints out the environment of the current process as a JSON object, easily
2122
parsable by other programs. Used when executing hooks to discover changes
2223
that hooks make to the environment.

pages/agent/v3/help/_env_get.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ script.
1717
`buildkite-agent env get [variables]`
1818

1919
### Description
20+
2021
Retrieves environment variables and their current values from the current job
2122
execution environment.
2223

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

3031
### Examples
32+
3133
Getting all variables in key=value format:
3234

3335
```shell

pages/agent/v3/help/_env_set.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ script.
1717
`buildkite-agent env set [variable]`
1818

1919
### Description
20+
2021
Sets environment variables in the current job execution environment.
2122
Changes to the job environment variables only apply to subsequent phases of the job.
2223
This command cannot unset Buildkite read-only variables.

0 commit comments

Comments
 (0)