diff --git a/README.md b/README.md index 2abdb334..01633b8f 100644 --- a/README.md +++ b/README.md @@ -23,13 +23,13 @@ You may keep the script in the root directory of your project or install it glob To install it globally: ```bash -sudo curl -Lf https://github.com/hyperledger-labs/fablo/releases/download/1.1.0/fablo.sh -o /usr/local/bin/fablo && sudo chmod +x /usr/local/bin/fablo +sudo curl -Lf https://github.com/hyperledger-labs/fablo/releases/download/1.2.1-unstable.0/fablo.sh -o /usr/local/bin/fablo && sudo chmod +x /usr/local/bin/fablo ``` To get a copy of Fablo for a single project, execute in the project root: ```bash -curl -Lf https://github.com/hyperledger-labs/fablo/releases/download/1.1.0/fablo.sh -o ./fablo && chmod +x ./fablo +curl -Lf https://github.com/hyperledger-labs/fablo/releases/download/1.2.1-unstable.0/fablo.sh -o ./fablo && chmod +x ./fablo ``` ## Getting started @@ -325,7 +325,7 @@ The basic structure of Fablo config file is as follows: ```json { - "$schema": "https://github.com/hyperledger-labs/fablo/releases/download/1.1.0/schema.json", + "$schema": "https://github.com/hyperledger-labs/fablo/releases/download/1.2.1-unstable.0/schema.json", "global": { ... }, "orgs": [ ... ], "channels": [ ... ], @@ -488,7 +488,7 @@ Genrated Hooks are saved in `fablo-target/hooks`. ```yaml --- -"$schema": https://github.com/hyperledger-labs/fablo/releases/download/1.1.0/schema.json +"$schema": https://github.com/hyperledger-labs/fablo/releases/download/1.2.1-unstable.0/schema.json global: fabricVersion: 2.4.2 tls: false diff --git a/bump-version.sh b/bump-version.sh new file mode 100755 index 00000000..c2c83c49 --- /dev/null +++ b/bump-version.sh @@ -0,0 +1,40 @@ +#!/usr/bin/env bash + +set -eu + +old_version=$(< package.json jq -r '.version') +ver_arg="${1:-unstable}" + +if [ "$ver_arg" = "patch" ] || [ "$ver_arg" = "minor" ] || [ "$ver_arg" = "major" ]; then + new_version=$(semver "$old_version" -i "$ver_arg") +elif [ "$ver_arg" = "unstable" ]; then + new_version=$(semver "$old_version" -i prerelease --preid unstable) +else + echo "Invalid version parameter: $ver_arg" + echo "Usage: $0 [patch|minor|major|unstable]" + exit 1 +fi + +echo "Updating version from $old_version to $new_version" +echo -n " - package.json... " +npm version "$new_version" --no-git-tag-version > /dev/null +echo "done" + +echo -n " - FABLO_VERSION... " +perl -i -pe "s/FABLO_VERSION=\"[^\"]*\"/FABLO_VERSION=\"${new_version}\"/g" fablo.sh +perl -i -pe "s/FABLO_VERSION=\"[^\"]*\"/FABLO_VERSION=\"${new_version}\"/g" e2e/__snapshots__/* +echo "done" + +echo -n " - JSON schema URL... " +schema_update_pattern="s/download\/[0-9-.a-zA-Z]*\/schema.json/download\/${new_version}\/schema.json/g" +perl -i -pe "$schema_update_pattern" README.md +perl -i -pe "$schema_update_pattern" docs/schema.json +perl -i -pe "$schema_update_pattern" samples/*.json +perl -i -pe "$schema_update_pattern" samples/*.yaml +perl -i -pe "$schema_update_pattern" e2e/__snapshots__/* +echo "done" + +echo -n " - download URL... " +download_update_pattern="s/download\/[0-9-.a-zA-Z]*\/fablo.sh/download\/${new_version}\/fablo.sh/g" +perl -i -pe "$download_update_pattern" README.md +echo "done" \ No newline at end of file diff --git a/docs/schema.json b/docs/schema.json index 08d5a22c..a493429c 100644 --- a/docs/schema.json +++ b/docs/schema.json @@ -12,7 +12,7 @@ ], "properties": { "$schema": { - "const": "https://github.com/hyperledger-labs/fablo/releases/download/1.2.0/schema.json" + "const": "https://github.com/hyperledger-labs/fablo/releases/download/1.2.1-unstable.0/schema.json" }, "global": { "$id": "#/properties/global", diff --git a/e2e/__snapshots__/fabloCommands.test.ts.snap b/e2e/__snapshots__/fabloCommands.test.ts.snap index 4cc334c5..cdb19045 100644 --- a/e2e/__snapshots__/fabloCommands.test.ts.snap +++ b/e2e/__snapshots__/fabloCommands.test.ts.snap @@ -2907,7 +2907,7 @@ Validation warnings count: 0 exports[`init should init simple fablo config 1`] = ` "{ - \\"$schema\\": \\"https://github.com/hyperledger-labs/fablo/releases/download/1.2.0/schema.json\\", + \\"$schema\\": \\"https://github.com/hyperledger-labs/fablo/releases/download/1.2.1-unstable.0/schema.json\\", \\"global\\": { \\"fabricVersion\\": \\"2.4.7\\", \\"tls\\": false, @@ -2961,7 +2961,7 @@ exports[`init should init simple fablo config 1`] = ` exports[`init should init simple fablo config with node chaincode 1`] = ` "{ - \\"$schema\\": \\"https://github.com/hyperledger-labs/fablo/releases/download/1.2.0/schema.json\\", + \\"$schema\\": \\"https://github.com/hyperledger-labs/fablo/releases/download/1.2.1-unstable.0/schema.json\\", \\"global\\": { \\"fabricVersion\\": \\"2.4.7\\", \\"tls\\": false, @@ -3023,7 +3023,7 @@ exports[`init should init simple fablo config with node chaincode 1`] = ` exports[`init should init simple fablo config with node chaincode and rest api 1`] = ` "{ - \\"$schema\\": \\"https://github.com/hyperledger-labs/fablo/releases/download/1.2.0/schema.json\\", + \\"$schema\\": \\"https://github.com/hyperledger-labs/fablo/releases/download/1.2.1-unstable.0/schema.json\\", \\"global\\": { \\"fabricVersion\\": \\"2.4.7\\", \\"tls\\": false, diff --git a/e2e/__snapshots__/schema.test.ts.snap b/e2e/__snapshots__/schema.test.ts.snap index 03b48ff3..8b96b88d 100644 --- a/e2e/__snapshots__/schema.test.ts.snap +++ b/e2e/__snapshots__/schema.test.ts.snap @@ -7,7 +7,7 @@ Object { "default": Object {}, "properties": Object { "$schema": Object { - "const": "https://github.com/hyperledger-labs/fablo/releases/download/1.2.0/schema.json", + "const": "https://github.com/hyperledger-labs/fablo/releases/download/1.2.1-unstable.0/schema.json", }, "chaincodes": Object { "$id": "#/properties/chaincodes", diff --git a/fablo.sh b/fablo.sh index 6b361b89..35694e90 100755 --- a/fablo.sh +++ b/fablo.sh @@ -2,7 +2,7 @@ set -e -FABLO_VERSION="1.2.0" +FABLO_VERSION="1.2.1-unstable.0" FABLO_IMAGE_NAME="softwaremill/fablo" FABLO_IMAGE="$FABLO_IMAGE_NAME:$FABLO_VERSION" diff --git a/package-lock.json b/package-lock.json index e912599b..09320692 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "generator-fablo", - "version": "1.2.0", + "version": "1.2.1-unstable.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "generator-fablo", - "version": "1.2.0", + "version": "1.2.1-unstable.0", "license": "Apache-2.0", "dependencies": { "chalk": "^4.1.0", diff --git a/package.json b/package.json index fe972fab..d828b98c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "generator-fablo", - "version": "1.2.0", + "version": "1.2.1-unstable.0", "description": "Fablo is a simple tool to generate the Hyperledger Fabric blockchain network and run it on Docker. It supports RAFT and solo consensus protocols, multiple organizations and channels, chaincode installation and upgrade.", "author": "Piotr Hejwowski , Jakub Dzikowski ", "repository": { diff --git a/samples/fablo-config-hlf1.3-2orgs-1chaincode-private-data.json b/samples/fablo-config-hlf1.3-2orgs-1chaincode-private-data.json index 547eea26..6e106b6d 100644 --- a/samples/fablo-config-hlf1.3-2orgs-1chaincode-private-data.json +++ b/samples/fablo-config-hlf1.3-2orgs-1chaincode-private-data.json @@ -1,5 +1,5 @@ { - "$schema": "https://github.com/hyperledger-labs/fablo/releases/download/1.2.0/schema.json", + "$schema": "https://github.com/hyperledger-labs/fablo/releases/download/1.2.1-unstable.0/schema.json", "global": { "fabricVersion": "1.3.0", "tls": false diff --git a/samples/fablo-config-hlf1.4-1org-1chaincode-raft.json b/samples/fablo-config-hlf1.4-1org-1chaincode-raft.json index 3b357cd6..bd47697a 100644 --- a/samples/fablo-config-hlf1.4-1org-1chaincode-raft.json +++ b/samples/fablo-config-hlf1.4-1org-1chaincode-raft.json @@ -1,5 +1,5 @@ { - "$schema": "https://github.com/hyperledger-labs/fablo/releases/download/1.2.0/schema.json", + "$schema": "https://github.com/hyperledger-labs/fablo/releases/download/1.2.1-unstable.0/schema.json", "global": { "fabricVersion": "1.4.6", "tls": true, diff --git a/samples/fablo-config-hlf1.4-2orgs-1chaincode.json b/samples/fablo-config-hlf1.4-2orgs-1chaincode.json index 98cd99f2..cfc4d1d2 100644 --- a/samples/fablo-config-hlf1.4-2orgs-1chaincode.json +++ b/samples/fablo-config-hlf1.4-2orgs-1chaincode.json @@ -1,5 +1,5 @@ { - "$schema": "https://github.com/hyperledger-labs/fablo/releases/download/1.2.0/schema.json", + "$schema": "https://github.com/hyperledger-labs/fablo/releases/download/1.2.1-unstable.0/schema.json", "global": { "fabricVersion": "1.4.6", "tls": false diff --git a/samples/fablo-config-hlf1.4-2orgs-2chaincodes-private-data.yaml b/samples/fablo-config-hlf1.4-2orgs-2chaincodes-private-data.yaml index 7c3ecd9c..844191ba 100644 --- a/samples/fablo-config-hlf1.4-2orgs-2chaincodes-private-data.yaml +++ b/samples/fablo-config-hlf1.4-2orgs-2chaincodes-private-data.yaml @@ -1,5 +1,5 @@ --- -"$schema": https://github.com/hyperledger-labs/fablo/releases/download/1.2.0/schema.json +"$schema": https://github.com/hyperledger-labs/fablo/releases/download/1.2.1-unstable.0/schema.json global: fabricVersion: 1.4.11 tls: false diff --git a/samples/fablo-config-hlf1.4-2orgs-2chaincodes-raft.json b/samples/fablo-config-hlf1.4-2orgs-2chaincodes-raft.json index ed8ab19e..e20d735a 100644 --- a/samples/fablo-config-hlf1.4-2orgs-2chaincodes-raft.json +++ b/samples/fablo-config-hlf1.4-2orgs-2chaincodes-raft.json @@ -1,5 +1,5 @@ { - "$schema": "https://github.com/hyperledger-labs/fablo/releases/download/1.2.0/schema.json", + "$schema": "https://github.com/hyperledger-labs/fablo/releases/download/1.2.1-unstable.0/schema.json", "global": { "fabricVersion": "1.4.6", "tls": true diff --git a/samples/fablo-config-hlf2-1org-1chaincode-k8s.json b/samples/fablo-config-hlf2-1org-1chaincode-k8s.json index a93be7b3..04798481 100644 --- a/samples/fablo-config-hlf2-1org-1chaincode-k8s.json +++ b/samples/fablo-config-hlf2-1org-1chaincode-k8s.json @@ -1,5 +1,5 @@ { - "$schema": "https://github.com/hyperledger-labs/fablo/releases/download/1.2.0/schema.json", + "$schema": "https://github.com/hyperledger-labs/fablo/releases/download/1.2.1-unstable.0/schema.json", "global": { "fabricVersion": "2.4.7", "tls": false, diff --git a/samples/fablo-config-hlf2-1org-1chaincode-raft-explorer.json b/samples/fablo-config-hlf2-1org-1chaincode-raft-explorer.json index 7c3611c1..8c0886b4 100644 --- a/samples/fablo-config-hlf2-1org-1chaincode-raft-explorer.json +++ b/samples/fablo-config-hlf2-1org-1chaincode-raft-explorer.json @@ -1,5 +1,5 @@ { - "$schema": "https://github.com/hyperledger-labs/fablo/releases/download/1.2.0/schema.json", + "$schema": "https://github.com/hyperledger-labs/fablo/releases/download/1.2.1-unstable.0/schema.json", "global": { "fabricVersion": "2.3.3", "tls": true, diff --git a/samples/fablo-config-hlf2-1org-1chaincode.json b/samples/fablo-config-hlf2-1org-1chaincode.json index ae60e60f..2aecb739 100644 --- a/samples/fablo-config-hlf2-1org-1chaincode.json +++ b/samples/fablo-config-hlf2-1org-1chaincode.json @@ -1,5 +1,5 @@ { - "$schema": "https://github.com/hyperledger-labs/fablo/releases/download/1.2.0/schema.json", + "$schema": "https://github.com/hyperledger-labs/fablo/releases/download/1.2.1-unstable.0/schema.json", "global": { "fabricVersion": "2.4.7", "tls": false diff --git a/samples/fablo-config-hlf2-2orgs-2chaincodes-raft.yaml b/samples/fablo-config-hlf2-2orgs-2chaincodes-raft.yaml index 24797cef..c150b9d6 100644 --- a/samples/fablo-config-hlf2-2orgs-2chaincodes-raft.yaml +++ b/samples/fablo-config-hlf2-2orgs-2chaincodes-raft.yaml @@ -1,5 +1,5 @@ --- -"$schema": https://github.com/hyperledger-labs/fablo/releases/download/1.2.0/schema.json +"$schema": https://github.com/hyperledger-labs/fablo/releases/download/1.2.1-unstable.0/schema.json global: fabricVersion: 2.4.3 tls: true diff --git a/samples/fablo-config-hlf2-3orgs-1chaincode-raft-explorer.json b/samples/fablo-config-hlf2-3orgs-1chaincode-raft-explorer.json index df3a6069..42b60d1c 100644 --- a/samples/fablo-config-hlf2-3orgs-1chaincode-raft-explorer.json +++ b/samples/fablo-config-hlf2-3orgs-1chaincode-raft-explorer.json @@ -1,5 +1,5 @@ { - "$schema": "https://github.com/hyperledger-labs/fablo/releases/download/1.2.0/schema.json", + "$schema": "https://github.com/hyperledger-labs/fablo/releases/download/1.2.1-unstable.0/schema.json", "global": { "fabricVersion": "2.3.2", "tls": true,