Skip to content

Commit

Permalink
Merge pull request #562 from aklenik/npm-publish
Browse files Browse the repository at this point in the history
Add npm and docker publish artifacts
  • Loading branch information
aklenik authored Sep 5, 2019
2 parents 98c61b3 + 2651046 commit 7c34028
Show file tree
Hide file tree
Showing 63 changed files with 1,131 additions and 545 deletions.
37 changes: 18 additions & 19 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,36 +1,35 @@
architecture.pptx
.idea/*
*.bak
zookeeper.out
node_modules/
package-lock.json
output.log

#Ignore default Caliper log location
log/

# Ignore any generted html files, but include the report html template
# Ignore any generated html files, but include the report html template
*.html
!/packages/caliper-core/lib/report/template/report.html

# Ignore DS_Store files from Mac
**.DS_Store

# Ignore any composer logs
composer-logs/
architecture.pptx
output.log
lerna-debug.log

# Ignore code coverage logs
.nyc_output/
coverage/
# Ignore zookeeper files
zookeeper.out

# We prefer to not use lock files
package-lock.json
**/package-lock.json

# Ignore zookeeper files
zookeeper.out
.idea/
**/node_modules/
**/log/

# Ignore any composer logs
composer-logs/

# Ignore code coverage logs
**/.nyc_output/
**/coverage/

# Ignore IDE files
.vscode/*
.vscode/

# Website files
.sass-cache/
Expand Down
9 changes: 6 additions & 3 deletions .travis/avoid_verdaccio.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,15 @@
set -e
set -o pipefail

# Bootstrap the project
npm run bootstrap
# Bootstrap the project again
npm i && npm run repoclean -- --yes && npm run bootstrap

# Run linting, license check and unit tests
npm test

# Call CLI directly
export CALL_METHOD="node ../caliper-cli/caliper.js"

echo "---- Running Integration test for adaptor ${BENCHMARK}"
cd ./packages/caliper-tests-integration/
npm run run_tests_direct
npm run run_tests
33 changes: 27 additions & 6 deletions .travis/script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,42 @@
set -e
set -o pipefail

# Bootstrap the project
npm run bootstrap
# Bootstrap the project again
npm i && npm run repoclean -- --yes && npm run bootstrap

# Run linting, license check and unit tests
npm test

# Call CLI through the local binary
export CALL_METHOD="npx caliper"

echo "---- Publishing packages locally"
cd ./packages/caliper-tests-integration/
npm run cleanup

npm run start_verdaccio
npm run publish_packages
npm run npm_publish_local

echo "---- Installing CLI"
npm run install_cli
npm run cleanup
npm i --registry http://localhost:4873 --only=prod @hyperledger/caliper-cli

# These are common for each scenario
export CALIPER_BIND_SDK=latest
export CALIPER_BIND_ARGS="--no-save"

echo "---- Binding CLI"
if [[ "${BENCHMARK}" == "composer" ]]; then
npx caliper bind --caliper-bind-sut composer
elif [[ "${BENCHMARK}" == "fabric" ]]; then
npx caliper bind --caliper-bind-sut fabric
else
echo "Unknown target benchmark ${BENCHMARK}"
npm run cleanup
exit 1
fi

echo "---- Running Integration test for adaptor ${BENCHMARK}"
npm run run_tests

# shouldn't leave the CLI among the deps
npm uninstall --save @hyperledger/caliper-cli
npm run cleanup
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,15 @@
"exact_paths": [
"CODEOWNERS",
"LICENSE",
".idea",
"node_modules",
".nyc_output",
"coverage",
"scripts",
".git",
".gitignore",
"packages"
"packages",
"log"
],
"file_type_method": "EXCLUDE",
"file_types": [
Expand Down
42 changes: 42 additions & 0 deletions packages/caliper-burrow/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
*.bak

# Ignore any generated html files
*.html

# Ignore DS_Store files from Mac
**.DS_Store

architecture.pptx
output.log
lerna-debug.log

# Ignore zookeeper files
zookeeper.out

# We prefer to not use lock files
**/package-lock.json

.idea/
**/node_modules/
**/log/

# Ignore any composer logs
composer-logs/

# Ignore code coverage logs
**/.nyc_output/
**/coverage/

# Ignore IDE files
.vscode/

# Website files
.sass-cache/
Gemfile.lock
_site/

# verdaccio files
**/storage

# pm2 files
**/.pm2/
2 changes: 1 addition & 1 deletion packages/caliper-burrow/lib/burrow.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

const fs = require('fs');
const monax = require('@monax/burrow');
const { BlockchainInterface, CaliperUtils, TxStatus } = require('caliper-core');
const { BlockchainInterface, CaliperUtils, TxStatus } = require('@hyperledger/caliper-core');
const logger = CaliperUtils.getLogger('burrow.js');

