Skip to content

Commit

Permalink
Cleanly stop npm proxy in Playground API devStart.sh (hyperledger-arc…
Browse files Browse the repository at this point in the history
…hives#4259)

Signed-off-by: Mark S. Lewis <[email protected]>
  • Loading branch information
bestbeforetoday authored Jul 19, 2018
1 parent 4f979d4 commit ee98244
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions packages/composer-playground-api/scripts/devStart.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
# limitations under the License.
#

# Exit on first error, print all commands
set -ev
# Stop on any errors
set -e

# Environment vaiable directs Playground (connector server) to an npmrc to supply to network install
export NPMRC_FILE='/tmp/npmrc'
Expand All @@ -38,8 +38,15 @@ for package in composer-common composer-runtime composer-runtime-hlfv1; do
npm publish --userconfig "${scriptDir}/publish.npmrc" "${packagesDir}/${package}"
done

Shutdown() {
# Stop the npm proxy
docker-compose -f "${scriptDir}/docker-compose.yaml" down
exit 0
}

echo ''
echo '*** Ctrl-C to stop Playground API ***'
trap Shutdown SIGINT

# Start the Playground API
npm start

# Stop the npm proxy
docker-compose -f "${scriptDir}/docker-compose.yaml" down

0 comments on commit ee98244

Please sign in to comment.