@codedependant/semantic-release-docker 4.5.0 → 4.5.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/CHANGELOG.md +7 -0
- package/lib/docker/image.js +14 -4
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Semantic Release Docker
|
|
2
2
|
|
|
3
|
+
## [4.5.1](https://github.com/esatterwhite/semantic-release-docker/compare/v4.5.0...v4.5.1) (2024-02-04)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* **image**: account for stderr when looking for an image sha [ba9eec2](https://github.com/esatterwhite/semantic-release-docker/commit/ba9eec2888fb4478a3a90f741de41a155b6c525e) - Eric Satterwhite, closes: [#46](https://github.com/esatterwhite/semantic-release-docker/issues/46)
|
|
9
|
+
|
|
3
10
|
# [4.5.0](https://github.com/esatterwhite/semantic-release-docker/compare/v4.4.0...v4.5.0) (2023-10-20)
|
|
4
11
|
|
|
5
12
|
|
package/lib/docker/image.js
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
+
const os = require('os')
|
|
3
4
|
const path = require('path')
|
|
4
5
|
const crypto = require('crypto')
|
|
5
6
|
const execa = require('execa')
|
|
6
7
|
const array = require('../lang/array/index.js')
|
|
8
|
+
const SHA_REGEX = /(?:writing image\s)?[^@](?:sha\d{3}):(?<sha>\w+)/i
|
|
7
9
|
|
|
8
10
|
class Image {
|
|
9
11
|
constructor(opts) {
|
|
@@ -160,10 +162,18 @@ class Image {
|
|
|
160
162
|
const stream = execa('docker', this.build_cmd)
|
|
161
163
|
stream.stdout.pipe(process.stdout)
|
|
162
164
|
stream.stderr.pipe(process.stderr)
|
|
163
|
-
const {stdout} = await stream
|
|
164
|
-
const
|
|
165
|
-
|
|
166
|
-
|
|
165
|
+
const {stdout, stderr} = await stream
|
|
166
|
+
const lines = (stdout || stderr).split(os.EOL)
|
|
167
|
+
const len = lines.length - 1
|
|
168
|
+
|
|
169
|
+
for (let x = len; x >= 0; x--) {
|
|
170
|
+
const line = lines[x]
|
|
171
|
+
const match = SHA_REGEX.exec(line)
|
|
172
|
+
if (match) {
|
|
173
|
+
this.sha = match.groups.sha.substring(0, 12)
|
|
174
|
+
return this.sha
|
|
175
|
+
}
|
|
176
|
+
}
|
|
167
177
|
}
|
|
168
178
|
|
|
169
179
|
async tag(tag, push = true) {
|