tee logs (#129)
This commit is contained in:
parent
9016be38a0
commit
60e951a172
@ -19,7 +19,7 @@ ARG CONFIG_FILE="./environments/config.toml"
|
|||||||
ARG EXPOSE_PORT=8545
|
ARG EXPOSE_PORT=8545
|
||||||
|
|
||||||
RUN adduser -Du 5000 $USER adm
|
RUN adduser -Du 5000 $USER adm
|
||||||
RUN adduser $USER adm; apk --no-cache add sudo; echo '%adm ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
|
RUN adduser $USER adm; apk --no-cache add sudo bash; echo '%adm ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
RUN chown $USER /app
|
RUN chown $USER /app
|
||||||
|
@ -1,12 +1,14 @@
|
|||||||
#!/bin/sh
|
#!/bin/bash
|
||||||
# Exit if the variable tests fail
|
# Exit if the variable tests fail
|
||||||
set -e
|
set -e
|
||||||
set +x
|
set -o pipefail
|
||||||
|
|
||||||
|
if [[ -n "$CERC_SCRIPT_DEBUG" ]]; then
|
||||||
|
set -x
|
||||||
|
fi
|
||||||
|
|
||||||
# Check the database variables are set
|
# Check the database variables are set
|
||||||
test "$VDB_COMMAND"
|
test "$VDB_COMMAND"
|
||||||
set +e
|
|
||||||
|
|
||||||
|
|
||||||
# docker must be run in privilaged mode for mounts to work
|
# docker must be run in privilaged mode for mounts to work
|
||||||
echo "Setting up /app/geth-rw overlayed /app/geth-ro"
|
echo "Setting up /app/geth-rw overlayed /app/geth-ro"
|
||||||
@ -15,14 +17,17 @@ sudo mount -t tmpfs tmpfs /tmp/overlay && \
|
|||||||
mkdir -p /tmp/overlay/upper && \
|
mkdir -p /tmp/overlay/upper && \
|
||||||
mkdir -p /tmp/overlay/work && \
|
mkdir -p /tmp/overlay/work && \
|
||||||
mkdir -p /app/geth-rw && \
|
mkdir -p /app/geth-rw && \
|
||||||
sudo mount -t overlay overlay -o lowerdir=/app/geth-ro,upperdir=/tmp/overlay/upper,workdir=/tmp/overlay/work /app/geth-rw && \
|
sudo mount -t overlay overlay -o lowerdir=/app/geth-ro,upperdir=/tmp/overlay/upper,workdir=/tmp/overlay/work /app/geth-rw
|
||||||
|
|
||||||
START_TIME=`date -u +"%Y-%m-%dT%H:%M:%SZ"`
|
START_TIME=`date -u +"%Y-%m-%dT%H:%M:%SZ"`
|
||||||
|
|
||||||
echo "Running the statediff service" && \
|
echo "Running the statediff service" && \
|
||||||
|
if [[ ! -z "$LOG_FILE_PATH" ]]; then
|
||||||
|
sudo -E ./eth-statediff-service "$VDB_COMMAND" --config=config.toml $* |& tee ${LOG_FILE_PATH}.console
|
||||||
|
rc=$?
|
||||||
|
else
|
||||||
sudo -E ./eth-statediff-service "$VDB_COMMAND" --config=config.toml $*
|
sudo -E ./eth-statediff-service "$VDB_COMMAND" --config=config.toml $*
|
||||||
rc=$?
|
rc=$?
|
||||||
|
fi
|
||||||
STOP_TIME=`date -u +"%Y-%m-%dT%H:%M:%SZ"`
|
STOP_TIME=`date -u +"%Y-%m-%dT%H:%M:%SZ"`
|
||||||
|
|
||||||
if [ $rc -eq 0 ] && [ "$PRERUN_ONLY" == "true" ] && [ ! -z "$PRERUN_RANGE_START" ] && [ ! -z "$PRERUN_RANGE_STOP" ] && [ ! -z "$DATABASE_FILE_CSV_DIR" ] && [ "$DATABASE_FILE_MODE" == "csv" ]; then
|
if [ $rc -eq 0 ] && [ "$PRERUN_ONLY" == "true" ] && [ ! -z "$PRERUN_RANGE_START" ] && [ ! -z "$PRERUN_RANGE_STOP" ] && [ ! -z "$DATABASE_FILE_CSV_DIR" ] && [ "$DATABASE_FILE_MODE" == "csv" ]; then
|
||||||
|
Loading…
Reference in New Issue
Block a user