Improve deploy cron to log duration (and log file in case of error)
All checks were successful
Run tests / tests (push) Successful in 1m50s
All checks were successful
Run tests / tests (push) Successful in 1m50s
This commit is contained in:
parent
ba0f972b34
commit
73ebd4cddb
1 changed files with 5 additions and 3 deletions
|
@ -319,12 +319,14 @@ if [[ $DEPLOY_CRON -eq 1 ]]; then
|
||||||
for container in "${to_deploy[@]}"; do
|
for container in "${to_deploy[@]}"; do
|
||||||
message " $container: deploying..."
|
message " $container: deploying..."
|
||||||
log="$REBUILD_DATA_DIR/$container.log"
|
log="$REBUILD_DATA_DIR/$container.log"
|
||||||
if $COMPOSE_BIN -f "$DOCKERCOMPOSE_FILE" up -d --no-deps "$container" > "$log" 2>&1; then
|
start_time=$(current_time)
|
||||||
message " $container: done"
|
if $COMPOSE_BIN -f "$DOCKERCOMPOSE_FILE" up -d --no-deps "$container" >> "$log" 2>&1; then
|
||||||
|
message " $container: done (in $(format_duration "$(( $(current_time)-start_time ))"))"
|
||||||
update_rebuild_status -d "$container"
|
update_rebuild_status -d "$container"
|
||||||
rm -f "$log"
|
rm -f "$log"
|
||||||
else
|
else
|
||||||
error " $container: fail to deploy new container image"
|
error " $container: fail to deploy new container image (in" \
|
||||||
|
"$(format_duration "$(( $(current_time)-start_time ))"), see log: $log)"
|
||||||
update_rebuild_status "$container" "error=fail to deploy new container image"
|
update_rebuild_status "$container" "error=fail to deploy new container image"
|
||||||
error=1
|
error=1
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in a new issue