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