release-it-docker-plugin 1.0.0 → 2.0.0

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 CHANGED
@@ -45,15 +45,15 @@ Use the plugin in `.release-it.json` as follows:
45
45
  ## Options
46
46
  The plugin can be configured with the following options:
47
47
 
48
- | Name | Default value | Description |
49
- |-----------|-------------------------|--------------------------------------------------------|
50
- | build | false | if plugin should build docker image |
51
- | push | false | if plugin should push docker image to docker hub |
52
- | latestTag | false | if also `latest` tag should be built and pushed |
53
- | imageName | undefined | name of docker image to build and push |
54
- | buildx | false | if plugin should use new buildx tool |
55
- | builder | undefined | builder name, only applicable together with buildx |
56
- | platform | linux/arm64,linux/amd64 | target platforms, only applicable together with buildx |
48
+ | Name | Default value | Description |
49
+ |-----------|---------------|-------------------------------------------------------------------------------------------------------------|
50
+ | imageName | undefined | name of docker image to build and push |
51
+ | latestTag | false | if also `latest` tag should be built and pushed |
52
+ | buildx | false | if plugin should use new buildx tool |
53
+ | build | false | if plugin should build docker image, only applicable without with buildx |
54
+ | push | false | if plugin should push docker image to docker hub, only applicable without with buildx |
55
+ | builder | undefined | builder name, only applicable together with buildx |
56
+ | output | docker | where image will be stored (available options `docker` or `registry`), only applicable together with buildx |
57
57
 
58
58
  # 📖 License
59
59
  MIT
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "release-it-docker-plugin",
3
- "version": "1.0.0",
3
+ "version": "2.0.0",
4
4
  "description": "Plugin to ability build docker images and push to docker hub in release-it workflow.",
5
5
  "keywords": [
6
6
  "release-it",
package/src/index.js CHANGED
@@ -80,14 +80,13 @@ export default class DockerPlugin {
80
80
  }
81
81
 
82
82
  buildx() {
83
- const { imageName, latestTag, builder, build, push, platform = 'linux/arm64,linux/amd64' } = this.options;
83
+ const { imageName, latestTag, builder, output, platform = 'linux/arm64,linux/amd64' } = this.options;
84
84
  const args = [
85
85
  '-t', `${imageName}:${this.config.contextOptions.version}`,
86
86
  ...(latestTag ? ['-t', `${imageName}:latest`] : []),
87
87
  '--platform', platform,
88
88
  ...(builder ? ['--builder', builder] : []),
89
- ...(build ? ['--load'] : []),
90
- ...(push ? ['--push'] : []),
89
+ ...(output === 'docker' ? ['--load'] : ['--push']),
91
90
  ];
92
91
  return this.exec(`docker buildx build ${args.filter(Boolean).join(' ')} .`).then(
93
92
  () => this.setContext({ isBuilt: true }),