fix: auto-update n8n_version in .env on branch switch

This commit is contained in:
Yury Kossakovsky
2025-12-09 22:41:12 -07:00
parent 1cee375467
commit ed29d0ecfd
2 changed files with 17 additions and 1 deletions

View File

@@ -179,7 +179,7 @@ RUN_N8N_IMPORT=
# n8n version (used for both n8n and task runner images)
# Update this when upgrading n8n to ensure runner version matches
N8N_VERSION=stable
N8N_VERSION=2.0.0
# Number of n8n worker-runner pairs to generate.
# Each worker gets its own dedicated task runner sidecar.

View File

@@ -50,9 +50,25 @@ restarts:
switch-beta:
git restore docker-compose.yml
git checkout develop
@if [ -f .env ]; then \
if grep -q '^N8N_VERSION=' .env; then \
sed -i.bak 's/^N8N_VERSION=.*/N8N_VERSION=2.0.0/' .env && rm -f .env.bak; \
else \
echo 'N8N_VERSION=2.0.0' >> .env; \
fi; \
fi
@echo "N8N_VERSION set to 2.0.0"
sudo bash ./scripts/update.sh
switch-stable:
git restore docker-compose.yml
git checkout main
@if [ -f .env ]; then \
if grep -q '^N8N_VERSION=' .env; then \
sed -i.bak 's/^N8N_VERSION=.*/N8N_VERSION=stable/' .env && rm -f .env.bak; \
else \
echo 'N8N_VERSION=stable' >> .env; \
fi; \
fi
@echo "N8N_VERSION set to stable"
sudo bash ./scripts/update.sh