Skip to content

Commit

Permalink
FABN-871 make build process more flexible
Browse files Browse the repository at this point in the history
The build in master currently looks at the fabric-client package.json
version to try to determine what version of fabric to test against.
This is changed so that it looks in the top level package for specific
properties rather than version to make control more flexible
Also the changelog script failed now the Jira issue ids have changed.
The change is not perfect so may still require some sort of manual
intervention but better than it was as it was broken.

Change-Id: I05e2311a34d106c8dffaa84f0daefa59297aa253
Signed-off-by: Dave Kelsey <[email protected]>
  • Loading branch information
Dave Kelsey committed Aug 8, 2018
1 parent 8e9c3d8 commit b7b44c2
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 8 deletions.
16 changes: 10 additions & 6 deletions build/tasks/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ console.log(util.format('# debug log: %s', debugPath));
console.log('####################################################\n');

const arch = process.arch;
const release = require(path.join(__dirname, '../../fabric-client/package.json')).version;
const thirparty_release = require(path.join(__dirname, '../../fabric-client/package.json')).thirdparty;
const release = require(path.join(__dirname, '../../package.json')).testFabricVersion;
const thirdparty_release = require(path.join(__dirname, '../../package.json')).testFabricThirdParty;
let dockerImageTag = '';
let thirdpartyImageTag = '';
let docker_arch = '';
Expand All @@ -50,11 +50,15 @@ if (arch.indexOf('x64') === 0) {
} else {
throw new Error('Unknown architecture: ' + arch);
}
// prepare thirdpartyImageTag (currently using couchdb image in tests)
thirdpartyImageTag = docker_arch + '-' + thirparty_release;

// release check
if (!/-snapshot/.test(release)) {
// release check, if master is specified then we are using a fabric that has been
// built from source, otherwise we are using specific published versions.

// prepare thirdpartyImageTag (currently using couchdb image in tests)
if (!/master/.test(thirdparty_release)) {
thirdpartyImageTag = docker_arch + '-' + thirdparty_release;
}
if (!/master/.test(release)) {
dockerImageTag = docker_arch + '-' + release;
}
// these environment variables would be read at test/fixtures/docker-compose.yaml
Expand Down
1 change: 0 additions & 1 deletion fabric-client/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"name": "fabric-client",
"version": "1.3.0-snapshot",
"thirdparty": "0.4.10",
"main": "index.js",
"scripts": {
"test": "nyc mocha --recursive -t 10000"
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"name": "fabric-sdk-node",
"version": "1.3.0-snapshot",
"testFabricVersion": "master",
"testFabricThirdParty": "0.4.10",
"main": "index.js",
"repository": {
"type": "gerrit",
Expand Down
2 changes: 1 addition & 1 deletion scripts/changelog.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#
echo "## $2\n$(date)" >> CHANGELOG.new
echo "" >> CHANGELOG.new
git log $1..HEAD --oneline | grep -v Merge | sed -e "s/\(FAB-[0-9]*\)/\[\1\](https:\/\/jira.hyperledger.org\/browse\/\1\)/" -e "s/\([0-9|a-z]*\)/* \[\1\](https:\/\/github.com\/hyperledger\/fabric-sdk-node\/commit\/\1)/" >> CHANGELOG.new
git log $1..HEAD --oneline | grep -v Merge | sed -e "s/\(FAB.*-[0-9]*\)/\[\1\](https:\/\/jira.hyperledger.org\/browse\/\1\)/" -e "s/\([0-9|a-z]*\)/* \[\1\](https:\/\/github.com\/hyperledger\/fabric-sdk-node\/commit\/\1)/" >> CHANGELOG.new
echo "" >> CHANGELOG.new
cat CHANGELOG.md >> CHANGELOG.new
mv -f CHANGELOG.new CHANGELOG.md

0 comments on commit b7b44c2

Please sign in to comment.