Skip to content

Commit

Permalink
Refactor docker-entrypoint (#34)
Browse files Browse the repository at this point in the history
  • Loading branch information
Montana committed Jul 13, 2023
1 parent 4ec02f7 commit 4b3528c
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions chaincode/lightswitch/docker/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,21 @@
#
# SPDX-License-Identifier: Apache-2.0
#

set -euo pipefail
: ${CORE_PEER_TLS_ENABLED:="false"}
: ${DEBUG:="false"}

CORE_PEER_TLS_ENABLED="${CORE_PEER_TLS_ENABLED:-false}"
DEBUG="${DEBUG:-false}"

env | sort

if [ "${DEBUG,,}" = "true" ]; then
echo "DEBUG"
exec java -Djava.util.logging.config.file=logging.properties -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=localhost:8000 -jar /chaincode.jar
elif [ "${CORE_PEER_TLS_ENABLED,,}" = "true" ]; then
echo "CORE_PEER_TLS_ENABLED=true"
exec java -Djava.util.logging.config.file=logging.properties -jar /chaincode.jar # todo
if [[ "${DEBUG,,}" = "true" ]]; then
echo "DEBUG"
exec java -Djava.util.logging.config.file=logging.properties -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=localhost:8000 -jar /chaincode.jar
elif [[ "${CORE_PEER_TLS_ENABLED,,}" = "true" ]]; then
echo "CORE_PEER_TLS_ENABLED=true"
exec java -Djava.util.logging.config.file=logging.properties -jar /chaincode.jar # todo
else
echo "Nominal execution"
exec java -Djava.util.logging.config.file=logging.properties -jar /chaincode.jar
echo "Nominal execution"
exec java -Djava.util.logging.config.file=logging.properties -jar /chaincode.jar
fi

0 comments on commit 4b3528c

Please sign in to comment.