@codedependant/semantic-release-docker 3.0.1 → 4.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/CHANGELOG.md +48 -0
- package/README.md +38 -11
- package/lib/build-config.js +6 -4
- package/lib/docker/image.js +1 -1
- package/lib/handlebars/helpers/endswith.js +10 -0
- package/lib/handlebars/helpers/eq.js +7 -0
- package/lib/handlebars/helpers/gt.js +7 -0
- package/lib/handlebars/helpers/gte.js +7 -0
- package/lib/handlebars/helpers/includes.js +9 -0
- package/lib/handlebars/helpers/index.js +17 -0
- package/lib/handlebars/helpers/lower.js +8 -0
- package/lib/handlebars/helpers/lt.js +7 -0
- package/lib/handlebars/helpers/lte.js +7 -0
- package/lib/handlebars/helpers/neq.js +9 -0
- package/lib/handlebars/helpers/pick.js +13 -0
- package/lib/handlebars/helpers/split.js +5 -0
- package/lib/handlebars/helpers/startswith.js +10 -0
- package/lib/handlebars/helpers/upper.js +9 -0
- package/lib/handlebars/index.js +10 -0
- package/lib/lang/array/index.js +5 -0
- package/lib/lang/array/to-array.js +9 -0
- package/lib/lang/string/template.js +9 -7
- package/lib/prepare.js +1 -0
- package/lib/publish.js +1 -0
- package/lib/verify.js +3 -1
- package/package.json +18 -31
- package/test/common/git/add.js +0 -9
- package/test/common/git/commit.js +0 -11
- package/test/common/git/head.js +0 -10
- package/test/common/git/index.js +0 -13
- package/test/common/git/init-origin.js +0 -13
- package/test/common/git/init-remote.js +0 -16
- package/test/common/git/init.js +0 -20
- package/test/common/git/push.js +0 -9
- package/test/common/git/tag.js +0 -13
- package/test/common/git/tags.js +0 -14
- package/test/fixture/docker/Dockerfile.prepare +0 -4
- package/test/fixture/docker/Dockerfile.publish +0 -4
- package/test/fixture/docker/Dockerfile.test +0 -4
- package/test/fixture/package.json +0 -4
- package/test/fixture/pkg/one/package.json +0 -5
- package/test/fixture/pkg/two/package.json +0 -0
- package/test/integration/prepare.js +0 -74
- package/test/integration/publish.js +0 -60
- package/test/integration/release.js +0 -92
- package/test/integration/verify.js +0 -205
- package/test/unit/build-config.js +0 -166
- package/test/unit/build-template-vars.js +0 -63
- package/test/unit/docker/image.js +0 -289
- package/test/unit/lang/object.js +0 -45
- package/test/unit/lang/string.js +0 -37
- package/test/unit/parse-pkg-name.js +0 -27
- package/test/unit/read-pkg.js +0 -36
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,51 @@
|
|
|
1
|
+
# Semantic Release Docker
|
|
2
|
+
|
|
3
|
+
# [4.0.0](https://github.com/esatterwhite/semantic-release-docker/compare/v3.1.2...v4.0.0) (2021-12-31)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Chores
|
|
7
|
+
|
|
8
|
+
* **deps**: @codedependant/release-config-npm@1.0.4 [fdb0985](https://github.com/esatterwhite/semantic-release-docker/commit/fdb0985d346b1f74d61cf4d0ef238743e5f1d6f4) - Eric Satterwhite
|
|
9
|
+
* **deps**: eslint-config-codedependant@3.0.0 [6807acc](https://github.com/esatterwhite/semantic-release-docker/commit/6807accd81002e7bc86d79f260c19141f40363f6) - Eric Satterwhite
|
|
10
|
+
* **deps**: eslint@8.5.0 [f7e0bbe](https://github.com/esatterwhite/semantic-release-docker/commit/f7e0bbeb67156dedb0b3a8a2d0bad0d8828c7dde) - Eric Satterwhite
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
|
|
15
|
+
* **template**: replace simple template engine with handlebars [b20c89c](https://github.com/esatterwhite/semantic-release-docker/commit/b20c89ca979de7969028541b6a29ac9b867a06c3) - Eric Satterwhite, closes: [#16](https://github.com/esatterwhite/semantic-release-docker/issues/16)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Miscellaneous
|
|
19
|
+
|
|
20
|
+
* fix typo [3aa33ba](https://github.com/esatterwhite/semantic-release-docker/commit/3aa33ba2fc003a9f88e6b1d4263999152a577eda) - Eric Satterwhite
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
### **BREAKING CHANGES**
|
|
24
|
+
|
|
25
|
+
* **template:** Use handlebars as template engine. Place holders are
|
|
26
|
+
now double curlies `{{ }}`
|
|
27
|
+
|
|
28
|
+
## [3.1.2](https://github.com/esatterwhite/semantic-release-docker/compare/v3.1.1...v3.1.2) (2021-09-18)
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
### Bug Fixes
|
|
32
|
+
|
|
33
|
+
* **config**: ensure the docker context is passed image builds [366b8d1](https://github.com/esatterwhite/semantic-release-docker/commit/366b8d1d1f90855a76cfdb78009ec4510ead769e) - Eric Satterwhite, closes: [#13](https://github.com/esatterwhite/semantic-release-docker/issues/13)
|
|
34
|
+
|
|
35
|
+
## [3.1.1](https://github.com/esatterwhite/semantic-release-docker/compare/v3.1.0...v3.1.1) (2021-09-18)
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
### Documentation
|
|
39
|
+
|
|
40
|
+
* corrected the parameter - dockerFile [81e9319](https://github.com/esatterwhite/semantic-release-docker/commit/81e9319e7dae9905cf098a5b2c3a9837d4f5d1d9) - Eric Satterwhite
|
|
41
|
+
|
|
42
|
+
# [3.1.0](https://github.com/esatterwhite/semantic-release-docker/compare/v3.0.1...v3.1.0) (2021-04-12)
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
### Features
|
|
46
|
+
|
|
47
|
+
* **lib**: parse tags array from string [27d078b](https://github.com/esatterwhite/semantic-release-docker/commit/27d078b2bbd1f8881f2a4c390b50ac6d384e40f4) - Eric Satterwhite
|
|
48
|
+
|
|
1
49
|
## Changelog
|
|
2
50
|
|
|
3
51
|
## [3.0.1](https://github.com/esatterwhite/semantic-release-docker/compare/v3.0.0...v3.0.1) (2021-04-09)
|
package/README.md
CHANGED
|
@@ -20,7 +20,7 @@ builds a an image using the specified docker file and context. This image will b
|
|
|
20
20
|
### publish
|
|
21
21
|
|
|
22
22
|
pushes the tags Images with specified tags and pushes them to the registry.
|
|
23
|
-
Tags support simple templating. Values enclosed in braces `{}` will be
|
|
23
|
+
Tags support simple templating via [handlebars][]. Values enclosed in braces `{{}}` will be substituted with release context information
|
|
24
24
|
|
|
25
25
|
## Installation
|
|
26
26
|
|
|
@@ -31,7 +31,7 @@ Run `npm i --save-dev @codedependant/semantic-release-docker` to install this se
|
|
|
31
31
|
### Docker registry authentication
|
|
32
32
|
|
|
33
33
|
The `docker registry` authentication set via environment variables. It is not required, and if
|
|
34
|
-
omitted, it is assumed the docker daemon is already authenticated with the
|
|
34
|
+
omitted, it is assumed the docker daemon is already authenticated with the target registry.
|
|
35
35
|
|
|
36
36
|
### Environment variables
|
|
37
37
|
|
|
@@ -44,11 +44,11 @@ omitted, it is assumed the docker daemon is already authenticated with the targe
|
|
|
44
44
|
|
|
45
45
|
| Option | Description | Default
|
|
46
46
|
| --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | --------
|
|
47
|
-
| `dockerTags` | _Optional_. An array of strings allowing to specify additional tags to apply to the image. Supports templating | [`latest`, `{major}-latest`, `{version}`]
|
|
47
|
+
| `dockerTags` | _Optional_. An array of strings allowing to specify additional tags to apply to the image. Supports templating | [`latest`, `{{major}}-latest`, `{{version}}`] |
|
|
48
48
|
| `dockerImage` | _Optional_. The name of the image to release. | Parsed from package.json `name` property |
|
|
49
49
|
| `dockerRegistry` | _Optional_. The hostname and port used by the the registry in format `hostname[:port]`. Omit the port if the registry uses the default port | `null` (dockerhub) |
|
|
50
50
|
| `dockerProject` | _Optional_. The project or repository name to publish the image to | For scoped packages, the scope will be used, otherwise `null` |
|
|
51
|
-
| `
|
|
51
|
+
| `dockerFile` | _Optional_. The path, relative to `$PWD` to a Docker file to build the target image with | `Dockerfile` |
|
|
52
52
|
| `dockerContext` | _Optional_. A path, relative to `$PWD` to use as the build context A | `.` |
|
|
53
53
|
| `dockerLogin` | _Optional_. Set to false it by pass docker login if the docker daemon is already authorized | `true` |
|
|
54
54
|
| `dockerArgs` | _Optional_. Include additional values for docker's `build-arg`. Supports templating | |
|
|
@@ -58,14 +58,14 @@ omitted, it is assumed the docker daemon is already authenticated with the targe
|
|
|
58
58
|
|
|
59
59
|
By default several build arguments will be included when the docker images is being built.
|
|
60
60
|
Build arguments can be templated in the same fashion as docker tags. If the value for a
|
|
61
|
-
build argument is
|
|
62
|
-
a matching environment variable will be utilized instead. This can be
|
|
61
|
+
build argument is explicitly `true`, the value will be omitted and the value from
|
|
62
|
+
a matching environment variable will be utilized instead. This can be useful when trying to include
|
|
63
63
|
secrets and other sensitive information
|
|
64
64
|
|
|
65
65
|
| Argument Name | Description | Default |
|
|
66
66
|
|---------------------|--------------------------------------------------------------------------------------------|------------------------------|
|
|
67
67
|
| `SRC_DIRECTORY` | The of the directory the build was triggered from | The directory name of CWD |
|
|
68
|
-
| `TARGET_PATH` | Path relative to the execution root.
|
|
68
|
+
| `TARGET_PATH` | Path relative to the execution root. Useful for Sharing a Single Docker file in monorepos | |
|
|
69
69
|
| `NPM_PACKAGE_NAME` | The `name` property extracted from `package.json` - if present | |
|
|
70
70
|
| `NPM_PACKAGE_SCOPE` | The parsed scope from the `name` property from `package.json` - sans `@` | |
|
|
71
71
|
| `CONFIG_NAME` | The configured name of the docker image. | The parsed package name |
|
|
@@ -93,6 +93,28 @@ String template will be passed these
|
|
|
93
93
|
| `build` | A Random build hash representing the current execution context | `String` |
|
|
94
94
|
| `now` | Current timestamp is ISO 8601 format | `String` |
|
|
95
95
|
|
|
96
|
+
### Template Helpers
|
|
97
|
+
|
|
98
|
+
The following handlebars template helpers are pre installed
|
|
99
|
+
|
|
100
|
+
| Helper name | Description | Return Type | Example |
|
|
101
|
+
|:------------:|------------------------------------------------------------------------|:-----------:|--------------------------------------------------------------------------------------------|
|
|
102
|
+
| `endswith` | returns true if a string ends with another | [Boolean][] | <pre lang="hbs">{{#if (endswith myvar 'ing')}}{{ othervar }}{{/if}}</pre> |
|
|
103
|
+
| `eq` | returns true if two values are strictly equal to each other | [Boolean][] | <pre lang="hbs">{{#if (eq var_one var_two)}}{{ var_three }}{{/if}}</pre> |
|
|
104
|
+
| `gt` | returns true if the first value is greater than the second | | [Boolean][] | <pre lang="hbs">{{#if (gt var_one var_two)}}{{ var_three }}{{/if}}</pre> |
|
|
105
|
+
| `gte` | returns true if the first value is greater than or equal to the second | [Boolean][] | <pre lang="hbs">{{#if (gte var_one var_two)}}{{ var_three }}{{/if}}</pre> |
|
|
106
|
+
| `includes` | returns true if the input (string \| array) includes the second value | [Boolean][] | <pre lang="hbs">{{#if (includes some_array 'one')}}{{ var_one }}{{/if}}</pre> |
|
|
107
|
+
| `lower` | returns the lower cased varient of the input string | [String][] | <pre lang="hbs">{{ lower my_var }}</pre> |
|
|
108
|
+
| `lt` | returns true if the first value is less than the second | [Boolean][] | <pre lang="hbs">{{#if (lt var_one var_two)}}{{ var_three }}{{/if}}</pre> |
|
|
109
|
+
| `lte` | returns true if the first value is less than or equal to the second | [Boolean][] | <pre lang="hbs">{{#if (lte var_one var_two)}}{{ var_three }}{{/if}}</pre> |
|
|
110
|
+
| `neq` | returns true if two values are not equal to each other | [Boolean][] | <pre lang="hbs">{{#if (neq var_one var_two)}}{{ var_three }}{{/if}}</pre> |
|
|
111
|
+
| `pick` | returns the first non null-ish value. Will treat `false` as a value | `any` | <pre lang="hbs">{{#with (pick var_one, var_two) as \| value \|}}{{ value }}{{/with}}</pre> |
|
|
112
|
+
| `split` | splits csv values into a javascript array | [Array][] | <pre lang="hbs">{{#each (split csv_value)}}{{ this }}{{/each}} |
|
|
113
|
+
| `startswith` | returns true if a string starts with another | [Boolean][] | <pre lang="hbs">{{#if (starts myvar 'foo')}}{{ othervar }}{{/if}}</pre> |
|
|
114
|
+
| `upper` | returns the upper cased varient of the input string | [String][] | <pre lang="hbs">{{upper my_var}}</pre> |
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
|
|
96
118
|
## Usage
|
|
97
119
|
|
|
98
120
|
**full configuration**:
|
|
@@ -104,7 +126,7 @@ module.exports = {
|
|
|
104
126
|
branches: ['main']
|
|
105
127
|
plugins: [
|
|
106
128
|
['@codedependant/semantic-release-docker', {
|
|
107
|
-
dockerTags: ['latest', '{version}', '{major}-latest', '{major}.{minor}'],
|
|
129
|
+
dockerTags: ['latest', '{{version}}', '{{major}}-latest', '{{major}}.{{minor}}'],
|
|
108
130
|
dockerImage: 'my-image',
|
|
109
131
|
dockerFile: 'Dockerfile',
|
|
110
132
|
dockerRegistry: 'quay.io',
|
|
@@ -112,7 +134,7 @@ module.exports = {
|
|
|
112
134
|
dockerArgs: {
|
|
113
135
|
API_TOKEN: true
|
|
114
136
|
, RELEASE_DATE: new Date().toISOString()
|
|
115
|
-
, RELEASE_VERSION: '{next.version}'
|
|
137
|
+
, RELEASE_VERSION: '{{next.version}}'
|
|
116
138
|
}
|
|
117
139
|
}]
|
|
118
140
|
]
|
|
@@ -129,13 +151,13 @@ Alternatively, using global options w/ root configuration
|
|
|
129
151
|
"version": "1.0.0"
|
|
130
152
|
"release": {
|
|
131
153
|
"extends": "@internal/release-config-docker",
|
|
132
|
-
"dockerTags": ["latest", "{version}", "{major}-latest", "{major}.{minor}"],
|
|
154
|
+
"dockerTags": ["latest", "{{version}}", "{{major}}-latest", "{{major}}.{{minor}}"],
|
|
133
155
|
"dockerImage": "my-image",
|
|
134
156
|
"dockerFile": "Dockerfile",
|
|
135
157
|
"dockerRegistry": "quay.io",
|
|
136
158
|
"dockerArgs": {
|
|
137
159
|
"GITHUB_TOKEN": true
|
|
138
|
-
, "SOME_VALUE": '{git_sha}'
|
|
160
|
+
, "SOME_VALUE": '{{git_sha}}'
|
|
139
161
|
}
|
|
140
162
|
}
|
|
141
163
|
}
|
|
@@ -182,3 +204,8 @@ $ openssl req -new -newkey rsa:2048 -days 365 -nodes -x509 -keyout server.key -o
|
|
|
182
204
|
|
|
183
205
|
**NOTE**: When prompted for an FQDN it must be `registry:5000`
|
|
184
206
|
**NOTE**: The credentials for the local registry are **user:** `iamweasel`, **pass:** `secretsquirrel`
|
|
207
|
+
|
|
208
|
+
[handlebars]: https://handlebarsjs.com
|
|
209
|
+
[Boolean]: https://mdn.io/boolean
|
|
210
|
+
[String]: https://mdn.io/string
|
|
211
|
+
[Array]: https://mdn.io/array
|
package/lib/build-config.js
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
const path = require('path')
|
|
4
4
|
const readPkg = require('./read-pkg.js')
|
|
5
5
|
const object = require('./lang/object/index.js')
|
|
6
|
+
const array = require('./lang/array/index.js')
|
|
6
7
|
const parsePkgName = require('./parse-pkg-name.js')
|
|
7
8
|
const PWD = '.'
|
|
8
9
|
|
|
@@ -12,12 +13,13 @@ async function buildConfig(build_id, config, context) {
|
|
|
12
13
|
const {
|
|
13
14
|
dockerFile: dockerfile = 'Dockerfile'
|
|
14
15
|
, dockerNoCache: nocache = false
|
|
15
|
-
, dockerTags: tags = ['latest', '{major}-latest', '{version}']
|
|
16
|
+
, dockerTags: tags = ['latest', '{{major}}-latest', '{{version}}']
|
|
16
17
|
, dockerArgs: args = {}
|
|
17
18
|
, dockerRegistry: registry = null
|
|
18
19
|
, dockerLogin: login = true
|
|
19
20
|
, dockerImage: image
|
|
20
21
|
, dockerPublish: publish = true
|
|
22
|
+
, dockerContext = '.'
|
|
21
23
|
} = config
|
|
22
24
|
|
|
23
25
|
let name = null
|
|
@@ -35,13 +37,13 @@ async function buildConfig(build_id, config, context) {
|
|
|
35
37
|
const target = path.relative(root || context.cwd, context.cwd) || PWD
|
|
36
38
|
const {nextRelease = {}} = context
|
|
37
39
|
return {
|
|
38
|
-
|
|
39
|
-
, registry
|
|
40
|
+
registry
|
|
40
41
|
, dockerfile
|
|
41
42
|
, nocache
|
|
42
43
|
, pkg
|
|
43
44
|
, project
|
|
44
45
|
, publish
|
|
46
|
+
, tags: array.toArray(tags)
|
|
45
47
|
, args: {
|
|
46
48
|
SRC_DIRECTORY: path.basename(context.cwd)
|
|
47
49
|
, TARGET_PATH: target
|
|
@@ -57,6 +59,6 @@ async function buildConfig(build_id, config, context) {
|
|
|
57
59
|
, build: build_id
|
|
58
60
|
, login: login
|
|
59
61
|
, env: context.env
|
|
60
|
-
, context:
|
|
62
|
+
, context: dockerContext
|
|
61
63
|
}
|
|
62
64
|
}
|
package/lib/docker/image.js
CHANGED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
module.exports = {
|
|
4
|
+
endswith: require('./endswith')
|
|
5
|
+
, eq: require('./eq')
|
|
6
|
+
, gt: require('./gt')
|
|
7
|
+
, gte: require('./gte')
|
|
8
|
+
, includes: require('./includes')
|
|
9
|
+
, lower: require('./lower')
|
|
10
|
+
, lt: require('./lt')
|
|
11
|
+
, lte: require('./lte')
|
|
12
|
+
, neq: require('./neq')
|
|
13
|
+
, pick: require('./pick')
|
|
14
|
+
, startswith: require('./startswith')
|
|
15
|
+
, split: require('./split')
|
|
16
|
+
, upper: require('./upper')
|
|
17
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
module.exports = pick
|
|
4
|
+
|
|
5
|
+
function pick(...args) {
|
|
6
|
+
return args.find((value) => {
|
|
7
|
+
/* eslint-disable no-eq-null */
|
|
8
|
+
if (value == null) return false
|
|
9
|
+
/* eslint-enable no-eq-null */
|
|
10
|
+
if (value === '') return false
|
|
11
|
+
return true
|
|
12
|
+
})
|
|
13
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
const CSV_SEP_EXP = /\s*,\s*/
|
|
4
|
+
module.exports = function toArray(item, sep = CSV_SEP_EXP) {
|
|
5
|
+
if (!item) return []
|
|
6
|
+
if (item instanceof Set) return Array.from(item)
|
|
7
|
+
if (Array.isArray(item)) return item
|
|
8
|
+
return typeof item === 'string' ? item.split(sep) : [item]
|
|
9
|
+
}
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
'use strict'
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
const handlebars = require('../../handlebars')
|
|
3
4
|
|
|
4
5
|
module.exports = template
|
|
5
6
|
|
|
6
7
|
function template(str) {
|
|
7
|
-
return
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
if (typeof str !== 'string') return echo(str)
|
|
9
|
+
return handlebars.compile(str)
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
function echo(input) {
|
|
13
|
+
return () => {
|
|
14
|
+
return input
|
|
13
15
|
}
|
|
14
16
|
}
|
package/lib/prepare.js
CHANGED
package/lib/publish.js
CHANGED
package/lib/verify.js
CHANGED
|
@@ -17,7 +17,8 @@ async function verify(opts, context) {
|
|
|
17
17
|
const error = new SemanticError(
|
|
18
18
|
'Docker image name not found'
|
|
19
19
|
, 'EINVAL'
|
|
20
|
-
, 'Image name parsed from package.json name if possible.
|
|
20
|
+
, 'Image name parsed from package.json name if possible. '
|
|
21
|
+
+ 'Or via the "dockerImage" option.'
|
|
21
22
|
)
|
|
22
23
|
throw error
|
|
23
24
|
}
|
|
@@ -29,6 +30,7 @@ async function verify(opts, context) {
|
|
|
29
30
|
, dockerfile: opts.dockerfile
|
|
30
31
|
, build_id: opts.build
|
|
31
32
|
, cwd: cwd
|
|
33
|
+
, context: opts.context
|
|
32
34
|
})
|
|
33
35
|
|
|
34
36
|
debug('docker options', opts)
|
package/package.json
CHANGED
|
@@ -1,16 +1,25 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codedependant/semantic-release-docker",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "4.0.0",
|
|
5
5
|
"description": "docker package",
|
|
6
6
|
"main": "index.js",
|
|
7
|
+
"files": [
|
|
8
|
+
"lib/",
|
|
9
|
+
"README.md",
|
|
10
|
+
"CHANGELOG.md",
|
|
11
|
+
"LICENSE",
|
|
12
|
+
"package.json",
|
|
13
|
+
"index.js"
|
|
14
|
+
],
|
|
7
15
|
"scripts": {
|
|
8
|
-
"test": "docker-compose -f compose/base.yml -f compose/test.yml up --exit-code-from semantic-release --force-recreate --remove-orphans",
|
|
16
|
+
"test": "docker-compose -f compose/base.yml -f compose/test.yml up --exit-code-from semantic-release --force-recreate --remove-orphans --build",
|
|
9
17
|
"start": "docker-compose -f compose/base.yml -f compose/dev.yml up --force-recreate --remove-orphans --build",
|
|
10
18
|
"stop": "docker-compose -f compose/base.yml -f compose/dev.yml down",
|
|
11
19
|
"tap": "tap",
|
|
12
20
|
"lint": "eslint .",
|
|
13
21
|
"lint:fix": "npm run lint -- --fix",
|
|
22
|
+
"local": "env $(cat env/local.env)",
|
|
14
23
|
"pretap": "npm run lint",
|
|
15
24
|
"release": "semantic-release"
|
|
16
25
|
},
|
|
@@ -26,31 +35,6 @@
|
|
|
26
35
|
"type": "git",
|
|
27
36
|
"url": "git+ssh://git@github.com/esatterwhite/semantic-release-docker.git"
|
|
28
37
|
},
|
|
29
|
-
"eslintConfig": {
|
|
30
|
-
"root": true,
|
|
31
|
-
"extends": "codedependant",
|
|
32
|
-
"ignorePatterns": [
|
|
33
|
-
"node_modules/",
|
|
34
|
-
"test/fixture/",
|
|
35
|
-
"coverage/",
|
|
36
|
-
".nyc_output/",
|
|
37
|
-
"env/",
|
|
38
|
-
"doc/"
|
|
39
|
-
],
|
|
40
|
-
"rules": {
|
|
41
|
-
"object-shorthand": 0,
|
|
42
|
-
"no-unused-vars": [
|
|
43
|
-
"error",
|
|
44
|
-
{
|
|
45
|
-
"varsIgnorePattern": "_"
|
|
46
|
-
}
|
|
47
|
-
],
|
|
48
|
-
"quote-props": [
|
|
49
|
-
2,
|
|
50
|
-
"as-needed"
|
|
51
|
-
]
|
|
52
|
-
}
|
|
53
|
-
},
|
|
54
38
|
"tap": {
|
|
55
39
|
"esm": false,
|
|
56
40
|
"ts": false,
|
|
@@ -75,16 +59,19 @@
|
|
|
75
59
|
"nyc-arg": [
|
|
76
60
|
"--exclude=coverage/",
|
|
77
61
|
"--exclude=test/",
|
|
62
|
+
"--exclude=.eslintrc.js",
|
|
63
|
+
"--exclude=release.config.js",
|
|
78
64
|
"--all"
|
|
79
65
|
]
|
|
80
66
|
},
|
|
81
67
|
"devDependencies": {
|
|
82
|
-
"@codedependant/release-config-npm": "^1.0.
|
|
68
|
+
"@codedependant/release-config-npm": "^1.0.4",
|
|
83
69
|
"@semantic-release/changelog": "^5.0.1",
|
|
84
70
|
"@semantic-release/git": "^9.0.0",
|
|
85
71
|
"@semantic-release/github": "^7.0.7",
|
|
86
|
-
"eslint": "^
|
|
87
|
-
"eslint-config-codedependant": "^
|
|
72
|
+
"eslint": "^8.5.0",
|
|
73
|
+
"eslint-config-codedependant": "^3.0.0",
|
|
74
|
+
"semantic-release": "17",
|
|
88
75
|
"sinon": "^9.0.2",
|
|
89
76
|
"tap": "^14.10.7"
|
|
90
77
|
},
|
|
@@ -92,7 +79,7 @@
|
|
|
92
79
|
"@semantic-release/error": "^2.2.0",
|
|
93
80
|
"debug": "^4.1.1",
|
|
94
81
|
"execa": "^4.0.2",
|
|
95
|
-
"
|
|
82
|
+
"handlebars": "^4.7.7",
|
|
96
83
|
"semver": "^7.3.2"
|
|
97
84
|
}
|
|
98
85
|
}
|
package/test/common/git/add.js
DELETED
package/test/common/git/head.js
DELETED
package/test/common/git/index.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
module.exports = {
|
|
4
|
-
add: require('./add.js')
|
|
5
|
-
, commit: require('./commit.js')
|
|
6
|
-
, head: require('./head.js')
|
|
7
|
-
, initOrigin: require('./init-origin.js')
|
|
8
|
-
, initRemote: require('./init-remote.js')
|
|
9
|
-
, init: require('./init.js')
|
|
10
|
-
, push: require('./push.js')
|
|
11
|
-
, tag: require('./tag.js')
|
|
12
|
-
, tags: require('./tags.js')
|
|
13
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
const execa = require('execa')
|
|
4
|
-
const initRemote = require('./init-remote.js')
|
|
5
|
-
|
|
6
|
-
module.exports = initOrigin
|
|
7
|
-
|
|
8
|
-
async function initOrigin(cwd) {
|
|
9
|
-
const origin = await initRemote()
|
|
10
|
-
await execa('git', ['remote', 'add', 'origin', origin], {cwd: cwd})
|
|
11
|
-
await execa('git', ['push', '--all', 'origin'], {cwd: cwd})
|
|
12
|
-
return origin
|
|
13
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
const path = require('path')
|
|
4
|
-
const os = require('os')
|
|
5
|
-
const {promises: fs} = require('fs')
|
|
6
|
-
const execa = require('execa')
|
|
7
|
-
|
|
8
|
-
module.exports = initRemote
|
|
9
|
-
|
|
10
|
-
async function initRemote(branch = 'main') {
|
|
11
|
-
const cwd = await fs.mkdtemp(path.join(os.tmpdir(), path.sep))
|
|
12
|
-
await execa('git', [
|
|
13
|
-
'init', '--bare', `--initial-branch=${branch}`
|
|
14
|
-
], {cwd: cwd})
|
|
15
|
-
return `file://${cwd}`
|
|
16
|
-
}
|