-
Notifications
You must be signed in to change notification settings - Fork 144
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FAB-16714] Add build.sh and start.sh scripts
Currently the build and start processing for Node.js chaincode is specified in the peer code (platform.go and dockercontroller.go). We want to move this into the Node.js chaincode code so that we can update the build and start processing without having to modify peer code. To achieve this, we will make it work just like Java chaincode - the peer will call out to build.sh and start.sh scripts. Need to add the scripts first, then update the peer code to use them. Signed-off-by: Simon Stone <sstone1@uk.ibm.com> Change-Id: I9452f34c128bff597a8af4379103bff92fe49349
- Loading branch information
Simon Stone
committed
Oct 1, 2019
1 parent
f085675
commit 6198f7b
Showing
3 changed files
with
24 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/sh | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
set -ex | ||
INPUT_DIR=/chaincode/input | ||
OUTPUT_DIR=/chaincode/output | ||
cp -R ${INPUT_DIR}/src/. ${OUTPUT_DIR} | ||
cd ${OUTPUT_DIR} | ||
if [ -f package-lock.json -o -f npm-shrinkwrap.json ]; then | ||
npm ci --only=production | ||
else | ||
npm install --production | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/bin/sh | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
set -ex | ||
CHAINCODE_DIR=/usr/local/src | ||
cd ${CHAINCODE_DIR} | ||
npm start -- "$@" |