release-it-docker-plugin 0.0.4 → 0.0.5
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.
Potentially problematic release.
This version of release-it-docker-plugin might be problematic. Click here for more details.
- package/LICENSE.md +21 -0
- package/README.md +27 -0
- package/package.json +1 -1
- package/src/index.js +8 -2
package/LICENSE.md
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2025 Filip Gulan
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
# Release It! 🚀 - Docker plugin
|
2
|
+
|
3
|
+
Plugin to ability build docker images and push to docker hub in release-it workflow.
|
4
|
+
|
5
|
+
# Options
|
6
|
+
| Name | Default value | Description |
|
7
|
+
|-----------|---------------|--------------------------------------------------|
|
8
|
+
| build | false | if plugin should build docker image |
|
9
|
+
| push | false | if plugin should push docker image to docker hub |
|
10
|
+
| latestTag | false | if also `latest` tag should be built and pushed |
|
11
|
+
| imageName | undefined | name of docker image to build and push |
|
12
|
+
|
13
|
+
## Example
|
14
|
+
|
15
|
+
```json
|
16
|
+
{
|
17
|
+
"$schema": "https://unpkg.com/release-it/schema/release-it.json",
|
18
|
+
"plugins": {
|
19
|
+
"release-it-docker-plugin": {
|
20
|
+
"build": true,
|
21
|
+
"push": true,
|
22
|
+
"latestTag": true,
|
23
|
+
"imageName": "<YOUR_IMAGE_NAME>"
|
24
|
+
}
|
25
|
+
}
|
26
|
+
}
|
27
|
+
```
|
package/package.json
CHANGED
package/src/index.js
CHANGED
@@ -5,6 +5,14 @@ const DOCKER_HUB_BASE_URL = 'https://hub.docker.com';
|
|
5
5
|
|
6
6
|
export default class DockerPlugin {
|
7
7
|
|
8
|
+
static isEnabled() {
|
9
|
+
return true;
|
10
|
+
}
|
11
|
+
|
12
|
+
static disablePlugin() {
|
13
|
+
return null;
|
14
|
+
}
|
15
|
+
|
8
16
|
constructor({ namespace, options = {}, container = {} } = {}) {
|
9
17
|
this.namespace = namespace;
|
10
18
|
this.options = Object.freeze(this.getInitialOptions(options, namespace));
|
@@ -23,12 +31,10 @@ export default class DockerPlugin {
|
|
23
31
|
}
|
24
32
|
|
25
33
|
async beforeRelease() {
|
26
|
-
if (this.options.build === false) return false;
|
27
34
|
return this.step({ task: () => this.build(), label: 'docker build', prompt: 'build'});
|
28
35
|
}
|
29
36
|
|
30
37
|
async release() {
|
31
|
-
if (this.options.push === false) return false;
|
32
38
|
return this.step({ task: () => this.push(), label: 'docker push', prompt: 'push'});
|
33
39
|
}
|
34
40
|
|