Skip to content

Commit

Permalink
fix(postgres): update entrypoint to respect LEDGER_ID env
Browse files Browse the repository at this point in the history
BCP-17

BCP-17

Signed-off-by: Kevin O'Donnell <kevin@blockchaintp.com>
  • Loading branch information
scealiontach committed Sep 21, 2022
1 parent f713c85 commit a3aa8a6
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions postgres/src/main/scripts/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,19 @@ if [ -n "${INDEX_POSTGRES_DB}" ] || [ -n "${INDEX_JDBC_URL}" ]; then
PARTICIPANT_ARG="${PARTICIPANT_ARG},server-jdbc-url=${INDEX_JDBC_URL}"
fi

# shellcheck disable=SC2086,SC2046,SC2068
exec java ${JAVA_OPTS} -jar daml-on-postgres*.jar \
--txlogstore "$POSTGRES_JDBC_URL" \
--participant "${PARTICIPANT_ARG}" \
$@ \
$(ls /opt/digitalasset/dar/*.dar 2>/dev/null)
if [ -n "${LEDGER_ID}" ]; then
# shellcheck disable=SC2086,SC2046,SC2068
exec java ${JAVA_OPTS} -jar daml-on-postgres*.jar \
--txlogstore "$POSTGRES_JDBC_URL" \
--ledger-id "$LEDGER_ID" \
--participant "${PARTICIPANT_ARG}" \
$@ \
$(ls /opt/digitalasset/dar/*.dar 2>/dev/null)
else
# shellcheck disable=SC2086,SC2046,SC2068
exec java ${JAVA_OPTS} -jar daml-on-postgres*.jar \
--txlogstore "$POSTGRES_JDBC_URL" \
--participant "${PARTICIPANT_ARG}" \
$@ \
$(ls /opt/digitalasset/dar/*.dar 2>/dev/null)
fi

0 comments on commit a3aa8a6

Please sign in to comment.