@@ -14,35 +14,57 @@ import (
14
14
15
15
const searchHelpDescription = `Usage:
16
16
17
- buildkite-agent artifact search [options] <query>
17
+ buildkite-agent artifact search [options] <query>
18
18
19
19
Description:
20
20
21
- Searches for build artifacts specified by <query> on Buildkite
21
+ Searches for build artifacts specified by <query> on Buildkite
22
22
23
- Note: You need to ensure that your search query is surrounded by quotes if
24
- using a wild card as the built-in shell path globbing will provide files,
25
- which will break the search.
23
+ Note: You need to ensure that your search query is surrounded by quotes if
24
+ using a wild card as the built-in shell path globbing will provide files,
25
+ which will break the search.
26
26
27
27
Example:
28
28
29
- $ buildkite-agent artifact search "pkg/*.tar.gz" --build xxx
29
+ $ buildkite-agent artifact search "pkg/*.tar.gz" --build xxx
30
30
31
- This will search across all uploaded artifacts in a build for files that match that query.
32
- The first argument is the search query.
31
+ This will search across all uploaded artifacts in a build for files that match that query.
32
+ The first argument is the search query.
33
33
34
- If you're trying to find a specific file, and there are multiple artifacts from different
35
- jobs, you can target the particular job you want to search the artifacts from using --step:
34
+ If you're trying to find a specific file, and there are multiple artifacts from different
35
+ jobs, you can target the particular job you want to search the artifacts from using --step:
36
36
37
- $ buildkite-agent artifact search "pkg/*.tar.gz" --step "tests" --build xxx
37
+ $ buildkite-agent artifact search "pkg/*.tar.gz" --step "tests" --build xxx
38
38
39
- You can also use the step's job id (provided by the environment variable $BUILDKITE_JOB_ID)
39
+ You can also use the step's job id (provided by the environment variable $BUILDKITE_JOB_ID)
40
40
41
- Output formatting can be altered with the -format flag as follows:
41
+ Output formatting can be altered with the -format flag as follows:
42
42
43
- $ buildkite-agent artifact search "*" -format "%p\n"
43
+ $ buildkite-agent artifact search "*" -format "%p\n"
44
44
45
- The above will return a list of filenames separated by newline.`
45
+ The above will return a list of filenames separated by newline.`
46
+
47
+ const artifactSearchHelpTemplate = `{{.Description}}
48
+
49
+ Options:
50
+
51
+ {{range .VisibleFlags}} {{.}}
52
+ {{end}}
53
+ Format specifiers:
54
+
55
+ %i UUID of the artifact
56
+
57
+ %p Artifact path
58
+
59
+ %c Artifact creation time (an ISO 8601 / RFC-3339 formatted UTC timestamp)
60
+
61
+ %j UUID of the job that uploaded the artifact, helpful for subsequent artifact downloads
62
+
63
+ %s File size of the artifact in bytes
64
+
65
+ %S SHA1 checksum of the artifact
66
+
67
+ %u Download URL for the artifact, though consider using 'buildkite-agent artifact download' instead`
46
68
47
69
type ArtifactSearchConfig struct {
48
70
Query string `cli:"arg:0" label:"artifact search query" validate:"required"`
@@ -67,32 +89,10 @@ type ArtifactSearchConfig struct {
67
89
}
68
90
69
91
var ArtifactSearchCommand = cli.Command {
70
- Name : "search" ,
71
- Usage : "Searches artifacts in Buildkite" ,
72
- Description : searchHelpDescription ,
73
- CustomHelpTemplate : `{{.Description}}
74
-
75
- Options:
76
-
77
- {{range .VisibleFlags}}{{.}}
78
- {{end}}
79
-
80
- Format specifiers:
81
-
82
- %i UUID of the artifact
83
-
84
- %p Artifact path
85
-
86
- %c Artifact creation time (an ISO 8601 / RFC-3339 formatted UTC timestamp)
87
-
88
- %j UUID of the job that uploaded the artifact, helpful for subsequent artifact downloads
89
-
90
- %s File size of the artifact in bytes
91
-
92
- %S SHA1 checksum of the artifact
93
-
94
- %u Download URL for the artifact, though consider using 'buildkite-agent artifact download' instead
95
- ` ,
92
+ Name : "search" ,
93
+ Usage : "Searches artifacts in Buildkite" ,
94
+ Description : searchHelpDescription ,
95
+ CustomHelpTemplate : artifactSearchHelpTemplate ,
96
96
Flags : []cli.Flag {
97
97
cli.StringFlag {
98
98
Name : "step" ,
0 commit comments