From fa3df2b69a7323fffe127d9560491257f8e097fe Mon Sep 17 00:00:00 2001 From: "Mark S. Lewis" Date: Mon, 5 Aug 2024 12:25:55 +0200 Subject: [PATCH] Use `docker compose` instead of `docker-compose` (#700) The old `docker-compose` command no longer exists in some environments and causes build failures. Instead use the replacement `docker compose` command. Signed-off-by: Mark S. Lewis --- package.json | 222 ++++++++++++------------ test/ts-scenario/src/steps/constants.ts | 2 +- test/ts-scenario/src/steps/docker.ts | 8 +- 3 files changed, 116 insertions(+), 116 deletions(-) diff --git a/package.json b/package.json index f1f9ad094..02aed645d 100644 --- a/package.json +++ b/package.json @@ -1,113 +1,113 @@ { - "name": "fabric-sdk-node", - "version": "2.2.21-snapshot", - "tag": "unstable", - "main": "index.js", - "private": true, - "repository": { - "type": "git", - "url": "https://github.com/hyperledger/fabric-sdk-node" - }, - "homepage": "https://www.hyperledger.org/projects/fabric", - "author": { - "name": "hyperledger/fabric", - "email": "fabric@lists.hyperledger.org" - }, - "scripts": { - "installAndGenerateCerts": "node ./scripts/npm_scripts/generateCerts.js", - "pullFabricImages": "./scripts/utility/fabric_images.sh", - "test": "run-s checkLicense cleanUp dockerClean compile lint docs unitTest:all dockerReady tapeIntegration cucumberScenario", - "testNoHSM": "run-s checkLicense cleanUp dockerClean compile lint docs unitTest:all dockerReady tapeIntegration cucumberScenarioNoHSM", - "checkLicense": "./scripts/npm_scripts/checkLicense.sh", - "cleanUp": "node -e 'require(\"./scripts/npm_scripts/testFunctions.js\").cleanUp()'", - "dockerClean": "./scripts/npm_scripts/dockerClean.sh", - "compile": "tsc --project fabric-network/tsconfig.json", - "lint": "eslint . --ext .ts,.js", - "docs": "node -e 'require(\"./scripts/npm_scripts/testFunctions.js\").cleanUpDocs()' && jsdoc -c docs/jsdoc.json -t ./node_modules/ink-docstrap/template --pedantic --recurse", - "unitTest:all": "export HFC_LOGGING='{\"debug\":\"test/temp/debug.log\"}' && nyc run-s unitTest:common unitTest:ca-client unitTest:network", - "unitTest:common": "mocha --reporter list 'fabric-common/test/**/*.js'", - "unitTest:ca-client": "mocha --reporter list 'fabric-ca-client/test/**/*.js'", - "unitTest:network": "run-s compile \"unitTest -- --project ./fabric-network/tsconfig.json 'fabric-network/test/**/*.{js,ts}'\"", - "unitTest": "ts-mocha --reporter list", - "dockerReady": "npm run dockerClean && (cd test/fixtures/docker-compose && docker-compose -f docker-compose-tls-level-db.yaml -p node up -d && sleep 15 && docker ps -a)", - "tapeIntegration": "./scripts/npm_scripts/runTape.sh", - "cucumberScenario": "npm run setupCucumbers && export HFC_LOGGING='{\"debug\":\"test/temp/debugc.log\"}' && npm run dockerClean && nyc --check-coverage --statements 54 --branches 32 --functions 46 --lines 54 npm run test:ts-cucumber", - "cucumberScenarioNoHSM": "npm run setupCucumbers && export HFC_LOGGING='{\"debug\":\"test/temp/debugc.log\"}' && npm run dockerClean && nyc --check-coverage --statements 54 --branches 32 --functions 46 --lines 54 npm run test:ts-cucumberNoHSM", - "setupCucumbers": "node -e 'require(\"./scripts/npm_scripts/testFunctions.js\").createCucumberLogFile()'", - "test:ts-cucumber": "tsc --project test/ts-scenario/tsconfig.json && cucumber-js -f @cucumber/pretty-formatter ./test/ts-scenario/features/*.feature --require './test/ts-scenario/lib/**/*.js'", - "test:ts-cucumberNoHSM": "npm run test:ts-cucumber -- --tags 'not @gateway_hsm'", - "testHeadless": "run-s cleanUp compile lint unitTest:all", - "tapeAndCucumber": "run-s tapeIntegration dockerClean cucumberScenario" - }, - "devDependencies": { - "@cucumber/cucumber": "^7.3.2", - "@cucumber/pretty-formatter": "^1.0.0-alpha.1", - "@tsconfig/node14": "^14.1.0", - "@types/chai": "^4.2.18", - "@types/chai-as-promised": "^7.1.4", - "@types/mocha": "^8.2.3", - "@types/node": "^14.18.63", - "@types/rimraf": "^3.0.0", - "@types/sinon": "^10.0.0", - "@types/tape": "^4.2.33", - "@typescript-eslint/eslint-plugin": "^5.62.0", - "@typescript-eslint/parser": "^5.62.0", - "bn.js": "^5.2.0", - "chai": "^4.3.4", - "chai-as-promised": "^7.1.1", - "elliptic": "^6.5.4", - "eslint": "^8.53.0", - "eslint-plugin-tsdoc": "^0.2.17", - "fabric-ca-client": "file:./fabric-ca-client", - "fabric-client": "^1.4.18", - "fabric-common": "file:./fabric-common", - "fabric-network": "file:./fabric-network", - "fabric-protos": "file:./fabric-protos", - "ink-docstrap": "^1.3.2", - "jsdoc": "^3.6.6", - "jsrsasign": "^11.0.0", - "long": "^5.2.3", - "mocha": "^9.2.2", - "npm-run-all": "^4.1.5", - "nyc": "^15.0.0", - "rewire": "^6.0.0", - "rimraf": "^3.0.0", - "sinon": "^13.0.2", - "sinon-chai": "^3.6.0", - "strip-ansi": "^6.0.1", - "tape": "^5.2.2", - "tape-promise": "^4.0.0", - "ts-mocha": "^10.0.0", - "ts-mock-imports": "^1.3.4", - "typescript": "~4.9.5", - "winston": "^2.4.5" - }, - "licenses": [ - { - "type": "Apache-2.0", - "url": "https://github.com/hyperledger/fabric/blob/main/LICENSE" - } - ], - "nyc": { - "exclude": [ - "test/**", - "fabric-*/index.js", - "fabric-*/test/**", - "fabric-protos/grpc.js", - "fabric-protos/bundle.js" - ], - "extension": [ - ".ts" - ], - "reporter": [ - "text", - "html" - ], - "cache": true, - "check-coverage": true, - "statements": 82, - "branches": 74, - "functions": 77, - "lines": 83 - } + "name": "fabric-sdk-node", + "version": "2.2.21-snapshot", + "tag": "unstable", + "main": "index.js", + "private": true, + "repository": { + "type": "git", + "url": "https://github.com/hyperledger/fabric-sdk-node" + }, + "homepage": "https://www.hyperledger.org/projects/fabric", + "author": { + "name": "hyperledger/fabric", + "email": "fabric@lists.hyperledger.org" + }, + "scripts": { + "installAndGenerateCerts": "node ./scripts/npm_scripts/generateCerts.js", + "pullFabricImages": "./scripts/utility/fabric_images.sh", + "test": "run-s checkLicense cleanUp dockerClean compile lint docs unitTest:all dockerReady tapeIntegration cucumberScenario", + "testNoHSM": "run-s checkLicense cleanUp dockerClean compile lint docs unitTest:all dockerReady tapeIntegration cucumberScenarioNoHSM", + "checkLicense": "./scripts/npm_scripts/checkLicense.sh", + "cleanUp": "node -e 'require(\"./scripts/npm_scripts/testFunctions.js\").cleanUp()'", + "dockerClean": "./scripts/npm_scripts/dockerClean.sh", + "compile": "tsc --project fabric-network/tsconfig.json", + "lint": "eslint . --ext .ts,.js", + "docs": "node -e 'require(\"./scripts/npm_scripts/testFunctions.js\").cleanUpDocs()' && jsdoc -c docs/jsdoc.json -t ./node_modules/ink-docstrap/template --pedantic --recurse", + "unitTest:all": "export HFC_LOGGING='{\"debug\":\"test/temp/debug.log\"}' && nyc run-s unitTest:common unitTest:ca-client unitTest:network", + "unitTest:common": "mocha --reporter list 'fabric-common/test/**/*.js'", + "unitTest:ca-client": "mocha --reporter list 'fabric-ca-client/test/**/*.js'", + "unitTest:network": "run-s compile \"unitTest -- --project ./fabric-network/tsconfig.json 'fabric-network/test/**/*.{js,ts}'\"", + "unitTest": "ts-mocha --reporter list", + "dockerReady": "npm run dockerClean && (cd test/fixtures/docker-compose && docker compose -f docker-compose-tls-level-db.yaml -p node up -d && sleep 15 && docker ps -a)", + "tapeIntegration": "./scripts/npm_scripts/runTape.sh", + "cucumberScenario": "npm run setupCucumbers && export HFC_LOGGING='{\"debug\":\"test/temp/debugc.log\"}' && npm run dockerClean && nyc --check-coverage --statements 54 --branches 32 --functions 46 --lines 54 npm run test:ts-cucumber", + "cucumberScenarioNoHSM": "npm run setupCucumbers && export HFC_LOGGING='{\"debug\":\"test/temp/debugc.log\"}' && npm run dockerClean && nyc --check-coverage --statements 54 --branches 32 --functions 46 --lines 54 npm run test:ts-cucumberNoHSM", + "setupCucumbers": "node -e 'require(\"./scripts/npm_scripts/testFunctions.js\").createCucumberLogFile()'", + "test:ts-cucumber": "tsc --project test/ts-scenario/tsconfig.json && cucumber-js -f @cucumber/pretty-formatter ./test/ts-scenario/features/*.feature --require './test/ts-scenario/lib/**/*.js'", + "test:ts-cucumberNoHSM": "npm run test:ts-cucumber -- --tags 'not @gateway_hsm'", + "testHeadless": "run-s cleanUp compile lint unitTest:all", + "tapeAndCucumber": "run-s tapeIntegration dockerClean cucumberScenario" + }, + "devDependencies": { + "@cucumber/cucumber": "^7.3.2", + "@cucumber/pretty-formatter": "^1.0.0-alpha.1", + "@tsconfig/node14": "^14.1.0", + "@types/chai": "^4.2.18", + "@types/chai-as-promised": "^7.1.4", + "@types/mocha": "^8.2.3", + "@types/node": "^14.18.63", + "@types/rimraf": "^3.0.0", + "@types/sinon": "^10.0.0", + "@types/tape": "^4.2.33", + "@typescript-eslint/eslint-plugin": "^5.62.0", + "@typescript-eslint/parser": "^5.62.0", + "bn.js": "^5.2.0", + "chai": "^4.3.4", + "chai-as-promised": "^7.1.1", + "elliptic": "^6.5.4", + "eslint": "^8.53.0", + "eslint-plugin-tsdoc": "^0.2.17", + "fabric-ca-client": "file:./fabric-ca-client", + "fabric-client": "^1.4.18", + "fabric-common": "file:./fabric-common", + "fabric-network": "file:./fabric-network", + "fabric-protos": "file:./fabric-protos", + "ink-docstrap": "^1.3.2", + "jsdoc": "^3.6.6", + "jsrsasign": "^11.0.0", + "long": "^5.2.3", + "mocha": "^9.2.2", + "npm-run-all": "^4.1.5", + "nyc": "^15.0.0", + "rewire": "^6.0.0", + "rimraf": "^3.0.0", + "sinon": "^13.0.2", + "sinon-chai": "^3.6.0", + "strip-ansi": "^6.0.1", + "tape": "^5.2.2", + "tape-promise": "^4.0.0", + "ts-mocha": "^10.0.0", + "ts-mock-imports": "^1.3.4", + "typescript": "~4.9.5", + "winston": "^2.4.5" + }, + "licenses": [ + { + "type": "Apache-2.0", + "url": "https://github.com/hyperledger/fabric/blob/main/LICENSE" + } + ], + "nyc": { + "exclude": [ + "test/**", + "fabric-*/index.js", + "fabric-*/test/**", + "fabric-protos/grpc.js", + "fabric-protos/bundle.js" + ], + "extension": [ + ".ts" + ], + "reporter": [ + "text", + "html" + ], + "cache": true, + "check-coverage": true, + "statements": 82, + "branches": 74, + "functions": 77, + "lines": 83 + } } diff --git a/test/ts-scenario/src/steps/constants.ts b/test/ts-scenario/src/steps/constants.ts index f675b429c..c0c1ce22b 100644 --- a/test/ts-scenario/src/steps/constants.ts +++ b/test/ts-scenario/src/steps/constants.ts @@ -108,4 +108,4 @@ export const ADMIN_NAME = 'admin'; export const ADMIN_PW = 'adminpw'; // Default Naming -export const EVENT_HUB_DEFAULT_NAME = 'myHub'; \ No newline at end of file +export const EVENT_HUB_DEFAULT_NAME = 'myHub'; diff --git a/test/ts-scenario/src/steps/docker.ts b/test/ts-scenario/src/steps/docker.ts index 5d158dd9f..314b57e2f 100644 --- a/test/ts-scenario/src/steps/docker.ts +++ b/test/ts-scenario/src/steps/docker.ts @@ -35,9 +35,9 @@ Given(/^I deploy a (.+?) Fabric network at (.+?) version/, {timeout: Constants.S if (!fabricState || !fabricState.deployed) { BaseUtils.logMsg(` **** deploying a new fabric network of type ${type} version ${version}`); if (type.localeCompare('non-tls') === 0) { - await commandRunner.runShellCommand(true, 'docker-compose -f ' + nonTlsNetwork + ' -p node up -d'); + await commandRunner.runShellCommand(true, 'docker compose -f ' + nonTlsNetwork + ' -p node up -d'); } else { - await commandRunner.runShellCommand(true, 'docker-compose -f ' + tlsNetwork + ' -p node up -d'); + await commandRunner.runShellCommand(true, 'docker compose -f ' + tlsNetwork + ' -p node up -d'); } stateStore.set(Constants.FABRIC_STATE, {deployed: true, type, version}); await BaseUtils.sleep(Constants.INC_SHORT); @@ -54,9 +54,9 @@ Given(/^I deploy a (.+?) Fabric network at (.+?) version/, {timeout: Constants.S await BaseUtils.sleep(Constants.INC_MED); if (type.localeCompare('non-tls') === 0) { - await commandRunner.runShellCommand(true, 'docker-compose -f ' + nonTlsNetwork + ' -p node up -d'); + await commandRunner.runShellCommand(true, 'docker compose -f ' + nonTlsNetwork + ' -p node up -d'); } else { - await commandRunner.runShellCommand(true, 'docker-compose -f ' + tlsNetwork + ' -p node up -d'); + await commandRunner.runShellCommand(true, 'docker compose -f ' + tlsNetwork + ' -p node up -d'); } stateStore.set(Constants.FABRIC_STATE, {deployed: true, type, version}); await BaseUtils.sleep(Constants.INC_SHORT);