Skip to content

Commit c02ca32

Browse files
authored
Add in short version docker tag (#342)
Signed-off-by: Matthew B White <[email protected]>
1 parent ffa075e commit c02ca32

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

docker/fabric-nodeenv/docker.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ const version = JSON.parse(fs.readFileSync(path.join(__dirname,'package.json')))
1818
const build_dir = path.join(__dirname);
1919
const tag = version + '-' + git.short();
2020

21+
// reg exp the sort tag versions
22+
const regex = /^(\d+\.\d+)/
23+
const shortVersion = version.match(regex);
24+
25+
2126
// build and tag the fabric-nodeenv image
2227
const imageBuild = async () => {
2328
await runcmds(
@@ -26,6 +31,8 @@ const imageBuild = async () => {
2631
tag, path.join(build_dir, 'Dockerfile'), build_dir),
2732
util.format('docker tag hyperledger/fabric-nodeenv:%s hyperledger/fabric-nodeenv:%s',
2833
tag, version),
34+
util.format('docker tag hyperledger/fabric-nodeenv:%s hyperledger/fabric-nodeenv:%s',
35+
tag, shortVersion[shortVersion.index]),
2936
util.format('docker tag hyperledger/fabric-nodeenv:%s hyperledger/fabric-nodeenv:latest', tag)
3037
]
3138

0 commit comments

Comments
 (0)