@pulumi/docker-build 0.0.1-alpha.3 → 0.0.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 +17 -100
- package/image.d.ts +48 -62
- package/image.js +41 -49
- package/image.js.map +1 -1
- package/index_.d.ts +17 -5
- package/index_.js +17 -5
- package/index_.js.map +1 -1
- package/package.json +6 -6
- package/package.json.dev +5 -5
- package/utilities.js +1 -1
- package/utilities.js.map +1 -1
package/README.md
CHANGED
|
@@ -1,106 +1,23 @@
|
|
|
1
|
-
|
|
1
|
+
[](https://slack.pulumi.com)
|
|
2
|
+
[](https://www.npmjs.com/package/@pulumi/docker-build)
|
|
3
|
+
[](https://pypi.org/project/pulumi-docker-build)
|
|
4
|
+
[](https://badge.fury.io/nu/pulumi.dockerbuild)
|
|
5
|
+
[](https://pkg.go.dev/github.com/pulumi/pulumi-docker-build/sdk/go)
|
|
6
|
+
[](https://github.com/pulumi/pulumi-docker-build/blob/main/LICENSE)
|
|
2
7
|
|
|
3
|
-
|
|
8
|
+
# Docker-Build Resource Provider
|
|
4
9
|
|
|
5
|
-
|
|
10
|
+
A [Pulumi](http://pulumi.com) provider for building modern Docker images with [buildx](https://docs.docker.com/build/architecture/) and [BuildKit](https://docs.docker.com/build/buildkit/).
|
|
6
11
|
|
|
7
|
-
|
|
8
|
-
|
|
12
|
+
Not to be confused with the earlier
|
|
13
|
+
[Docker](http://github.com/pulumi/pulumi-docker) provider, which is still
|
|
14
|
+
appropriate for managing resources unrelated to building images.
|
|
9
15
|
|
|
16
|
+
| Provider | Use cases |
|
|
17
|
+
| ---------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
18
|
+
| `@pulumi/docker-build` | Anything related to building images with `docker build`. |
|
|
19
|
+
| `@pulumi/docker` | Everything else -- including running containers and creating networks. |
|
|
10
20
|
|
|
11
|
-
|
|
21
|
+
## Reference
|
|
12
22
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
If you are not using VSCode, you will need to ensure the following tools are installed and present in your `$PATH`:
|
|
16
|
-
|
|
17
|
-
* [`pulumictl`](https://github.com/pulumi/pulumictl#installation)
|
|
18
|
-
* [Go 1.21](https://golang.org/dl/) or 1.latest
|
|
19
|
-
* [NodeJS](https://nodejs.org/en/) 14.x. We recommend using [nvm](https://github.com/nvm-sh/nvm) to manage NodeJS installations.
|
|
20
|
-
* [Yarn](https://yarnpkg.com/)
|
|
21
|
-
* [TypeScript](https://www.typescriptlang.org/)
|
|
22
|
-
* [Python](https://www.python.org/downloads/) (called as `python3`). For recent versions of MacOS, the system-installed version is fine.
|
|
23
|
-
* [.NET](https://dotnet.microsoft.com/download)
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
### Build & test the boilerplate XYZ provider
|
|
27
|
-
|
|
28
|
-
1. Create a new Github CodeSpaces environment using this repository.
|
|
29
|
-
1. Open a terminal in the CodeSpaces environment.
|
|
30
|
-
1. Run `make build install` to build and install the provider.
|
|
31
|
-
1. Run `make gen_examples` to generate the example programs in `examples/` off of the source `examples/yaml` example program.
|
|
32
|
-
1. Run `make up` to run the example program in `examples/yaml`.
|
|
33
|
-
1. Run `make down` to tear down the example program.
|
|
34
|
-
|
|
35
|
-
### Creating a new provider repository
|
|
36
|
-
|
|
37
|
-
Pulumi offers this repository as a [GitHub template repository](https://docs.github.com/en/repositories/creating-and-managing-repositories/creating-a-repository-from-a-template) for convenience. From this repository:
|
|
38
|
-
|
|
39
|
-
1. Click "Use this template".
|
|
40
|
-
1. Set the following options:
|
|
41
|
-
* Owner: pulumi
|
|
42
|
-
* Repository name: pulumi-xyz-native (replace "xyz" with the name of your provider)
|
|
43
|
-
* Description: Pulumi provider for xyz
|
|
44
|
-
* Repository type: Public
|
|
45
|
-
1. Clone the generated repository.
|
|
46
|
-
|
|
47
|
-
From the templated repository:
|
|
48
|
-
|
|
49
|
-
1. Search-replace `xyz` with the name of your desired provider.
|
|
50
|
-
|
|
51
|
-
#### Build the provider and install the plugin
|
|
52
|
-
|
|
53
|
-
```bash
|
|
54
|
-
$ make build install
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
This will:
|
|
58
|
-
|
|
59
|
-
1. Create the SDK codegen binary and place it in a `./bin` folder (gitignored)
|
|
60
|
-
2. Create the provider binary and place it in the `./bin` folder (gitignored)
|
|
61
|
-
3. Generate the dotnet, Go, Node, and Python SDKs and place them in the `./sdk` folder
|
|
62
|
-
4. Install the provider on your machine.
|
|
63
|
-
|
|
64
|
-
#### Test against the example
|
|
65
|
-
|
|
66
|
-
```bash
|
|
67
|
-
$ cd examples/simple
|
|
68
|
-
$ yarn link @pulumi/xyz
|
|
69
|
-
$ yarn install
|
|
70
|
-
$ pulumi stack init test
|
|
71
|
-
$ pulumi up
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
Now that you have completed all of the above steps, you have a working provider that generates a random string for you.
|
|
75
|
-
|
|
76
|
-
#### A brief repository overview
|
|
77
|
-
|
|
78
|
-
You now have:
|
|
79
|
-
|
|
80
|
-
1. A `provider/` folder containing the building and implementation logic
|
|
81
|
-
1. `cmd/pulumi-resource-xyz/main.go` - holds the provider's sample implementation logic.
|
|
82
|
-
2. `deployment-templates` - a set of files to help you around deployment and publication
|
|
83
|
-
3. `sdk` - holds the generated code libraries created by `pulumi-gen-xyz/main.go`
|
|
84
|
-
4. `examples` a folder of Pulumi programs to try locally and/or use in CI.
|
|
85
|
-
5. A `Makefile` and this `README`.
|
|
86
|
-
|
|
87
|
-
#### Additional Details
|
|
88
|
-
|
|
89
|
-
This repository depends on the pulumi-go-provider library. For more details on building providers, please check
|
|
90
|
-
the [Pulumi Go Provider docs](https://github.com/pulumi/pulumi-go-provider).
|
|
91
|
-
|
|
92
|
-
### Build Examples
|
|
93
|
-
|
|
94
|
-
Create an example program using the resources defined in your provider, and place it in the `examples/` folder.
|
|
95
|
-
|
|
96
|
-
You can now repeat the steps for [build, install, and test](#test-against-the-example).
|
|
97
|
-
|
|
98
|
-
## Configuring CI and releases
|
|
99
|
-
|
|
100
|
-
1. Follow the instructions laid out in the [deployment templates](./deployment-templates/README-DEPLOYMENT.md).
|
|
101
|
-
|
|
102
|
-
## References
|
|
103
|
-
|
|
104
|
-
Other resources/examples for implementing providers:
|
|
105
|
-
* [Pulumi Command provider](https://github.com/pulumi/pulumi-command/blob/master/provider/pkg/provider/provider.go)
|
|
106
|
-
* [Pulumi Go Provider repository](https://github.com/pulumi/pulumi-go-provider)
|
|
23
|
+
For more information, including examples and migration guidance, please see the Docker-Build provider's detailed [API documentation](https://www.pulumi.com/registry/packages/docker-build/).
|
package/image.d.ts
CHANGED
|
@@ -8,20 +8,14 @@ import * as enums from "./types/enums";
|
|
|
8
8
|
*
|
|
9
9
|
* ## Stability
|
|
10
10
|
*
|
|
11
|
-
* **This resource is
|
|
11
|
+
* **This resource is pre-1.0 and in public preview.**
|
|
12
12
|
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
13
|
+
* We will strive to keep APIs and behavior as stable as possible, but we
|
|
14
|
+
* cannot guarantee stability until version 1.0.
|
|
15
15
|
*
|
|
16
|
-
*
|
|
17
|
-
* stable. This enables future API changes to be adopted more easily by renaming
|
|
18
|
-
* resources.
|
|
16
|
+
* ## Migrating Pulumi Docker v3 and v4 Image resources
|
|
19
17
|
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
* ## Migrating v3 and v4 Image resources
|
|
23
|
-
*
|
|
24
|
-
* The `Image` resource provides a superset of functionality over the `Image` resources available in versions 3 and 4 of the Pulumi Docker provider.
|
|
18
|
+
* This provider's `Image` resource provides a superset of functionality over the `Image` resources available in versions 3 and 4 of the Pulumi Docker provider.
|
|
25
19
|
* Existing `Image` resources can be converted to the docker-build `Image` resources with minor modifications.
|
|
26
20
|
*
|
|
27
21
|
* ### Behavioral differences
|
|
@@ -35,19 +29,17 @@ import * as enums from "./types/enums";
|
|
|
35
29
|
*
|
|
36
30
|
* Version `4.x` changed build-on-preview behavior to be opt-in.
|
|
37
31
|
* By default, `v4.x` `Image` resources do _not_ build during previews, but this behavior can be toggled with the `buildOnPreview` option.
|
|
38
|
-
*
|
|
32
|
+
* Several users reported outages due to the default behavior allowing bad images to accidentally sneak through CI.
|
|
39
33
|
*
|
|
40
|
-
* The default behavior of
|
|
41
|
-
*
|
|
42
|
-
* Previews run in non-CI environments will not build images.
|
|
43
|
-
* This behavior is still configurable with `buildOnPreview`.
|
|
34
|
+
* The default behavior of this provider's `Image` resource is similar to `3.x` and will build images during previews.
|
|
35
|
+
* This behavior can be changed by specifying `buildOnPreview`.
|
|
44
36
|
*
|
|
45
37
|
* #### Push behavior
|
|
46
38
|
*
|
|
47
39
|
* Versions `3.x` and `4.x` of the Pulumi Docker provider attempt to push images to remote registries by default.
|
|
48
40
|
* They expose a `skipPush: true` option to disable pushing.
|
|
49
41
|
*
|
|
50
|
-
*
|
|
42
|
+
* This provider's `Image` resource matches the Docker CLI's behavior and does not push images anywhere by default.
|
|
51
43
|
*
|
|
52
44
|
* To push images to a registry you can include `push: true` (equivalent to Docker's `--push` flag) or configure an `export` of type `registry` (equivalent to Docker's `--output type=registry`).
|
|
53
45
|
* Like Docker, if an image is configured without exports you will see a warning with instructions for how to enable pushing, but the build will still proceed normally.
|
|
@@ -165,7 +157,7 @@ import * as enums from "./types/enums";
|
|
|
165
157
|
* context: {
|
|
166
158
|
* location: "../app",
|
|
167
159
|
* },
|
|
168
|
-
*
|
|
160
|
+
* target: "mytarget",
|
|
169
161
|
* buildArgs: {
|
|
170
162
|
* MY_BUILD_ARG: "foo",
|
|
171
163
|
* },
|
|
@@ -224,7 +216,7 @@ import * as enums from "./types/enums";
|
|
|
224
216
|
* context: {
|
|
225
217
|
* location: "../app",
|
|
226
218
|
* },
|
|
227
|
-
*
|
|
219
|
+
* target: "mytarget",
|
|
228
220
|
* buildArgs: {
|
|
229
221
|
* MY_BUILD_ARG: "foo",
|
|
230
222
|
* },
|
|
@@ -248,13 +240,13 @@ import * as enums from "./types/enums";
|
|
|
248
240
|
* ```typescript
|
|
249
241
|
* import * as pulumi from "@pulumi/pulumi";
|
|
250
242
|
* import * as aws from "@pulumi/aws";
|
|
251
|
-
* import * as
|
|
243
|
+
* import * as docker_build from "@pulumi/docker-build";
|
|
252
244
|
*
|
|
253
245
|
* const ecrRepository = new aws.ecr.Repository("ecr-repository", {});
|
|
254
246
|
* const authToken = aws.ecr.getAuthorizationTokenOutput({
|
|
255
247
|
* registryId: ecrRepository.registryId,
|
|
256
248
|
* });
|
|
257
|
-
* const myImage = new
|
|
249
|
+
* const myImage = new docker_build.Image("my-image", {
|
|
258
250
|
* cacheFrom: [{
|
|
259
251
|
* registry: {
|
|
260
252
|
* ref: pulumi.interpolate`${ecrRepository.repositoryUrl}:cache`,
|
|
@@ -284,15 +276,15 @@ import * as enums from "./types/enums";
|
|
|
284
276
|
*
|
|
285
277
|
* ```typescript
|
|
286
278
|
* import * as pulumi from "@pulumi/pulumi";
|
|
287
|
-
* import * as
|
|
279
|
+
* import * as docker_build from "@pulumi/docker-build";
|
|
288
280
|
*
|
|
289
|
-
* const image = new
|
|
281
|
+
* const image = new docker_build.Image("image", {
|
|
290
282
|
* context: {
|
|
291
283
|
* location: "app",
|
|
292
284
|
* },
|
|
293
285
|
* platforms: [
|
|
294
|
-
*
|
|
295
|
-
*
|
|
286
|
+
* docker_build.Platform.Plan9_amd64,
|
|
287
|
+
* docker_build.Platform.Plan9_386,
|
|
296
288
|
* ],
|
|
297
289
|
* });
|
|
298
290
|
* ```
|
|
@@ -300,9 +292,9 @@ import * as enums from "./types/enums";
|
|
|
300
292
|
*
|
|
301
293
|
* ```typescript
|
|
302
294
|
* import * as pulumi from "@pulumi/pulumi";
|
|
303
|
-
* import * as
|
|
295
|
+
* import * as docker_build from "@pulumi/docker-build";
|
|
304
296
|
*
|
|
305
|
-
* const image = new
|
|
297
|
+
* const image = new docker_build.Image("image", {
|
|
306
298
|
* context: {
|
|
307
299
|
* location: "app",
|
|
308
300
|
* },
|
|
@@ -320,9 +312,9 @@ import * as enums from "./types/enums";
|
|
|
320
312
|
*
|
|
321
313
|
* ```typescript
|
|
322
314
|
* import * as pulumi from "@pulumi/pulumi";
|
|
323
|
-
* import * as
|
|
315
|
+
* import * as docker_build from "@pulumi/docker-build";
|
|
324
316
|
*
|
|
325
|
-
* const image = new
|
|
317
|
+
* const image = new docker_build.Image("image", {
|
|
326
318
|
* cacheFrom: [{
|
|
327
319
|
* local: {
|
|
328
320
|
* src: "tmp/cache",
|
|
@@ -331,7 +323,7 @@ import * as enums from "./types/enums";
|
|
|
331
323
|
* cacheTo: [{
|
|
332
324
|
* local: {
|
|
333
325
|
* dest: "tmp/cache",
|
|
334
|
-
* mode:
|
|
326
|
+
* mode: docker_build.CacheMode.Max,
|
|
335
327
|
* },
|
|
336
328
|
* }],
|
|
337
329
|
* context: {
|
|
@@ -343,9 +335,9 @@ import * as enums from "./types/enums";
|
|
|
343
335
|
*
|
|
344
336
|
* ```typescript
|
|
345
337
|
* import * as pulumi from "@pulumi/pulumi";
|
|
346
|
-
* import * as
|
|
338
|
+
* import * as docker_build from "@pulumi/docker-build";
|
|
347
339
|
*
|
|
348
|
-
* const image = new
|
|
340
|
+
* const image = new docker_build.Image("image", {
|
|
349
341
|
* builder: {
|
|
350
342
|
* name: "cloud-builder-name",
|
|
351
343
|
* },
|
|
@@ -359,9 +351,9 @@ import * as enums from "./types/enums";
|
|
|
359
351
|
*
|
|
360
352
|
* ```typescript
|
|
361
353
|
* import * as pulumi from "@pulumi/pulumi";
|
|
362
|
-
* import * as
|
|
354
|
+
* import * as docker_build from "@pulumi/docker-build";
|
|
363
355
|
*
|
|
364
|
-
* const image = new
|
|
356
|
+
* const image = new docker_build.Image("image", {
|
|
365
357
|
* buildArgs: {
|
|
366
358
|
* SET_ME_TO_TRUE: "true",
|
|
367
359
|
* },
|
|
@@ -374,9 +366,9 @@ import * as enums from "./types/enums";
|
|
|
374
366
|
*
|
|
375
367
|
* ```typescript
|
|
376
368
|
* import * as pulumi from "@pulumi/pulumi";
|
|
377
|
-
* import * as
|
|
369
|
+
* import * as docker_build from "@pulumi/docker-build";
|
|
378
370
|
*
|
|
379
|
-
* const image = new
|
|
371
|
+
* const image = new docker_build.Image("image", {
|
|
380
372
|
* context: {
|
|
381
373
|
* location: "app",
|
|
382
374
|
* },
|
|
@@ -387,9 +379,9 @@ import * as enums from "./types/enums";
|
|
|
387
379
|
*
|
|
388
380
|
* ```typescript
|
|
389
381
|
* import * as pulumi from "@pulumi/pulumi";
|
|
390
|
-
* import * as
|
|
382
|
+
* import * as docker_build from "@pulumi/docker-build";
|
|
391
383
|
*
|
|
392
|
-
* const image = new
|
|
384
|
+
* const image = new docker_build.Image("image", {context: {
|
|
393
385
|
* location: "app",
|
|
394
386
|
* named: {
|
|
395
387
|
* "golang:latest": {
|
|
@@ -402,9 +394,9 @@ import * as enums from "./types/enums";
|
|
|
402
394
|
*
|
|
403
395
|
* ```typescript
|
|
404
396
|
* import * as pulumi from "@pulumi/pulumi";
|
|
405
|
-
* import * as
|
|
397
|
+
* import * as docker_build from "@pulumi/docker-build";
|
|
406
398
|
*
|
|
407
|
-
* const image = new
|
|
399
|
+
* const image = new docker_build.Image("image", {context: {
|
|
408
400
|
* location: "https://raw.githubusercontent.com/pulumi/pulumi-docker/api-types/provider/testdata/Dockerfile",
|
|
409
401
|
* }});
|
|
410
402
|
* ```
|
|
@@ -412,9 +404,9 @@ import * as enums from "./types/enums";
|
|
|
412
404
|
*
|
|
413
405
|
* ```typescript
|
|
414
406
|
* import * as pulumi from "@pulumi/pulumi";
|
|
415
|
-
* import * as
|
|
407
|
+
* import * as docker_build from "@pulumi/docker-build";
|
|
416
408
|
*
|
|
417
|
-
* const image = new
|
|
409
|
+
* const image = new docker_build.Image("image", {
|
|
418
410
|
* context: {
|
|
419
411
|
* location: "app",
|
|
420
412
|
* },
|
|
@@ -429,9 +421,9 @@ import * as enums from "./types/enums";
|
|
|
429
421
|
*
|
|
430
422
|
* ```typescript
|
|
431
423
|
* import * as pulumi from "@pulumi/pulumi";
|
|
432
|
-
* import * as
|
|
424
|
+
* import * as docker_build from "@pulumi/docker-build";
|
|
433
425
|
*
|
|
434
|
-
* const image = new
|
|
426
|
+
* const image = new docker_build.Image("image", {
|
|
435
427
|
* context: {
|
|
436
428
|
* location: "https://github.com/docker-library/hello-world.git",
|
|
437
429
|
* },
|
|
@@ -444,9 +436,9 @@ import * as enums from "./types/enums";
|
|
|
444
436
|
*
|
|
445
437
|
* ```typescript
|
|
446
438
|
* import * as pulumi from "@pulumi/pulumi";
|
|
447
|
-
* import * as
|
|
439
|
+
* import * as docker_build from "@pulumi/docker-build";
|
|
448
440
|
*
|
|
449
|
-
* const image = new
|
|
441
|
+
* const image = new docker_build.Image("image", {
|
|
450
442
|
* context: {
|
|
451
443
|
* location: "app",
|
|
452
444
|
* },
|
|
@@ -494,20 +486,17 @@ export declare class Image extends pulumi.CustomResource {
|
|
|
494
486
|
[key: string]: string;
|
|
495
487
|
} | undefined>;
|
|
496
488
|
/**
|
|
497
|
-
*
|
|
498
|
-
*
|
|
499
|
-
* Travis CI, Azure Pipelines, etc.) then it will build images during
|
|
500
|
-
* previews as a safeguard. Otherwise, if not running on CI, previews will
|
|
501
|
-
* not build images.
|
|
502
|
-
*
|
|
503
|
-
* Setting this to `false` forces previews to never perform builds, and
|
|
504
|
-
* setting it to `true` will always build the image during previews.
|
|
489
|
+
* Setting this to `false` will always skip image builds during previews,
|
|
490
|
+
* and setting it to `true` will always build images during previews.
|
|
505
491
|
*
|
|
506
492
|
* Images built during previews are never exported to registries, however
|
|
507
493
|
* cache manifests are still exported.
|
|
508
494
|
*
|
|
509
495
|
* On-disk Dockerfiles are always validated for syntactic correctness
|
|
510
496
|
* regardless of this setting.
|
|
497
|
+
*
|
|
498
|
+
* Defaults to `true` as a safeguard against broken images merging as part
|
|
499
|
+
* of CI pipelines.
|
|
511
500
|
*/
|
|
512
501
|
readonly buildOnPreview: pulumi.Output<boolean | undefined>;
|
|
513
502
|
/**
|
|
@@ -737,20 +726,17 @@ export interface ImageArgs {
|
|
|
737
726
|
[key: string]: pulumi.Input<string>;
|
|
738
727
|
}>;
|
|
739
728
|
/**
|
|
740
|
-
*
|
|
741
|
-
*
|
|
742
|
-
* Travis CI, Azure Pipelines, etc.) then it will build images during
|
|
743
|
-
* previews as a safeguard. Otherwise, if not running on CI, previews will
|
|
744
|
-
* not build images.
|
|
745
|
-
*
|
|
746
|
-
* Setting this to `false` forces previews to never perform builds, and
|
|
747
|
-
* setting it to `true` will always build the image during previews.
|
|
729
|
+
* Setting this to `false` will always skip image builds during previews,
|
|
730
|
+
* and setting it to `true` will always build images during previews.
|
|
748
731
|
*
|
|
749
732
|
* Images built during previews are never exported to registries, however
|
|
750
733
|
* cache manifests are still exported.
|
|
751
734
|
*
|
|
752
735
|
* On-disk Dockerfiles are always validated for syntactic correctness
|
|
753
736
|
* regardless of this setting.
|
|
737
|
+
*
|
|
738
|
+
* Defaults to `true` as a safeguard against broken images merging as part
|
|
739
|
+
* of CI pipelines.
|
|
754
740
|
*/
|
|
755
741
|
buildOnPreview?: pulumi.Input<boolean>;
|
|
756
742
|
/**
|
package/image.js
CHANGED
|
@@ -11,20 +11,14 @@ const utilities = require("./utilities");
|
|
|
11
11
|
*
|
|
12
12
|
* ## Stability
|
|
13
13
|
*
|
|
14
|
-
* **This resource is
|
|
14
|
+
* **This resource is pre-1.0 and in public preview.**
|
|
15
15
|
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
16
|
+
* We will strive to keep APIs and behavior as stable as possible, but we
|
|
17
|
+
* cannot guarantee stability until version 1.0.
|
|
18
18
|
*
|
|
19
|
-
*
|
|
20
|
-
* stable. This enables future API changes to be adopted more easily by renaming
|
|
21
|
-
* resources.
|
|
19
|
+
* ## Migrating Pulumi Docker v3 and v4 Image resources
|
|
22
20
|
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
* ## Migrating v3 and v4 Image resources
|
|
26
|
-
*
|
|
27
|
-
* The `Image` resource provides a superset of functionality over the `Image` resources available in versions 3 and 4 of the Pulumi Docker provider.
|
|
21
|
+
* This provider's `Image` resource provides a superset of functionality over the `Image` resources available in versions 3 and 4 of the Pulumi Docker provider.
|
|
28
22
|
* Existing `Image` resources can be converted to the docker-build `Image` resources with minor modifications.
|
|
29
23
|
*
|
|
30
24
|
* ### Behavioral differences
|
|
@@ -38,19 +32,17 @@ const utilities = require("./utilities");
|
|
|
38
32
|
*
|
|
39
33
|
* Version `4.x` changed build-on-preview behavior to be opt-in.
|
|
40
34
|
* By default, `v4.x` `Image` resources do _not_ build during previews, but this behavior can be toggled with the `buildOnPreview` option.
|
|
41
|
-
*
|
|
35
|
+
* Several users reported outages due to the default behavior allowing bad images to accidentally sneak through CI.
|
|
42
36
|
*
|
|
43
|
-
* The default behavior of
|
|
44
|
-
*
|
|
45
|
-
* Previews run in non-CI environments will not build images.
|
|
46
|
-
* This behavior is still configurable with `buildOnPreview`.
|
|
37
|
+
* The default behavior of this provider's `Image` resource is similar to `3.x` and will build images during previews.
|
|
38
|
+
* This behavior can be changed by specifying `buildOnPreview`.
|
|
47
39
|
*
|
|
48
40
|
* #### Push behavior
|
|
49
41
|
*
|
|
50
42
|
* Versions `3.x` and `4.x` of the Pulumi Docker provider attempt to push images to remote registries by default.
|
|
51
43
|
* They expose a `skipPush: true` option to disable pushing.
|
|
52
44
|
*
|
|
53
|
-
*
|
|
45
|
+
* This provider's `Image` resource matches the Docker CLI's behavior and does not push images anywhere by default.
|
|
54
46
|
*
|
|
55
47
|
* To push images to a registry you can include `push: true` (equivalent to Docker's `--push` flag) or configure an `export` of type `registry` (equivalent to Docker's `--output type=registry`).
|
|
56
48
|
* Like Docker, if an image is configured without exports you will see a warning with instructions for how to enable pushing, but the build will still proceed normally.
|
|
@@ -168,7 +160,7 @@ const utilities = require("./utilities");
|
|
|
168
160
|
* context: {
|
|
169
161
|
* location: "../app",
|
|
170
162
|
* },
|
|
171
|
-
*
|
|
163
|
+
* target: "mytarget",
|
|
172
164
|
* buildArgs: {
|
|
173
165
|
* MY_BUILD_ARG: "foo",
|
|
174
166
|
* },
|
|
@@ -227,7 +219,7 @@ const utilities = require("./utilities");
|
|
|
227
219
|
* context: {
|
|
228
220
|
* location: "../app",
|
|
229
221
|
* },
|
|
230
|
-
*
|
|
222
|
+
* target: "mytarget",
|
|
231
223
|
* buildArgs: {
|
|
232
224
|
* MY_BUILD_ARG: "foo",
|
|
233
225
|
* },
|
|
@@ -251,13 +243,13 @@ const utilities = require("./utilities");
|
|
|
251
243
|
* ```typescript
|
|
252
244
|
* import * as pulumi from "@pulumi/pulumi";
|
|
253
245
|
* import * as aws from "@pulumi/aws";
|
|
254
|
-
* import * as
|
|
246
|
+
* import * as docker_build from "@pulumi/docker-build";
|
|
255
247
|
*
|
|
256
248
|
* const ecrRepository = new aws.ecr.Repository("ecr-repository", {});
|
|
257
249
|
* const authToken = aws.ecr.getAuthorizationTokenOutput({
|
|
258
250
|
* registryId: ecrRepository.registryId,
|
|
259
251
|
* });
|
|
260
|
-
* const myImage = new
|
|
252
|
+
* const myImage = new docker_build.Image("my-image", {
|
|
261
253
|
* cacheFrom: [{
|
|
262
254
|
* registry: {
|
|
263
255
|
* ref: pulumi.interpolate`${ecrRepository.repositoryUrl}:cache`,
|
|
@@ -287,15 +279,15 @@ const utilities = require("./utilities");
|
|
|
287
279
|
*
|
|
288
280
|
* ```typescript
|
|
289
281
|
* import * as pulumi from "@pulumi/pulumi";
|
|
290
|
-
* import * as
|
|
282
|
+
* import * as docker_build from "@pulumi/docker-build";
|
|
291
283
|
*
|
|
292
|
-
* const image = new
|
|
284
|
+
* const image = new docker_build.Image("image", {
|
|
293
285
|
* context: {
|
|
294
286
|
* location: "app",
|
|
295
287
|
* },
|
|
296
288
|
* platforms: [
|
|
297
|
-
*
|
|
298
|
-
*
|
|
289
|
+
* docker_build.Platform.Plan9_amd64,
|
|
290
|
+
* docker_build.Platform.Plan9_386,
|
|
299
291
|
* ],
|
|
300
292
|
* });
|
|
301
293
|
* ```
|
|
@@ -303,9 +295,9 @@ const utilities = require("./utilities");
|
|
|
303
295
|
*
|
|
304
296
|
* ```typescript
|
|
305
297
|
* import * as pulumi from "@pulumi/pulumi";
|
|
306
|
-
* import * as
|
|
298
|
+
* import * as docker_build from "@pulumi/docker-build";
|
|
307
299
|
*
|
|
308
|
-
* const image = new
|
|
300
|
+
* const image = new docker_build.Image("image", {
|
|
309
301
|
* context: {
|
|
310
302
|
* location: "app",
|
|
311
303
|
* },
|
|
@@ -323,9 +315,9 @@ const utilities = require("./utilities");
|
|
|
323
315
|
*
|
|
324
316
|
* ```typescript
|
|
325
317
|
* import * as pulumi from "@pulumi/pulumi";
|
|
326
|
-
* import * as
|
|
318
|
+
* import * as docker_build from "@pulumi/docker-build";
|
|
327
319
|
*
|
|
328
|
-
* const image = new
|
|
320
|
+
* const image = new docker_build.Image("image", {
|
|
329
321
|
* cacheFrom: [{
|
|
330
322
|
* local: {
|
|
331
323
|
* src: "tmp/cache",
|
|
@@ -334,7 +326,7 @@ const utilities = require("./utilities");
|
|
|
334
326
|
* cacheTo: [{
|
|
335
327
|
* local: {
|
|
336
328
|
* dest: "tmp/cache",
|
|
337
|
-
* mode:
|
|
329
|
+
* mode: docker_build.CacheMode.Max,
|
|
338
330
|
* },
|
|
339
331
|
* }],
|
|
340
332
|
* context: {
|
|
@@ -346,9 +338,9 @@ const utilities = require("./utilities");
|
|
|
346
338
|
*
|
|
347
339
|
* ```typescript
|
|
348
340
|
* import * as pulumi from "@pulumi/pulumi";
|
|
349
|
-
* import * as
|
|
341
|
+
* import * as docker_build from "@pulumi/docker-build";
|
|
350
342
|
*
|
|
351
|
-
* const image = new
|
|
343
|
+
* const image = new docker_build.Image("image", {
|
|
352
344
|
* builder: {
|
|
353
345
|
* name: "cloud-builder-name",
|
|
354
346
|
* },
|
|
@@ -362,9 +354,9 @@ const utilities = require("./utilities");
|
|
|
362
354
|
*
|
|
363
355
|
* ```typescript
|
|
364
356
|
* import * as pulumi from "@pulumi/pulumi";
|
|
365
|
-
* import * as
|
|
357
|
+
* import * as docker_build from "@pulumi/docker-build";
|
|
366
358
|
*
|
|
367
|
-
* const image = new
|
|
359
|
+
* const image = new docker_build.Image("image", {
|
|
368
360
|
* buildArgs: {
|
|
369
361
|
* SET_ME_TO_TRUE: "true",
|
|
370
362
|
* },
|
|
@@ -377,9 +369,9 @@ const utilities = require("./utilities");
|
|
|
377
369
|
*
|
|
378
370
|
* ```typescript
|
|
379
371
|
* import * as pulumi from "@pulumi/pulumi";
|
|
380
|
-
* import * as
|
|
372
|
+
* import * as docker_build from "@pulumi/docker-build";
|
|
381
373
|
*
|
|
382
|
-
* const image = new
|
|
374
|
+
* const image = new docker_build.Image("image", {
|
|
383
375
|
* context: {
|
|
384
376
|
* location: "app",
|
|
385
377
|
* },
|
|
@@ -390,9 +382,9 @@ const utilities = require("./utilities");
|
|
|
390
382
|
*
|
|
391
383
|
* ```typescript
|
|
392
384
|
* import * as pulumi from "@pulumi/pulumi";
|
|
393
|
-
* import * as
|
|
385
|
+
* import * as docker_build from "@pulumi/docker-build";
|
|
394
386
|
*
|
|
395
|
-
* const image = new
|
|
387
|
+
* const image = new docker_build.Image("image", {context: {
|
|
396
388
|
* location: "app",
|
|
397
389
|
* named: {
|
|
398
390
|
* "golang:latest": {
|
|
@@ -405,9 +397,9 @@ const utilities = require("./utilities");
|
|
|
405
397
|
*
|
|
406
398
|
* ```typescript
|
|
407
399
|
* import * as pulumi from "@pulumi/pulumi";
|
|
408
|
-
* import * as
|
|
400
|
+
* import * as docker_build from "@pulumi/docker-build";
|
|
409
401
|
*
|
|
410
|
-
* const image = new
|
|
402
|
+
* const image = new docker_build.Image("image", {context: {
|
|
411
403
|
* location: "https://raw.githubusercontent.com/pulumi/pulumi-docker/api-types/provider/testdata/Dockerfile",
|
|
412
404
|
* }});
|
|
413
405
|
* ```
|
|
@@ -415,9 +407,9 @@ const utilities = require("./utilities");
|
|
|
415
407
|
*
|
|
416
408
|
* ```typescript
|
|
417
409
|
* import * as pulumi from "@pulumi/pulumi";
|
|
418
|
-
* import * as
|
|
410
|
+
* import * as docker_build from "@pulumi/docker-build";
|
|
419
411
|
*
|
|
420
|
-
* const image = new
|
|
412
|
+
* const image = new docker_build.Image("image", {
|
|
421
413
|
* context: {
|
|
422
414
|
* location: "app",
|
|
423
415
|
* },
|
|
@@ -432,9 +424,9 @@ const utilities = require("./utilities");
|
|
|
432
424
|
*
|
|
433
425
|
* ```typescript
|
|
434
426
|
* import * as pulumi from "@pulumi/pulumi";
|
|
435
|
-
* import * as
|
|
427
|
+
* import * as docker_build from "@pulumi/docker-build";
|
|
436
428
|
*
|
|
437
|
-
* const image = new
|
|
429
|
+
* const image = new docker_build.Image("image", {
|
|
438
430
|
* context: {
|
|
439
431
|
* location: "https://github.com/docker-library/hello-world.git",
|
|
440
432
|
* },
|
|
@@ -447,9 +439,9 @@ const utilities = require("./utilities");
|
|
|
447
439
|
*
|
|
448
440
|
* ```typescript
|
|
449
441
|
* import * as pulumi from "@pulumi/pulumi";
|
|
450
|
-
* import * as
|
|
442
|
+
* import * as docker_build from "@pulumi/docker-build";
|
|
451
443
|
*
|
|
452
|
-
* const image = new
|
|
444
|
+
* const image = new docker_build.Image("image", {
|
|
453
445
|
* context: {
|
|
454
446
|
* location: "app",
|
|
455
447
|
* },
|
|
@@ -491,13 +483,13 @@ class Image extends pulumi.CustomResource {
|
|
|
491
483
|
* @param opts A bag of options that control this resource's behavior.
|
|
492
484
|
*/
|
|
493
485
|
constructor(name, args, opts) {
|
|
494
|
-
var _a;
|
|
486
|
+
var _a, _b;
|
|
495
487
|
let resourceInputs = {};
|
|
496
488
|
opts = opts || {};
|
|
497
489
|
if (!opts.id) {
|
|
498
490
|
resourceInputs["addHosts"] = args ? args.addHosts : undefined;
|
|
499
491
|
resourceInputs["buildArgs"] = args ? args.buildArgs : undefined;
|
|
500
|
-
resourceInputs["buildOnPreview"] = args ? args.buildOnPreview : undefined;
|
|
492
|
+
resourceInputs["buildOnPreview"] = (_a = (args ? args.buildOnPreview : undefined)) !== null && _a !== void 0 ? _a : true;
|
|
501
493
|
resourceInputs["builder"] = args ? args.builder : undefined;
|
|
502
494
|
resourceInputs["cacheFrom"] = args ? args.cacheFrom : undefined;
|
|
503
495
|
resourceInputs["cacheTo"] = args ? args.cacheTo : undefined;
|
|
@@ -507,7 +499,7 @@ class Image extends pulumi.CustomResource {
|
|
|
507
499
|
resourceInputs["exports"] = args ? args.exports : undefined;
|
|
508
500
|
resourceInputs["labels"] = args ? args.labels : undefined;
|
|
509
501
|
resourceInputs["load"] = args ? args.load : undefined;
|
|
510
|
-
resourceInputs["network"] = (
|
|
502
|
+
resourceInputs["network"] = (_b = (args ? args.network : undefined)) !== null && _b !== void 0 ? _b : "default";
|
|
511
503
|
resourceInputs["noCache"] = args ? args.noCache : undefined;
|
|
512
504
|
resourceInputs["platforms"] = args ? args.platforms : undefined;
|
|
513
505
|
resourceInputs["pull"] = args ? args.pull : undefined;
|
package/image.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"image.js","sourceRoot":"","sources":["../image.ts"],"names":[],"mappings":";AAAA,sEAAsE;AACtE,iFAAiF;;;AAEjF,yCAAyC;AAIzC,yCAAyC;AAEzC
|
|
1
|
+
{"version":3,"file":"image.js","sourceRoot":"","sources":["../image.ts"],"names":[],"mappings":";AAAA,sEAAsE;AACtE,iFAAiF;;;AAEjF,yCAAyC;AAIzC,yCAAyC;AAEzC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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cAAc,CAAC,MAAM,CAAC,GAAG,SAAS,CAAC,OAAO,CAAC;YAC3C,cAAc,CAAC,QAAQ,CAAC,GAAG,SAAS,CAAC,OAAO,CAAC;SAChD;QACD,IAAI,GAAG,MAAM,CAAC,YAAY,CAAC,SAAS,CAAC,oBAAoB,EAAE,EAAE,IAAI,CAAC,CAAC;QACnE,KAAK,CAAC,KAAK,CAAC,YAAY,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,CAAC,CAAC;IAC1D,CAAC;;AA1TL,sBA2TC;AA9SG,gBAAgB;AACO,kBAAY,GAAG,0BAA0B,CAAC"}
|
package/index_.d.ts
CHANGED
|
@@ -2,13 +2,25 @@ import * as pulumi from "@pulumi/pulumi";
|
|
|
2
2
|
import * as inputs from "./types/input";
|
|
3
3
|
import * as outputs from "./types/output";
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* A wrapper around `docker buildx imagetools create` to create an index
|
|
6
|
+
* (or manifest list) referencing one or more existing images.
|
|
6
7
|
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
8
|
+
* In most cases you do not need an `Index` to build a multi-platform
|
|
9
|
+
* image -- specifying multiple platforms on the `Image` will handle this
|
|
10
|
+
* for you automatically.
|
|
9
11
|
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
+
* However, as of April 2024, building multi-platform images _with
|
|
13
|
+
* caching_ will only export a cache for one platform at a time (see [this
|
|
14
|
+
* discussion](https://github.com/docker/buildx/discussions/1382) for more
|
|
15
|
+
* details).
|
|
16
|
+
*
|
|
17
|
+
* Therefore this resource can be helpful if you are building
|
|
18
|
+
* multi-platform images with caching: each platform can be built and
|
|
19
|
+
* cached separately, and an `Index` can join them all together. An
|
|
20
|
+
* example of this is shown below.
|
|
21
|
+
*
|
|
22
|
+
* This resource creates an OCI image index or a Docker manifest list
|
|
23
|
+
* depending on the media types of the source images.
|
|
12
24
|
*
|
|
13
25
|
* ## Example Usage
|
|
14
26
|
* ### Multi-platform registry caching
|
package/index_.js
CHANGED
|
@@ -6,13 +6,25 @@ exports.Index = void 0;
|
|
|
6
6
|
const pulumi = require("@pulumi/pulumi");
|
|
7
7
|
const utilities = require("./utilities");
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
9
|
+
* A wrapper around `docker buildx imagetools create` to create an index
|
|
10
|
+
* (or manifest list) referencing one or more existing images.
|
|
10
11
|
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
12
|
+
* In most cases you do not need an `Index` to build a multi-platform
|
|
13
|
+
* image -- specifying multiple platforms on the `Image` will handle this
|
|
14
|
+
* for you automatically.
|
|
13
15
|
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
+
* However, as of April 2024, building multi-platform images _with
|
|
17
|
+
* caching_ will only export a cache for one platform at a time (see [this
|
|
18
|
+
* discussion](https://github.com/docker/buildx/discussions/1382) for more
|
|
19
|
+
* details).
|
|
20
|
+
*
|
|
21
|
+
* Therefore this resource can be helpful if you are building
|
|
22
|
+
* multi-platform images with caching: each platform can be built and
|
|
23
|
+
* cached separately, and an `Index` can join them all together. An
|
|
24
|
+
* example of this is shown below.
|
|
25
|
+
*
|
|
26
|
+
* This resource creates an OCI image index or a Docker manifest list
|
|
27
|
+
* depending on the media types of the source images.
|
|
16
28
|
*
|
|
17
29
|
* ## Example Usage
|
|
18
30
|
* ### Multi-platform registry caching
|
package/index_.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index_.js","sourceRoot":"","sources":["../index_.ts"],"names":[],"mappings":";AAAA,sEAAsE;AACtE,iFAAiF;;;AAEjF,yCAAyC;AAIzC,yCAAyC;AAEzC
|
|
1
|
+
{"version":3,"file":"index_.js","sourceRoot":"","sources":["../index_.ts"],"names":[],"mappings":";AAAA,sEAAsE;AACtE,iFAAiF;;;AAEjF,yCAAyC;AAIzC,yCAAyC;AAEzC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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CAAC;YAC9D,cAAc,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC;YAC5D,cAAc,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,CAAC;YACpD,cAAc,CAAC,KAAK,CAAC,GAAG,SAAS,CAAC,OAAO,CAAC;SAC7C;aAAM;YACH,cAAc,CAAC,MAAM,CAAC,GAAG,SAAS,CAAC,OAAO,CAAC;YAC3C,cAAc,CAAC,KAAK,CAAC,GAAG,SAAS,CAAC,OAAO,CAAC;YAC1C,cAAc,CAAC,UAAU,CAAC,GAAG,SAAS,CAAC,OAAO,CAAC;YAC/C,cAAc,CAAC,SAAS,CAAC,GAAG,SAAS,CAAC,OAAO,CAAC;YAC9C,cAAc,CAAC,KAAK,CAAC,GAAG,SAAS,CAAC,OAAO,CAAC;SAC7C;QACD,IAAI,GAAG,MAAM,CAAC,YAAY,CAAC,SAAS,CAAC,oBAAoB,EAAE,EAAE,IAAI,CAAC,CAAC;QACnE,KAAK,CAAC,KAAK,CAAC,YAAY,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,CAAC,CAAC;IAC1D,CAAC;;AArFL,sBAsFC;AAzEG,gBAAgB;AACO,kBAAY,GAAG,0BAA0B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pulumi/docker-build",
|
|
3
|
-
"version": "v0.0.1
|
|
3
|
+
"version": "v0.0.1",
|
|
4
4
|
"keywords": [
|
|
5
5
|
"docker",
|
|
6
6
|
"buildkit",
|
|
7
|
-
"buildx"
|
|
7
|
+
"buildx",
|
|
8
|
+
"kind/native"
|
|
8
9
|
],
|
|
9
|
-
"homepage": "https://pulumi.
|
|
10
|
+
"homepage": "https://pulumi.com",
|
|
10
11
|
"repository": "https://github.com/pulumi/pulumi-docker-build",
|
|
11
12
|
"license": "Apache-2.0",
|
|
12
13
|
"scripts": {
|
|
13
14
|
"build": "tsc",
|
|
14
|
-
"install": "node scripts/install-pulumi-plugin.js resource docker-build v0.0.1
|
|
15
|
+
"install": "node scripts/install-pulumi-plugin.js resource docker-build v0.0.1"
|
|
15
16
|
},
|
|
16
17
|
"dependencies": {
|
|
17
18
|
"@pulumi/pulumi": "^3.0.0"
|
|
@@ -22,7 +23,6 @@
|
|
|
22
23
|
},
|
|
23
24
|
"pulumi": {
|
|
24
25
|
"resource": true,
|
|
25
|
-
"name": "docker-build"
|
|
26
|
-
"server": "github.com/pulumi/pulumi-docker-build"
|
|
26
|
+
"name": "docker-build"
|
|
27
27
|
}
|
|
28
28
|
}
|
package/package.json.dev
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pulumi/docker-build",
|
|
3
|
-
"version": "v0.0.1
|
|
3
|
+
"version": "v0.0.1",
|
|
4
4
|
"keywords": [
|
|
5
5
|
"docker",
|
|
6
6
|
"buildkit",
|
|
7
|
-
"buildx"
|
|
7
|
+
"buildx",
|
|
8
|
+
"kind/native"
|
|
8
9
|
],
|
|
9
|
-
"homepage": "https://pulumi.
|
|
10
|
+
"homepage": "https://pulumi.com",
|
|
10
11
|
"repository": "https://github.com/pulumi/pulumi-docker-build",
|
|
11
12
|
"license": "Apache-2.0",
|
|
12
13
|
"scripts": {
|
|
@@ -21,7 +22,6 @@
|
|
|
21
22
|
},
|
|
22
23
|
"pulumi": {
|
|
23
24
|
"resource": true,
|
|
24
|
-
"name": "docker-build"
|
|
25
|
-
"server": "github.com/pulumi/pulumi-docker-build"
|
|
25
|
+
"name": "docker-build"
|
|
26
26
|
}
|
|
27
27
|
}
|
package/utilities.js
CHANGED
|
@@ -61,7 +61,7 @@ function getVersion() {
|
|
|
61
61
|
exports.getVersion = getVersion;
|
|
62
62
|
/** @internal */
|
|
63
63
|
function resourceOptsDefaults() {
|
|
64
|
-
return { version: getVersion()
|
|
64
|
+
return { version: getVersion() };
|
|
65
65
|
}
|
|
66
66
|
exports.resourceOptsDefaults = resourceOptsDefaults;
|
|
67
67
|
/** @internal */
|
package/utilities.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utilities.js","sourceRoot":"","sources":["../utilities.ts"],"names":[],"mappings":";AAAA,sEAAsE;AACtE,iFAAiF;;;;;;;;;;;;AAGjF,kDAAkD;AAGlD,SAAgB,MAAM,CAAC,GAAG,IAAc;IACpC,KAAK,MAAM,CAAC,IAAI,IAAI,EAAE;QAClB,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QAC7B,IAAI,KAAK,EAAE;YACP,OAAO,KAAK,CAAC;SAChB;KACJ;IACD,OAAO,SAAS,CAAC;AACrB,CAAC;AARD,wBAQC;AAED,SAAgB,aAAa,CAAC,GAAG,IAAc;IAC3C,MAAM,CAAC,GAAG,MAAM,CAAC,GAAG,IAAI,CAAC,CAAC;IAC1B,IAAI,CAAC,KAAK,SAAS,EAAE;QACjB,uGAAuG;QACvG,yDAAyD;QACzD,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,SAAS,EAAE;YAC1E,OAAO,IAAI,CAAC;SACf;QACD,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,SAAS,EAAE;YAC7E,OAAO,KAAK,CAAC;SAChB;KACJ;IACD,OAAO,SAAS,CAAC;AACrB,CAAC;AAbD,sCAaC;AAED,SAAgB,YAAY,CAAC,GAAG,IAAc;IAC1C,MAAM,CAAC,GAAG,MAAM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