diff --git a/scripts/post-receive b/scripts/post-receive index 010ea92..eb93590 100644 --- a/scripts/post-receive +++ b/scripts/post-receive @@ -3,7 +3,10 @@ TARGET="path to work repo" GIT_DIR="Path to .git repo" BRANCH="master" +LOG_FILE="/var/log/deploy.log" +exec > >(tee -a "$LOG_FILE") 2>&1 +echo "[$(date '+%Y-%m-%d %H:%M:%S')] Starting deploy..." git --work-tree="$TARGET" --git-dir="$GIT_DIR" checkout -f "$BRANCH" cd $TARGET @@ -19,3 +22,4 @@ docker-compose down # 3 docker-compose up -d +echo "[$(date '+%Y-%m-%d %H:%M:%S')] Deploy successful!" \ No newline at end of file