Skip to content

Commit 569ecf5

Browse files
committed
save logs before deleting container to the release folder
1 parent 80a6b2d commit 569ecf5

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

steps/push/lib/git-bare-resources/post-receive-utils.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,12 @@ stop_current_container() {
1919
CURRENT_DOCKER_COMPOSE="$DEPLOYMENT_DIR/current/docker-compose.yml"
2020
CURRENT_DIR=$(pwd)
2121
if [ -f "$CURRENT_DOCKER_COMPOSE" ]; then
22+
CURRENT_LOG_FOLDER="$DEPLOYMENT_DIR/shared/logs"
23+
mkdir -p "$CURRENT_LOG_FOLDER"
2224
cd "$DEPLOYMENT_DIR/current"
25+
if [ -d "$CURRENT_LOG_FOLDER" ]; then
26+
docker-compose logs 2>&1 >> "$CURRENT_LOG_FOLDER/$SERVICE_NAME.log"
27+
fi
2328
docker-compose rm -sf
2429
cd "$CURRENT_DIR"
2530
fi

0 commit comments

Comments
 (0)