/**
Expand Down
2 changes: 1 addition & 1 deletion packages/caliper-burrow/lib/burrowClientWorker.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

'use strict';

const { CaliperLocalClient, CaliperUtils } = require('caliper-core');
const { CaliperLocalClient, CaliperUtils } = require('@hyperledger/caliper-core');
const BurrowClient = require('./burrow');

let caliperClient;
Expand Down
13 changes: 8 additions & 5 deletions packages/caliper-burrow/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "caliper-burrow",
"name": "@hyperledger/caliper-burrow",
"version": "0.1.0",
"repository": {
"type": "git",
Expand All @@ -19,10 +19,10 @@
"engine-strict": true,
"engineStrict": true,
"dependencies": {
"@monax/burrow": "0.23.0",
"caliper-core": "0.1.0"
"@hyperledger/caliper-core": "^0.1.0"
},
"devDependencies": {
"@monax/burrow": "0.23.0",
"chai": "^3.5.0",
"eslint": "^4.19.1",
"mocha": "3.4.2",
Expand All @@ -38,11 +38,14 @@
"exact_paths": [
"node_modules",
".nyc_output",
"coverage"
"coverage",
".gitignore",
"log"
],
"file_type_method": "EXCLUDE",
"file_types": [
".yml"
".yml",
".log"
],
"insert_license": false,
"license_formats": {
Expand Down
42 changes: 42 additions & 0 deletions packages/caliper-cli/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
*.bak

# Ignore any generated html files
*.html

# Ignore DS_Store files from Mac
**.DS_Store

architecture.pptx
output.log
lerna-debug.log

# Ignore zookeeper files
zookeeper.out

# We prefer to not use lock files
**/package-lock.json

.idea/
**/node_modules/
**/log/

# Ignore any composer logs
composer-logs/

# Ignore code coverage logs
**/.nyc_output/
**/coverage/

# Ignore IDE files
.vscode/

# Website files
.sass-cache/
Gemfile.lock
_site/

# verdaccio files
**/storage

# pm2 files
**/.pm2/
2 changes: 1 addition & 1 deletion packages/caliper-cli/caliper.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const version = 'v' + require('./package.json').version;
let results = yargs
.commandDir('./lib')
.help()
.example('caliper benchmark run\ncaliper zooclient start\ncaliper zooservice start ')
.example('caliper bind\ncaliper benchmark run\ncaliper zooclient start\ncaliper zooservice start ')
.demand(1)
.wrap(null)
.strict()
Expand Down
12 changes: 6 additions & 6 deletions packages/caliper-cli/lib/benchmark/lib/runBenchmark.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

'use strict';

const {CaliperFlow, CaliperUtils, ConfigUtil} = require('caliper-core');
const {CaliperFlow, CaliperUtils, ConfigUtil} = require('@hyperledger/caliper-core');
const chalk = require('chalk');
const cmdUtil = require('../../utils/cmdutils');
const path = require('path');
Expand All @@ -39,12 +39,12 @@ class RunBenchmark {
benchConfigFile = path.isAbsolute(benchConfigFile) ? benchConfigFile : path.join(workspace, benchConfigFile);
blockchainConfigFile = path.isAbsolute(blockchainConfigFile) ? blockchainConfigFile : path.join(workspace, blockchainConfigFile);

if(!fs.existsSync(benchConfigFile)) {
throw(new Error('Configuration file ' + benchConfigFile + ' does not exist'));
if(!benchConfigFile || !fs.existsSync(benchConfigFile)) {
throw(new Error(`Benchmark configuration file "${benchConfigFile || 'UNSET'}" does not exist`));
}

if(!fs.existsSync(blockchainConfigFile)) {
throw(new Error('Configuration file ' + blockchainConfigFile + ' does not exist'));
if(!blockchainConfigFile || !fs.existsSync(blockchainConfigFile)) {
throw(new Error(`Network configuration file "${blockchainConfigFile || 'UNSET'}" does not exist`));
}

let blockchainType = '';
Expand All @@ -57,7 +57,7 @@ class RunBenchmark {

try {
cmdUtil.log(chalk.blue.bold('Benchmark for target Blockchain type ' + blockchainType + ' about to start'));
const {AdminClient, ClientFactory} = require('caliper-' + blockchainType);
const {AdminClient, ClientFactory} = require('@hyperledger/caliper-' + blockchainType);
const adminClient = new AdminClient(blockchainConfigFile, workspace);
const clientFactory = new ClientFactory(blockchainConfigFile, workspace);

Expand Down
6 changes: 3 additions & 3 deletions packages/caliper-cli/lib/benchmark/runBenchmarkCommand.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ module.exports.describe = 'Run a Caliper benchmark';
module.exports.builder = function (yargs){

yargs.options({
'caliper-benchconfig' : {required: true, describe: 'Path to the benchmark workload file that describes the test client(s), test rounds and monitor.', type: 'string' },
'caliper-networkconfig' : {required: true, describe:'Path to the blockchain configuration file that contains information required to interact with the SUT', type: 'string'},
'caliper-workspace' : {required: true, describe:'Workspace directory that contains all configuration information', type: 'string'}
'caliper-benchconfig' : {describe: 'Path to the benchmark workload file that describes the test client(s), test rounds and monitor.', type: 'string' },
'caliper-networkconfig' : {describe:'Path to the blockchain configuration file that contains information required to interact with the SUT', type: 'string'},
'caliper-workspace' : {describe:'Workspace directory that contains all configuration information', type: 'string'}
});
yargs.usage('caliper benchmark run --caliper-workspace ~/myCaliperProject --caliper-benchconfig my-app-test-config.yaml --caliper-networkconfig my-sut-config.yaml');

Expand Down
Loading

0 comments on commit 7c34028

Please sign in to comment.