Skip to content

Commit cfac81f

Browse files
committed
[FAB-16798] Lock step the versions to that of the shim
Change-Id: I836879a466ad1257e1b09087d3a6a38419ddfa8d Signed-off-by: Matthew B. White <whitemat@uk.ibm.com>
1 parent 2f7d43f commit cfac81f

2 files changed

Lines changed: 33 additions & 33 deletions

File tree

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"name": "fabric-shim-test",
33
"version": "2.0.0-snapshot",
4+
"tag": "unstable",
45
"description": "fabric-shim, fabric-shim-crypto",
56
"testFabricVersion": "master",
67
"testFabricThirdParty": "0.4.15",

scripts/Jenkins_Scripts/Publish_NPM_Modules.sh

Lines changed: 32 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,6 @@ npmPublish() {
1515
echo "----> Don't publish npm modules on skip tag"
1616
elif [[ "$CURRENT_TAG" = *"unstable"* ]]; then
1717
echo
18-
UNSTABLE_VER=$(npm dist-tags ls "$1" | awk "/$CURRENT_TAG"":"/'{
19-
ver=$NF
20-
sub(/.*\./,"",rel)
21-
sub(/\.[[:digit:]]+$/,"",ver)
22-
print ver}')
23-
24-
echo "======> UNSTABLE VERSION:" $UNSTABLE_VER
25-
# Increment unstable version here
26-
UNSTABLE_INCREMENT=$(npm dist-tags ls "$1" | awk "/$CURRENT_TAG"":"/'{
27-
ver=$NF
28-
rel=$NF
29-
sub(/.*\./,"",rel)
30-
sub(/\.[[:digit:]]+$/,"",ver)
31-
print ver"."rel+1}')
32-
3318
echo "======> Incremented UNSTABLE VERSION:" $UNSTABLE_INCREMENT
3419

3520
# Get last digit of the unstable version of $CURRENT_TAG
@@ -45,44 +30,58 @@ npmPublish() {
4530

4631
# Update the dependencies with that refer to any fabric-* module to be the matching number
4732
sed -i 's/\(.*\"fabric-.*\"\)\(2.0.0-snapshot\)/\1'$UNSTABLE_INCREMENT_VERSION'/' package.json
48-
npm publish --tag $CURRENT_TAG
33+
npm publish --tag $CURRENT_TAG
4934

5035
else
5136
# Publish node modules on latest tag
5237
echo -e "\033[32m ======> RELEASE_VERSION: $RELEASE_VERSION" "\033[0m"
5338
echo
5439
echo -e "\033[32m ======> CURRENT_TAG: $CURRENT_TAG" "\033[0m"
55-
npm publish --tag $CURRENT_TAG
40+
npm publish --tag $CURRENT_TAG
5641
fi
5742
}
58-
versions() {
59-
60-
CURRENT_TAG=$(cat package.json | grep tag | awk -F\" '{ print $4 }')
61-
echo -e "\033[32m ======> CURRENT_TAG: $CURRENT_TAG" "\033[0m"
62-
63-
RELEASE_VERSION=$(cat package.json | grep version | awk -F\" '{ print $4 }')
64-
echo -e "\033[32m ======> Current RELEASE_VERSION:" "\033[0m"
65-
}
6643

6744
ROOT=$WORKSPACE/gopath/src/github.com/hyperledger/fabric-chaincode-node
45+
6846
npm config set //registry.npmjs.org/:_authToken=$NPM_TOKEN
6947

48+
cd ${ROOT}
49+
50+
CURRENT_TAG=$(cat package.json | grep tag | awk -F\" '{ print $4 }')
51+
echo -e "\033[32m ======> CURRENT_TAG: $CURRENT_TAG" "\033[0m"
52+
53+
RELEASE_VERSION=$(cat package.json | grep version | awk -F\" '{ print $4 }')
54+
echo -e "\033[32m ======> Current RELEASE_VERSION:" "\033[0m"
55+
56+
# lock step versions to fabric-shim
57+
UNSTABLE_VER=$(npm dist-tags ls fabric-shim | awk "/$CURRENT_TAG"":"/'{
58+
ver=$NF
59+
sub(/.*\./,"",rel)
60+
sub(/\.[[:digit:]]+$/,"",ver)
61+
print ver}')
62+
63+
echo "======> UNSTABLE VERSION:" $UNSTABLE_VER
64+
# Increment unstable version here
65+
# lock step versions to fabric-shim
66+
UNSTABLE_INCREMENT=$(npm dist-tags ls fabric-shim | awk "/$CURRENT_TAG"":"/'{
67+
ver=$NF
68+
rel=$NF
69+
sub(/.*\./,"",rel)
70+
sub(/\.[[:digit:]]+$/,"",ver)
71+
print ver"."rel+1}')
72+
7073
cd ${ROOT}/apis/fabric-shim-api
71-
versions
7274
echo -e "\033[32m ======> fabric-shim-api" "\033[0m"
73-
npmPublish fabric-shim-api
75+
npmPublish
7476

7577
cd ${ROOT}/libraries/fabric-shim
76-
versions
7778
echo -e "\033[32m ======> fabric-shim" "\033[0m"
78-
npmPublish fabric-shim
79+
npmPublish
7980

8081
cd ${ROOT}/libraries/fabric-shim-crypto
81-
versions
8282
echo -e "\033[32m ======> fabric-shim-crypto" "\033[0m"
83-
npmPublish fabric-shim-crypto
83+
npmPublish
8484

8585
cd ${ROOT}/apis/fabric-contract-api
86-
versions
8786
echo -e "\033[32m ======> fabric-contract-api" "\033[0m"
88-
npmPublish fabric-contract-api
87+
npmPublish

0 commit comments

Comments
 (0)