@dagger.io/dagger 0.3.0 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +72 -1
- package/dist/api/client.gen.d.ts +305 -145
- package/dist/api/client.gen.d.ts.map +1 -1
- package/dist/api/client.gen.js +426 -154
- package/dist/api/utils.d.ts +1 -1
- package/dist/api/utils.d.ts.map +1 -1
- package/dist/api/utils.js +43 -41
- package/dist/common/errors/DaggerSDKError.d.ts +4 -3
- package/dist/common/errors/DaggerSDKError.d.ts.map +1 -1
- package/dist/common/errors/DockerImageRefValidationError.d.ts +2 -2
- package/dist/common/errors/DockerImageRefValidationError.d.ts.map +1 -1
- package/dist/common/errors/DockerImageRefValidationError.js +3 -2
- package/dist/common/errors/EngineSessionConnectParamsParseError.d.ts +21 -0
- package/dist/common/errors/EngineSessionConnectParamsParseError.d.ts.map +1 -0
- package/dist/common/errors/EngineSessionConnectParamsParseError.js +16 -0
- package/dist/common/errors/EngineSessionConnectionTimeoutError.d.ts +21 -0
- package/dist/common/errors/EngineSessionConnectionTimeoutError.d.ts.map +1 -0
- package/dist/common/errors/EngineSessionConnectionTimeoutError.js +16 -0
- package/dist/common/errors/EngineSessionEOFErrorOptions.d.ts +16 -0
- package/dist/common/errors/EngineSessionEOFErrorOptions.d.ts.map +1 -0
- package/dist/common/errors/EngineSessionEOFErrorOptions.js +16 -0
- package/dist/common/errors/GraphQLRequestError.d.ts +2 -2
- package/dist/common/errors/GraphQLRequestError.d.ts.map +1 -1
- package/dist/common/errors/GraphQLRequestError.js +3 -2
- package/dist/common/errors/InitEngineSessionBinaryError.d.ts +2 -2
- package/dist/common/errors/InitEngineSessionBinaryError.d.ts.map +1 -1
- package/dist/common/errors/InitEngineSessionBinaryError.js +3 -2
- package/dist/common/errors/TooManyNestedObjectsError.d.ts +2 -2
- package/dist/common/errors/TooManyNestedObjectsError.d.ts.map +1 -1
- package/dist/common/errors/TooManyNestedObjectsError.js +3 -2
- package/dist/common/errors/UnknownDaggerError.d.ts +2 -2
- package/dist/common/errors/UnknownDaggerError.d.ts.map +1 -1
- package/dist/common/errors/UnknownDaggerError.js +3 -2
- package/dist/common/errors/errors-codes.d.ts +43 -0
- package/dist/common/errors/errors-codes.d.ts.map +1 -0
- package/dist/common/errors/errors-codes.js +35 -0
- package/dist/common/errors/index.d.ts +4 -1
- package/dist/common/errors/index.d.ts.map +1 -1
- package/dist/common/errors/index.js +4 -1
- package/dist/common/utils.d.ts +3 -3
- package/dist/connect.d.ts +24 -1
- package/dist/connect.d.ts.map +1 -1
- package/dist/connect.js +29 -5
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -1
- package/dist/provisioning/{docker-provision/image.d.ts → bin.d.ts} +35 -29
- package/dist/provisioning/bin.d.ts.map +1 -0
- package/dist/provisioning/bin.js +336 -0
- package/dist/provisioning/default.d.ts +1 -1
- package/dist/provisioning/default.d.ts.map +1 -1
- package/dist/provisioning/default.js +1 -2
- package/dist/provisioning/engineconn.d.ts +1 -1
- package/dist/provisioning/engineconn.d.ts.map +1 -1
- package/dist/provisioning/index.d.ts +1 -2
- package/dist/provisioning/index.d.ts.map +1 -1
- package/dist/provisioning/index.js +1 -2
- package/package.json +17 -11
- package/dist/common/errors/EngineSessionPortParseError.d.ts +0 -25
- package/dist/common/errors/EngineSessionPortParseError.d.ts.map +0 -1
- package/dist/common/errors/EngineSessionPortParseError.js +0 -20
- package/dist/provisioning/bin/bin.d.ts +0 -21
- package/dist/provisioning/bin/bin.d.ts.map +0 -1
- package/dist/provisioning/bin/bin.js +0 -116
- package/dist/provisioning/bin/index.d.ts +0 -2
- package/dist/provisioning/bin/index.d.ts.map +0 -1
- package/dist/provisioning/bin/index.js +0 -1
- package/dist/provisioning/docker-provision/image.d.ts.map +0 -1
- package/dist/provisioning/docker-provision/image.js +0 -275
- package/dist/provisioning/docker-provision/index.d.ts +0 -2
- package/dist/provisioning/docker-provision/index.d.ts.map +0 -1
- package/dist/provisioning/docker-provision/index.js +0 -1
- package/dist/provisioning/http/http.d.ts +0 -14
- package/dist/provisioning/http/http.d.ts.map +0 -1
- package/dist/provisioning/http/http.js +0 -33
- package/dist/provisioning/http/index.d.ts +0 -2
- package/dist/provisioning/http/index.d.ts.map +0 -1
- package/dist/provisioning/http/index.js +0 -1
- package/dist/provisioning/provisioner.d.ts +0 -11
- package/dist/provisioning/provisioner.d.ts.map +0 -1
- package/dist/provisioning/provisioner.js +0 -26
package/dist/api/client.gen.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* This file was auto-generated by `
|
|
2
|
+
* This file was auto-generated by `client-gen`.
|
|
3
3
|
* Do not make direct changes to the file.
|
|
4
4
|
*/
|
|
5
5
|
import { GraphQLClient } from "graphql-request";
|
|
@@ -13,6 +13,7 @@ export type QueryTree = {
|
|
|
13
13
|
interface ClientConfig {
|
|
14
14
|
queryTree?: QueryTree[];
|
|
15
15
|
host?: string;
|
|
16
|
+
sessionToken?: string;
|
|
16
17
|
}
|
|
17
18
|
declare class BaseClient {
|
|
18
19
|
protected _queryTree: QueryTree[];
|
|
@@ -21,51 +22,79 @@ declare class BaseClient {
|
|
|
21
22
|
* @defaultValue `127.0.0.1:8080`
|
|
22
23
|
*/
|
|
23
24
|
clientHost: string;
|
|
25
|
+
sessionToken: string;
|
|
24
26
|
/**
|
|
25
27
|
* @hidden
|
|
26
28
|
*/
|
|
27
|
-
constructor({ queryTree, host }?: ClientConfig);
|
|
29
|
+
constructor({ queryTree, host, sessionToken }?: ClientConfig);
|
|
28
30
|
/**
|
|
29
31
|
* @hidden
|
|
30
32
|
*/
|
|
31
33
|
get queryTree(): QueryTree[];
|
|
32
34
|
}
|
|
35
|
+
export type BuildArg = {
|
|
36
|
+
name: string;
|
|
37
|
+
value: string;
|
|
38
|
+
};
|
|
33
39
|
/**
|
|
34
|
-
* A global cache volume identifier
|
|
40
|
+
* A global cache volume identifier.
|
|
35
41
|
*/
|
|
36
42
|
export type CacheID = string;
|
|
37
43
|
export type ContainerBuildOpts = {
|
|
44
|
+
/**
|
|
45
|
+
* Path to the Dockerfile to use.
|
|
46
|
+
* Defaults to './Dockerfile'.
|
|
47
|
+
*/
|
|
38
48
|
dockerfile?: string;
|
|
49
|
+
/**
|
|
50
|
+
* Additional build arguments.
|
|
51
|
+
*/
|
|
52
|
+
buildArgs?: BuildArg[];
|
|
53
|
+
/**
|
|
54
|
+
* Target build stage to build.
|
|
55
|
+
*/
|
|
56
|
+
target?: string;
|
|
39
57
|
};
|
|
40
58
|
export type ContainerExecOpts = {
|
|
41
59
|
/**
|
|
42
|
-
* Command to run instead of the container's default command
|
|
60
|
+
* Command to run instead of the container's default command.
|
|
43
61
|
*/
|
|
44
62
|
args?: string[];
|
|
45
63
|
/**
|
|
46
|
-
* Content to write to the command's standard input before closing
|
|
64
|
+
* Content to write to the command's standard input before closing.
|
|
47
65
|
*/
|
|
48
66
|
stdin?: string;
|
|
49
67
|
/**
|
|
50
|
-
* Redirect the command's standard output to a file in the container
|
|
68
|
+
* Redirect the command's standard output to a file in the container.
|
|
51
69
|
*/
|
|
52
70
|
redirectStdout?: string;
|
|
53
71
|
/**
|
|
54
|
-
* Redirect the command's standard error to a file in the container
|
|
72
|
+
* Redirect the command's standard error to a file in the container.
|
|
55
73
|
*/
|
|
56
74
|
redirectStderr?: string;
|
|
57
75
|
/**
|
|
58
|
-
* Provide dagger access to the executed command
|
|
59
|
-
* Do not use this option unless you trust the command being executed
|
|
60
|
-
* The command being executed WILL BE GRANTED FULL ACCESS TO YOUR HOST FILESYSTEM
|
|
76
|
+
* Provide dagger access to the executed command.
|
|
77
|
+
* Do not use this option unless you trust the command being executed.
|
|
78
|
+
* The command being executed WILL BE GRANTED FULL ACCESS TO YOUR HOST FILESYSTEM.
|
|
61
79
|
*/
|
|
62
80
|
experimentalPrivilegedNesting?: boolean;
|
|
63
81
|
};
|
|
64
82
|
export type ContainerExportOpts = {
|
|
65
|
-
|
|
83
|
+
/**
|
|
84
|
+
* Identifiers for other platform specific containers.
|
|
85
|
+
* Used for multi-platform image.
|
|
86
|
+
*/
|
|
87
|
+
platformVariants?: Container[];
|
|
88
|
+
};
|
|
89
|
+
export type ContainerPipelineOpts = {
|
|
90
|
+
description?: string;
|
|
66
91
|
};
|
|
67
92
|
export type ContainerPublishOpts = {
|
|
68
|
-
|
|
93
|
+
/**
|
|
94
|
+
* Identifiers for other platform specific containers.
|
|
95
|
+
* Used for multi-platform image.
|
|
96
|
+
*/
|
|
97
|
+
platformVariants?: Container[];
|
|
69
98
|
};
|
|
70
99
|
export type ContainerWithDefaultArgsOpts = {
|
|
71
100
|
args?: string[];
|
|
@@ -76,29 +105,33 @@ export type ContainerWithDirectoryOpts = {
|
|
|
76
105
|
};
|
|
77
106
|
export type ContainerWithExecOpts = {
|
|
78
107
|
/**
|
|
79
|
-
* Content to write to the command's standard input before closing
|
|
108
|
+
* Content to write to the command's standard input before closing.
|
|
80
109
|
*/
|
|
81
110
|
stdin?: string;
|
|
82
111
|
/**
|
|
83
|
-
* Redirect the command's standard output to a file in the container
|
|
112
|
+
* Redirect the command's standard output to a file in the container.
|
|
84
113
|
*/
|
|
85
114
|
redirectStdout?: string;
|
|
86
115
|
/**
|
|
87
|
-
* Redirect the command's standard error to a file in the container
|
|
116
|
+
* Redirect the command's standard error to a file in the container.
|
|
88
117
|
*/
|
|
89
118
|
redirectStderr?: string;
|
|
90
119
|
/**
|
|
91
|
-
* Provide dagger access to the executed command
|
|
92
|
-
* Do not use this option unless you trust the command being executed
|
|
93
|
-
* The command being executed WILL BE GRANTED FULL ACCESS TO YOUR HOST FILESYSTEM
|
|
120
|
+
* Provide dagger access to the executed command.
|
|
121
|
+
* Do not use this option unless you trust the command being executed.
|
|
122
|
+
* The command being executed WILL BE GRANTED FULL ACCESS TO YOUR HOST FILESYSTEM.
|
|
94
123
|
*/
|
|
95
124
|
experimentalPrivilegedNesting?: boolean;
|
|
96
125
|
};
|
|
126
|
+
export type ContainerWithFileOpts = {
|
|
127
|
+
permissions?: number;
|
|
128
|
+
};
|
|
97
129
|
export type ContainerWithMountedCacheOpts = {
|
|
98
|
-
source?:
|
|
130
|
+
source?: Directory;
|
|
99
131
|
};
|
|
100
132
|
export type ContainerWithNewFileOpts = {
|
|
101
133
|
contents?: string;
|
|
134
|
+
permissions?: number;
|
|
102
135
|
};
|
|
103
136
|
/**
|
|
104
137
|
* A unique container identifier. Null designates an empty container (scratch).
|
|
@@ -109,24 +142,62 @@ export type ContainerID = string;
|
|
|
109
142
|
*/
|
|
110
143
|
export type DateTime = string;
|
|
111
144
|
export type DirectoryDockerBuildOpts = {
|
|
145
|
+
/**
|
|
146
|
+
* Path to the Dockerfile to use.
|
|
147
|
+
* Defaults to './Dockerfile'.
|
|
148
|
+
*/
|
|
112
149
|
dockerfile?: string;
|
|
150
|
+
/**
|
|
151
|
+
* The platform to build.
|
|
152
|
+
*/
|
|
113
153
|
platform?: Platform;
|
|
154
|
+
/**
|
|
155
|
+
* Additional build arguments.
|
|
156
|
+
*/
|
|
157
|
+
buildArgs?: BuildArg[];
|
|
158
|
+
/**
|
|
159
|
+
* Target build stage to build.
|
|
160
|
+
*/
|
|
161
|
+
target?: string;
|
|
114
162
|
};
|
|
115
163
|
export type DirectoryEntriesOpts = {
|
|
116
164
|
path?: string;
|
|
117
165
|
};
|
|
166
|
+
export type DirectoryPipelineOpts = {
|
|
167
|
+
description?: string;
|
|
168
|
+
};
|
|
118
169
|
export type DirectoryWithDirectoryOpts = {
|
|
170
|
+
/**
|
|
171
|
+
* Exclude artifacts that match the given pattern.
|
|
172
|
+
* (e.g. ["node_modules/", ".git*"]).
|
|
173
|
+
*/
|
|
119
174
|
exclude?: string[];
|
|
175
|
+
/**
|
|
176
|
+
* Include only artifacts that match the given pattern.
|
|
177
|
+
* (e.g. ["app/", "package.*"]).
|
|
178
|
+
*/
|
|
120
179
|
include?: string[];
|
|
121
180
|
};
|
|
181
|
+
export type DirectoryWithFileOpts = {
|
|
182
|
+
permissions?: number;
|
|
183
|
+
};
|
|
184
|
+
export type DirectoryWithNewDirectoryOpts = {
|
|
185
|
+
permissions?: number;
|
|
186
|
+
};
|
|
187
|
+
export type DirectoryWithNewFileOpts = {
|
|
188
|
+
permissions?: number;
|
|
189
|
+
};
|
|
122
190
|
/**
|
|
123
|
-
* A content-addressed directory identifier
|
|
191
|
+
* A content-addressed directory identifier.
|
|
124
192
|
*/
|
|
125
193
|
export type DirectoryID = string;
|
|
194
|
+
/**
|
|
195
|
+
* A file identifier.
|
|
196
|
+
*/
|
|
126
197
|
export type FileID = string;
|
|
127
198
|
export type GitRefTreeOpts = {
|
|
128
199
|
sshKnownHosts?: string;
|
|
129
|
-
sshAuthSocket?:
|
|
200
|
+
sshAuthSocket?: Socket;
|
|
130
201
|
};
|
|
131
202
|
export type HostDirectoryOpts = {
|
|
132
203
|
exclude?: string[];
|
|
@@ -140,26 +211,33 @@ export type HostWorkdirOpts = {
|
|
|
140
211
|
* The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID.
|
|
141
212
|
*/
|
|
142
213
|
export type ID = string;
|
|
214
|
+
/**
|
|
215
|
+
* The platform config OS and architecture in a Container.
|
|
216
|
+
* The format is [os]/[platform]/[version] (e.g. darwin/arm64/v7, windows/amd64, linux/arm64).
|
|
217
|
+
*/
|
|
143
218
|
export type Platform = string;
|
|
144
219
|
export type ClientContainerOpts = {
|
|
145
|
-
id?: ContainerID
|
|
220
|
+
id?: ContainerID;
|
|
146
221
|
platform?: Platform;
|
|
147
222
|
};
|
|
148
223
|
export type ClientDirectoryOpts = {
|
|
149
|
-
id?: DirectoryID
|
|
224
|
+
id?: DirectoryID;
|
|
150
225
|
};
|
|
151
226
|
export type ClientGitOpts = {
|
|
152
227
|
keepGitDir?: boolean;
|
|
153
228
|
};
|
|
229
|
+
export type ClientPipelineOpts = {
|
|
230
|
+
description?: string;
|
|
231
|
+
};
|
|
154
232
|
export type ClientSocketOpts = {
|
|
155
233
|
id?: SocketID;
|
|
156
234
|
};
|
|
157
235
|
/**
|
|
158
|
-
* A unique identifier for a secret
|
|
236
|
+
* A unique identifier for a secret.
|
|
159
237
|
*/
|
|
160
238
|
export type SecretID = string;
|
|
161
239
|
/**
|
|
162
|
-
* A content-addressed socket identifier
|
|
240
|
+
* A content-addressed socket identifier.
|
|
163
241
|
*/
|
|
164
242
|
export type SocketID = string;
|
|
165
243
|
export type __TypeEnumValuesOpts = {
|
|
@@ -169,44 +247,53 @@ export type __TypeFieldsOpts = {
|
|
|
169
247
|
includeDeprecated?: boolean;
|
|
170
248
|
};
|
|
171
249
|
/**
|
|
172
|
-
* A directory whose contents persist across runs
|
|
250
|
+
* A directory whose contents persist across runs.
|
|
173
251
|
*/
|
|
174
252
|
export declare class CacheVolume extends BaseClient {
|
|
175
253
|
id(): Promise<CacheID>;
|
|
176
254
|
}
|
|
177
255
|
/**
|
|
178
|
-
* An OCI-compatible container, also known as a docker container
|
|
256
|
+
* An OCI-compatible container, also known as a docker container.
|
|
179
257
|
*/
|
|
180
258
|
export declare class Container extends BaseClient {
|
|
181
259
|
/**
|
|
182
|
-
*
|
|
260
|
+
* Initializes this container from a Dockerfile build, using the context, a dockerfile file path and some additional buildArgs.
|
|
261
|
+
* @param context Directory context used by the Dockerfile.
|
|
262
|
+
* @param opts.dockerfile Path to the Dockerfile to use.
|
|
263
|
+
Defaults to './Dockerfile'.
|
|
264
|
+
* @param opts.buildArgs Additional build arguments.
|
|
265
|
+
* @param opts.target Target build stage to build.
|
|
183
266
|
*/
|
|
184
|
-
build(context:
|
|
267
|
+
build(context: Directory, opts?: ContainerBuildOpts): Container;
|
|
185
268
|
/**
|
|
186
|
-
*
|
|
269
|
+
* Retrieves default arguments for future commands.
|
|
187
270
|
*/
|
|
188
271
|
defaultArgs(): Promise<string[]>;
|
|
189
272
|
/**
|
|
190
|
-
*
|
|
273
|
+
* Retrieves a directory at the given path. Mounts are included.
|
|
191
274
|
*/
|
|
192
275
|
directory(path: string): Directory;
|
|
193
276
|
/**
|
|
194
|
-
*
|
|
277
|
+
* Retrieves entrypoint to be prepended to the arguments of all commands.
|
|
195
278
|
*/
|
|
196
279
|
entrypoint(): Promise<string[]>;
|
|
197
280
|
/**
|
|
198
|
-
*
|
|
281
|
+
* Retrieves the value of the specified environment variable.
|
|
199
282
|
*/
|
|
200
283
|
envVariable(name: string): Promise<string>;
|
|
201
284
|
/**
|
|
202
|
-
*
|
|
285
|
+
* Retrieves the list of environment variables passed to commands.
|
|
203
286
|
*/
|
|
204
287
|
envVariables(): Promise<EnvVariable[]>;
|
|
205
288
|
/**
|
|
206
|
-
*
|
|
207
|
-
*
|
|
208
|
-
* @param opts
|
|
209
|
-
*
|
|
289
|
+
* Retrieves this container after executing the specified command inside it.
|
|
290
|
+
* @param opts.args Command to run instead of the container's default command.
|
|
291
|
+
* @param opts.stdin Content to write to the command's standard input before closing.
|
|
292
|
+
* @param opts.redirectStdout Redirect the command's standard output to a file in the container.
|
|
293
|
+
* @param opts.redirectStderr Redirect the command's standard error to a file in the container.
|
|
294
|
+
* @param opts.experimentalPrivilegedNesting Provide dagger access to the executed command.
|
|
295
|
+
Do not use this option unless you trust the command being executed.
|
|
296
|
+
The command being executed WILL BE GRANTED FULL ACCESS TO YOUR HOST FILESYSTEM.
|
|
210
297
|
* @deprecated Replaced by withExec.
|
|
211
298
|
*/
|
|
212
299
|
exec(opts?: ContainerExecOpts): Container;
|
|
@@ -216,42 +303,63 @@ export declare class Container extends BaseClient {
|
|
|
216
303
|
*/
|
|
217
304
|
exitCode(): Promise<number>;
|
|
218
305
|
/**
|
|
219
|
-
*
|
|
306
|
+
* Writes the container as an OCI tarball to the destination file path on the host for the specified platformVariants.
|
|
307
|
+
* Return true on success.
|
|
308
|
+
* @param path Host's destination path.
|
|
309
|
+
Path can be relative to the engine's workdir or absolute.
|
|
310
|
+
* @param opts.platformVariants Identifiers for other platform specific containers.
|
|
311
|
+
Used for multi-platform image.
|
|
220
312
|
*/
|
|
221
313
|
export(path: string, opts?: ContainerExportOpts): Promise<boolean>;
|
|
222
314
|
/**
|
|
223
|
-
*
|
|
315
|
+
* Retrieves a file at the given path. Mounts are included.
|
|
224
316
|
*/
|
|
225
317
|
file(path: string): File;
|
|
226
318
|
/**
|
|
227
|
-
*
|
|
319
|
+
* Initializes this container from the base image published at the given address.
|
|
320
|
+
* @param address Image's address from its registry.
|
|
321
|
+
Formatted as [host]/[user]/[repo]:[tag] (e.g. docker.io/dagger/dagger:main).
|
|
228
322
|
*/
|
|
229
323
|
from(address: string): Container;
|
|
230
324
|
/**
|
|
231
|
-
*
|
|
232
|
-
*
|
|
233
|
-
*
|
|
325
|
+
* Retrieves this container's root filesystem. Mounts are not included.
|
|
234
326
|
* @deprecated Replaced by rootfs.
|
|
235
327
|
*/
|
|
236
328
|
fs(): Directory;
|
|
237
329
|
/**
|
|
238
|
-
* A unique identifier for this container
|
|
330
|
+
* A unique identifier for this container.
|
|
239
331
|
*/
|
|
240
332
|
id(): Promise<ContainerID>;
|
|
241
333
|
/**
|
|
242
|
-
*
|
|
334
|
+
* Retrieves the value of the specified label.
|
|
335
|
+
*/
|
|
336
|
+
label(name: string): Promise<string>;
|
|
337
|
+
/**
|
|
338
|
+
* Retrieves the list of labels passed to container.
|
|
339
|
+
*/
|
|
340
|
+
labels(): Promise<Label[]>;
|
|
341
|
+
/**
|
|
342
|
+
* Retrieves the list of paths where a directory is mounted.
|
|
243
343
|
*/
|
|
244
344
|
mounts(): Promise<string[]>;
|
|
245
345
|
/**
|
|
246
|
-
*
|
|
346
|
+
* Creates a named sub-pipeline
|
|
347
|
+
*/
|
|
348
|
+
pipeline(name: string, opts?: ContainerPipelineOpts): Container;
|
|
349
|
+
/**
|
|
350
|
+
* The platform this container executes and publishes as.
|
|
247
351
|
*/
|
|
248
352
|
platform(): Promise<Platform>;
|
|
249
353
|
/**
|
|
250
|
-
*
|
|
354
|
+
* Publishes this container as a new image to the specified address, for the platformVariants, returning a fully qualified ref.
|
|
355
|
+
* @param address Registry's address to publish the image to.
|
|
356
|
+
Formatted as [host]/[user]/[repo]:[tag] (e.g. docker.io/dagger/dagger:main).
|
|
357
|
+
* @param opts.platformVariants Identifiers for other platform specific containers.
|
|
358
|
+
Used for multi-platform image.
|
|
251
359
|
*/
|
|
252
360
|
publish(address: string, opts?: ContainerPublishOpts): Promise<string>;
|
|
253
361
|
/**
|
|
254
|
-
*
|
|
362
|
+
* Retrieves this container's root filesystem. Mounts are not included.
|
|
255
363
|
*/
|
|
256
364
|
rootfs(): Directory;
|
|
257
365
|
/**
|
|
@@ -265,131 +373,149 @@ export declare class Container extends BaseClient {
|
|
|
265
373
|
*/
|
|
266
374
|
stdout(): Promise<string>;
|
|
267
375
|
/**
|
|
268
|
-
*
|
|
376
|
+
* Retrieves the user to be set for all commands.
|
|
269
377
|
*/
|
|
270
378
|
user(): Promise<string>;
|
|
271
379
|
/**
|
|
272
|
-
* Configures default arguments for future commands
|
|
380
|
+
* Configures default arguments for future commands.
|
|
273
381
|
*/
|
|
274
382
|
withDefaultArgs(opts?: ContainerWithDefaultArgsOpts): Container;
|
|
275
383
|
/**
|
|
276
|
-
*
|
|
384
|
+
* Retrieves this container plus a directory written at the given path.
|
|
277
385
|
*/
|
|
278
|
-
withDirectory(path: string, directory:
|
|
386
|
+
withDirectory(path: string, directory: Directory, opts?: ContainerWithDirectoryOpts): Container;
|
|
279
387
|
/**
|
|
280
|
-
*
|
|
388
|
+
* Retrieves this container but with a different command entrypoint.
|
|
281
389
|
*/
|
|
282
390
|
withEntrypoint(args: string[]): Container;
|
|
283
391
|
/**
|
|
284
|
-
*
|
|
392
|
+
* Retrieves this container plus the given environment variable.
|
|
285
393
|
*/
|
|
286
394
|
withEnvVariable(name: string, value: string): Container;
|
|
287
395
|
/**
|
|
288
|
-
*
|
|
396
|
+
* Retrieves this container after executing the specified command inside it.
|
|
397
|
+
* @param args Command to run instead of the container's default command.
|
|
398
|
+
* @param opts.stdin Content to write to the command's standard input before closing.
|
|
399
|
+
* @param opts.redirectStdout Redirect the command's standard output to a file in the container.
|
|
400
|
+
* @param opts.redirectStderr Redirect the command's standard error to a file in the container.
|
|
401
|
+
* @param opts.experimentalPrivilegedNesting Provide dagger access to the executed command.
|
|
402
|
+
Do not use this option unless you trust the command being executed.
|
|
403
|
+
The command being executed WILL BE GRANTED FULL ACCESS TO YOUR HOST FILESYSTEM.
|
|
289
404
|
*/
|
|
290
405
|
withExec(args: string[], opts?: ContainerWithExecOpts): Container;
|
|
291
406
|
/**
|
|
292
|
-
*
|
|
293
|
-
*
|
|
294
|
-
*
|
|
407
|
+
* Initializes this container from this DirectoryID.
|
|
295
408
|
* @deprecated Replaced by withRootfs.
|
|
296
409
|
*/
|
|
297
|
-
withFS(id:
|
|
410
|
+
withFS(id: Directory): Container;
|
|
298
411
|
/**
|
|
299
|
-
*
|
|
412
|
+
* Retrieves this container plus the contents of the given file copied to the given path.
|
|
300
413
|
*/
|
|
301
|
-
withFile(path: string, source:
|
|
414
|
+
withFile(path: string, source: File, opts?: ContainerWithFileOpts): Container;
|
|
302
415
|
/**
|
|
303
|
-
*
|
|
416
|
+
* Retrieves this container plus the given label.
|
|
304
417
|
*/
|
|
305
|
-
|
|
418
|
+
withLabel(name: string, value: string): Container;
|
|
306
419
|
/**
|
|
307
|
-
*
|
|
420
|
+
* Retrieves this container plus a cache volume mounted at the given path.
|
|
308
421
|
*/
|
|
309
|
-
|
|
422
|
+
withMountedCache(path: string, cache: CacheVolume, opts?: ContainerWithMountedCacheOpts): Container;
|
|
310
423
|
/**
|
|
311
|
-
*
|
|
424
|
+
* Retrieves this container plus a directory mounted at the given path.
|
|
312
425
|
*/
|
|
313
|
-
|
|
426
|
+
withMountedDirectory(path: string, source: Directory): Container;
|
|
314
427
|
/**
|
|
315
|
-
*
|
|
428
|
+
* Retrieves this container plus a file mounted at the given path.
|
|
316
429
|
*/
|
|
317
|
-
|
|
430
|
+
withMountedFile(path: string, source: File): Container;
|
|
318
431
|
/**
|
|
319
|
-
*
|
|
432
|
+
* Retrieves this container plus a secret mounted into a file at the given path.
|
|
433
|
+
*/
|
|
434
|
+
withMountedSecret(path: string, source: Secret): Container;
|
|
435
|
+
/**
|
|
436
|
+
* Retrieves this container plus a temporary directory mounted at the given path.
|
|
320
437
|
*/
|
|
321
438
|
withMountedTemp(path: string): Container;
|
|
322
439
|
/**
|
|
323
|
-
*
|
|
440
|
+
* Retrieves this container plus a new file written at the given path.
|
|
324
441
|
*/
|
|
325
442
|
withNewFile(path: string, opts?: ContainerWithNewFileOpts): Container;
|
|
326
443
|
/**
|
|
327
|
-
*
|
|
444
|
+
* Initializes this container from this DirectoryID.
|
|
328
445
|
*/
|
|
329
|
-
withRootfs(id:
|
|
446
|
+
withRootfs(id: Directory): Container;
|
|
330
447
|
/**
|
|
331
|
-
*
|
|
448
|
+
* Retrieves this container plus an env variable containing the given secret.
|
|
332
449
|
*/
|
|
333
|
-
withSecretVariable(name: string, secret:
|
|
450
|
+
withSecretVariable(name: string, secret: Secret): Container;
|
|
334
451
|
/**
|
|
335
|
-
*
|
|
452
|
+
* Retrieves this container plus a socket forwarded to the given Unix socket path.
|
|
336
453
|
*/
|
|
337
|
-
withUnixSocket(path: string, source:
|
|
454
|
+
withUnixSocket(path: string, source: Socket): Container;
|
|
338
455
|
/**
|
|
339
|
-
*
|
|
456
|
+
* Retrieves this containers with a different command user.
|
|
340
457
|
*/
|
|
341
458
|
withUser(name: string): Container;
|
|
342
459
|
/**
|
|
343
|
-
*
|
|
460
|
+
* Retrieves this container with a different working directory.
|
|
344
461
|
*/
|
|
345
462
|
withWorkdir(path: string): Container;
|
|
346
463
|
/**
|
|
347
|
-
*
|
|
464
|
+
* Retrieves this container minus the given environment variable.
|
|
348
465
|
*/
|
|
349
466
|
withoutEnvVariable(name: string): Container;
|
|
350
467
|
/**
|
|
351
|
-
*
|
|
468
|
+
* Retrieves this container minus the given environment label.
|
|
469
|
+
*/
|
|
470
|
+
withoutLabel(name: string): Container;
|
|
471
|
+
/**
|
|
472
|
+
* Retrieves this container after unmounting everything at the given path.
|
|
352
473
|
*/
|
|
353
474
|
withoutMount(path: string): Container;
|
|
354
475
|
/**
|
|
355
|
-
*
|
|
476
|
+
* Retrieves this container with a previously added Unix socket removed.
|
|
356
477
|
*/
|
|
357
478
|
withoutUnixSocket(path: string): Container;
|
|
358
479
|
/**
|
|
359
|
-
*
|
|
480
|
+
* Retrieves the working directory for all commands.
|
|
360
481
|
*/
|
|
361
482
|
workdir(): Promise<string>;
|
|
362
483
|
}
|
|
363
484
|
/**
|
|
364
|
-
* A directory
|
|
485
|
+
* A directory.
|
|
365
486
|
*/
|
|
366
487
|
export declare class Directory extends BaseClient {
|
|
367
488
|
/**
|
|
368
|
-
*
|
|
489
|
+
* Gets the difference between this directory and an another directory.
|
|
369
490
|
*/
|
|
370
|
-
diff(other:
|
|
491
|
+
diff(other: Directory): Directory;
|
|
371
492
|
/**
|
|
372
|
-
*
|
|
493
|
+
* Retrieves a directory at the given path.
|
|
373
494
|
*/
|
|
374
495
|
directory(path: string): Directory;
|
|
375
496
|
/**
|
|
376
|
-
*
|
|
497
|
+
* Builds a new Docker container from this directory.
|
|
498
|
+
* @param opts.dockerfile Path to the Dockerfile to use.
|
|
499
|
+
Defaults to './Dockerfile'.
|
|
500
|
+
* @param opts.platform The platform to build.
|
|
501
|
+
* @param opts.buildArgs Additional build arguments.
|
|
502
|
+
* @param opts.target Target build stage to build.
|
|
377
503
|
*/
|
|
378
504
|
dockerBuild(opts?: DirectoryDockerBuildOpts): Container;
|
|
379
505
|
/**
|
|
380
|
-
*
|
|
506
|
+
* Returns a list of files and directories at the given path.
|
|
381
507
|
*/
|
|
382
508
|
entries(opts?: DirectoryEntriesOpts): Promise<string[]>;
|
|
383
509
|
/**
|
|
384
|
-
*
|
|
510
|
+
* Writes the contents of the directory to a path on the host.
|
|
385
511
|
*/
|
|
386
512
|
export(path: string): Promise<boolean>;
|
|
387
513
|
/**
|
|
388
|
-
*
|
|
514
|
+
* Retrieves a file at the given path.
|
|
389
515
|
*/
|
|
390
516
|
file(path: string): File;
|
|
391
517
|
/**
|
|
392
|
-
* The content-addressed identifier of the directory
|
|
518
|
+
* The content-addressed identifier of the directory.
|
|
393
519
|
*/
|
|
394
520
|
id(): Promise<DirectoryID>;
|
|
395
521
|
/**
|
|
@@ -397,138 +523,167 @@ export declare class Directory extends BaseClient {
|
|
|
397
523
|
*/
|
|
398
524
|
loadProject(configPath: string): Project;
|
|
399
525
|
/**
|
|
400
|
-
*
|
|
526
|
+
* Creates a named sub-pipeline.
|
|
527
|
+
*/
|
|
528
|
+
pipeline(name: string, opts?: DirectoryPipelineOpts): Directory;
|
|
529
|
+
/**
|
|
530
|
+
* Retrieves this directory plus a directory written at the given path.
|
|
531
|
+
* @param opts.exclude Exclude artifacts that match the given pattern.
|
|
532
|
+
(e.g. ["node_modules/", ".git*"]).
|
|
533
|
+
* @param opts.include Include only artifacts that match the given pattern.
|
|
534
|
+
(e.g. ["app/", "package.*"]).
|
|
535
|
+
*/
|
|
536
|
+
withDirectory(path: string, directory: Directory, opts?: DirectoryWithDirectoryOpts): Directory;
|
|
537
|
+
/**
|
|
538
|
+
* Retrieves this directory plus the contents of the given file copied to the given path.
|
|
401
539
|
*/
|
|
402
|
-
|
|
540
|
+
withFile(path: string, source: File, opts?: DirectoryWithFileOpts): Directory;
|
|
403
541
|
/**
|
|
404
|
-
*
|
|
542
|
+
* Retrieves this directory plus a new directory created at the given path.
|
|
405
543
|
*/
|
|
406
|
-
|
|
544
|
+
withNewDirectory(path: string, opts?: DirectoryWithNewDirectoryOpts): Directory;
|
|
407
545
|
/**
|
|
408
|
-
*
|
|
546
|
+
* Retrieves this directory plus a new file written at the given path.
|
|
409
547
|
*/
|
|
410
|
-
|
|
548
|
+
withNewFile(path: string, contents: string, opts?: DirectoryWithNewFileOpts): Directory;
|
|
411
549
|
/**
|
|
412
|
-
*
|
|
550
|
+
* Retrieves this directory with all file/dir timestamps set to the given time, in seconds from the Unix epoch.
|
|
413
551
|
*/
|
|
414
|
-
|
|
552
|
+
withTimestamps(timestamp: number): Directory;
|
|
415
553
|
/**
|
|
416
|
-
*
|
|
554
|
+
* Retrieves this directory with the directory at the given path removed.
|
|
417
555
|
*/
|
|
418
556
|
withoutDirectory(path: string): Directory;
|
|
419
557
|
/**
|
|
420
|
-
*
|
|
558
|
+
* Retrieves this directory with the file at the given path removed.
|
|
421
559
|
*/
|
|
422
560
|
withoutFile(path: string): Directory;
|
|
423
561
|
}
|
|
424
562
|
/**
|
|
425
|
-
*
|
|
563
|
+
* A simple key value object that represents an environment variable.
|
|
426
564
|
*/
|
|
427
565
|
export declare class EnvVariable extends BaseClient {
|
|
428
566
|
/**
|
|
429
|
-
*
|
|
567
|
+
* The environment variable name.
|
|
430
568
|
*/
|
|
431
569
|
name(): Promise<string>;
|
|
432
570
|
/**
|
|
433
|
-
*
|
|
571
|
+
* The environment variable value.
|
|
434
572
|
*/
|
|
435
573
|
value(): Promise<string>;
|
|
436
574
|
}
|
|
437
575
|
/**
|
|
438
|
-
* A file
|
|
576
|
+
* A file.
|
|
439
577
|
*/
|
|
440
578
|
export declare class File extends BaseClient {
|
|
441
579
|
/**
|
|
442
|
-
*
|
|
580
|
+
* Retrieves the contents of the file.
|
|
443
581
|
*/
|
|
444
582
|
contents(): Promise<string>;
|
|
445
583
|
/**
|
|
446
|
-
*
|
|
584
|
+
* Writes the file to a file path on the host.
|
|
447
585
|
*/
|
|
448
586
|
export(path: string): Promise<boolean>;
|
|
449
587
|
/**
|
|
450
|
-
*
|
|
588
|
+
* Retrieves the content-addressed identifier of the file.
|
|
451
589
|
*/
|
|
452
590
|
id(): Promise<FileID>;
|
|
591
|
+
/**
|
|
592
|
+
* Retrieves a secret referencing the contents of this file.
|
|
593
|
+
*/
|
|
453
594
|
secret(): Secret;
|
|
454
595
|
/**
|
|
455
|
-
*
|
|
596
|
+
* Gets the size of the file, in bytes.
|
|
456
597
|
*/
|
|
457
598
|
size(): Promise<number>;
|
|
599
|
+
/**
|
|
600
|
+
* Retrieves this file with its created/modified timestamps set to the given time, in seconds from the Unix epoch.
|
|
601
|
+
*/
|
|
602
|
+
withTimestamps(timestamp: number): File;
|
|
458
603
|
}
|
|
459
604
|
/**
|
|
460
|
-
* A git ref (tag or
|
|
605
|
+
* A git ref (tag, branch or commit).
|
|
461
606
|
*/
|
|
462
607
|
export declare class GitRef extends BaseClient {
|
|
463
608
|
/**
|
|
464
|
-
* The digest of the current value of this ref
|
|
609
|
+
* The digest of the current value of this ref.
|
|
465
610
|
*/
|
|
466
611
|
digest(): Promise<string>;
|
|
467
612
|
/**
|
|
468
|
-
* The filesystem tree at this ref
|
|
613
|
+
* The filesystem tree at this ref.
|
|
469
614
|
*/
|
|
470
615
|
tree(opts?: GitRefTreeOpts): Directory;
|
|
471
616
|
}
|
|
472
617
|
/**
|
|
473
|
-
* A git repository
|
|
618
|
+
* A git repository.
|
|
474
619
|
*/
|
|
475
620
|
export declare class GitRepository extends BaseClient {
|
|
476
621
|
/**
|
|
477
|
-
*
|
|
622
|
+
* Returns details on one branch.
|
|
478
623
|
*/
|
|
479
624
|
branch(name: string): GitRef;
|
|
480
625
|
/**
|
|
481
|
-
*
|
|
626
|
+
* Lists of branches on the repository.
|
|
482
627
|
*/
|
|
483
628
|
branches(): Promise<string[]>;
|
|
484
629
|
/**
|
|
485
|
-
*
|
|
630
|
+
* Returns details on one commit.
|
|
486
631
|
*/
|
|
487
632
|
commit(id: string): GitRef;
|
|
488
633
|
/**
|
|
489
|
-
*
|
|
634
|
+
* Returns details on one tag.
|
|
490
635
|
*/
|
|
491
636
|
tag(name: string): GitRef;
|
|
492
637
|
/**
|
|
493
|
-
*
|
|
638
|
+
* Lists of tags on the repository.
|
|
494
639
|
*/
|
|
495
640
|
tags(): Promise<string[]>;
|
|
496
641
|
}
|
|
497
642
|
/**
|
|
498
|
-
* Information about the host execution environment
|
|
643
|
+
* Information about the host execution environment.
|
|
499
644
|
*/
|
|
500
645
|
export declare class Host extends BaseClient {
|
|
501
646
|
/**
|
|
502
|
-
*
|
|
647
|
+
* Accesses a directory on the host.
|
|
503
648
|
*/
|
|
504
649
|
directory(path: string, opts?: HostDirectoryOpts): Directory;
|
|
505
650
|
/**
|
|
506
|
-
*
|
|
651
|
+
* Accesses an environment variable on the host.
|
|
507
652
|
*/
|
|
508
653
|
envVariable(name: string): HostVariable;
|
|
509
654
|
/**
|
|
510
|
-
*
|
|
655
|
+
* Accesses a Unix socket on the host.
|
|
511
656
|
*/
|
|
512
657
|
unixSocket(path: string): Socket;
|
|
513
658
|
/**
|
|
514
|
-
*
|
|
515
|
-
*
|
|
516
|
-
* @param opts optional params for workdir
|
|
517
|
-
*
|
|
659
|
+
* Retrieves the current working directory on the host.
|
|
518
660
|
* @deprecated Use directory with path set to '.' instead.
|
|
519
661
|
*/
|
|
520
662
|
workdir(opts?: HostWorkdirOpts): Directory;
|
|
521
663
|
}
|
|
522
664
|
/**
|
|
523
|
-
* An environment variable on the host environment
|
|
665
|
+
* An environment variable on the host environment.
|
|
524
666
|
*/
|
|
525
667
|
export declare class HostVariable extends BaseClient {
|
|
526
668
|
/**
|
|
527
|
-
* A secret referencing the value of this variable
|
|
669
|
+
* A secret referencing the value of this variable.
|
|
528
670
|
*/
|
|
529
671
|
secret(): Secret;
|
|
530
672
|
/**
|
|
531
|
-
* The value of this variable
|
|
673
|
+
* The value of this variable.
|
|
674
|
+
*/
|
|
675
|
+
value(): Promise<string>;
|
|
676
|
+
}
|
|
677
|
+
/**
|
|
678
|
+
* A simple key value object that represents a label.
|
|
679
|
+
*/
|
|
680
|
+
export declare class Label extends BaseClient {
|
|
681
|
+
/**
|
|
682
|
+
* The label name.
|
|
683
|
+
*/
|
|
684
|
+
name(): Promise<string>;
|
|
685
|
+
/**
|
|
686
|
+
* The label value.
|
|
532
687
|
*/
|
|
533
688
|
value(): Promise<string>;
|
|
534
689
|
}
|
|
@@ -563,11 +718,12 @@ export declare class Project extends BaseClient {
|
|
|
563
718
|
}
|
|
564
719
|
export default class Client extends BaseClient {
|
|
565
720
|
/**
|
|
566
|
-
*
|
|
721
|
+
* Constructs a cache volume for a given cache key.
|
|
722
|
+
* @param key A string identifier to target this cache volume (e.g. "myapp-cache").
|
|
567
723
|
*/
|
|
568
724
|
cacheVolume(key: string): CacheVolume;
|
|
569
725
|
/**
|
|
570
|
-
*
|
|
726
|
+
* Loads a container from ID.
|
|
571
727
|
* Null ID returns an empty container (scratch).
|
|
572
728
|
* Optional platform argument initializes new containers to execute and publish as that platform. Platform defaults to that of the builder's host.
|
|
573
729
|
*/
|
|
@@ -581,50 +737,54 @@ export default class Client extends BaseClient {
|
|
|
581
737
|
*/
|
|
582
738
|
directory(opts?: ClientDirectoryOpts): Directory;
|
|
583
739
|
/**
|
|
584
|
-
*
|
|
740
|
+
* Loads a file by ID.
|
|
585
741
|
*/
|
|
586
|
-
file(id: FileID
|
|
742
|
+
file(id: FileID): File;
|
|
587
743
|
/**
|
|
588
|
-
*
|
|
744
|
+
* Queries a git repository.
|
|
589
745
|
*/
|
|
590
746
|
git(url: string, opts?: ClientGitOpts): GitRepository;
|
|
591
747
|
/**
|
|
592
|
-
*
|
|
748
|
+
* Queries the host environment.
|
|
593
749
|
*/
|
|
594
750
|
host(): Host;
|
|
595
751
|
/**
|
|
596
|
-
*
|
|
752
|
+
* Returns a file containing an http remote url content.
|
|
597
753
|
*/
|
|
598
754
|
http(url: string): File;
|
|
755
|
+
/**
|
|
756
|
+
* Creates a named sub-pipeline
|
|
757
|
+
*/
|
|
758
|
+
pipeline(name: string, opts?: ClientPipelineOpts): Client;
|
|
599
759
|
/**
|
|
600
760
|
* Look up a project by name
|
|
601
761
|
*/
|
|
602
762
|
project(name: string): Project;
|
|
603
763
|
/**
|
|
604
|
-
*
|
|
764
|
+
* Loads a secret from its ID.
|
|
605
765
|
*/
|
|
606
|
-
secret(id: SecretID
|
|
766
|
+
secret(id: SecretID): Secret;
|
|
607
767
|
/**
|
|
608
|
-
*
|
|
768
|
+
* Loads a socket by its ID.
|
|
609
769
|
*/
|
|
610
770
|
socket(opts?: ClientSocketOpts): Socket;
|
|
611
771
|
}
|
|
612
772
|
/**
|
|
613
|
-
* A reference to a secret value, which can be handled more safely than the value itself
|
|
773
|
+
* A reference to a secret value, which can be handled more safely than the value itself.
|
|
614
774
|
*/
|
|
615
775
|
export declare class Secret extends BaseClient {
|
|
616
776
|
/**
|
|
617
|
-
* The identifier for this secret
|
|
777
|
+
* The identifier for this secret.
|
|
618
778
|
*/
|
|
619
779
|
id(): Promise<SecretID>;
|
|
620
780
|
/**
|
|
621
|
-
* The value of this secret
|
|
781
|
+
* The value of this secret.
|
|
622
782
|
*/
|
|
623
783
|
plaintext(): Promise<string>;
|
|
624
784
|
}
|
|
625
785
|
export declare class Socket extends BaseClient {
|
|
626
786
|
/**
|
|
627
|
-
* The content-addressed identifier of the socket
|
|
787
|
+
* The content-addressed identifier of the socket.
|
|
628
788
|
*/
|
|
629
789
|
id(): Promise<SocketID>;
|
|
630
790
|
}
|