Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 4 additions & 9 deletions scripts/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@ resolve_compose_workdir() {
}

docker_compose() {
docker compose -p "$COMPOSE_PROJECT_NAME" "$@"
docker compose \
--project-directory "$COMPOSE_WORKDIR" \
-p "$COMPOSE_PROJECT_NAME" \
"$@"
}

notify() {
Expand Down Expand Up @@ -76,22 +79,14 @@ trap 'rmdir "$LOCK_DIR" 2>/dev/null || true' EXIT

COMPOSE_WORKDIR="$(resolve_compose_workdir)"

if [ "$COMPOSE_WORKDIR" != "$DEPLOY_DIR" ] && [ ! -e "$COMPOSE_WORKDIR" ]; then
mkdir -p "$(dirname "$COMPOSE_WORKDIR")"
ln -s "$DEPLOY_DIR" "$COMPOSE_WORKDIR"
fi

cd "$DEPLOY_DIR"
git config --global --add safe.directory "$DEPLOY_DIR"
git config --global --add safe.directory "$COMPOSE_WORKDIR"

notify 16776960 "Deploy Started" "Pulling latest changes and rebuilding..."

log "Pulling latest changes..."
git pull origin main

cd "$COMPOSE_WORKDIR"

log "Pulling images..."
if ! docker_compose pull bot backend frontend nginx; then
log "WARN: Pull failed, falling back to local build..."
Expand Down
Loading