diff --git a/docs/upgrading.md b/docs/upgrading.md index 5d1d4b3..48da481 100644 --- a/docs/upgrading.md +++ b/docs/upgrading.md @@ -17,13 +17,18 @@ When a new version only includes updated container images (no compose or config ```bash cd on-prem -# Pull latest images +# Update the image tag in your .env file +# Change DC_CURRENTS_IMAGE_TAG to the new version (e.g., 2026-01-26-001) + +# Pull the new images docker compose pull # Restart with new images docker compose up -d ``` +> **Note:** The `DC_CURRENTS_IMAGE_TAG` in your `.env` file controls which version of Currents images are pulled. You must update this value to pull a new version. Run `./scripts/check-env.sh` to see if your tag differs from the current release. + ### Updates with Compose File Changes When the CHANGELOG indicates compose file changes: @@ -37,6 +42,9 @@ docker compose down # Pull latest repository changes git pull +# Update DC_CURRENTS_IMAGE_TAG in your .env file to the new version +# Check VERSION file for the current release version: cat VERSION + # Regenerate your compose file (if using custom profile) ./scripts/generate-compose.sh @@ -59,13 +67,18 @@ cd on-prem # Pull latest repository changes git pull -# Check for missing variables +# Check for missing variables and version discrepancies ./scripts/check-env.sh # Add any missing variables to your .env file # The script will show which variables are missing -# Then follow the appropriate upgrade steps above +# Update DC_CURRENTS_IMAGE_TAG in your .env file to the new version +# Check VERSION file for the current release version: cat VERSION + +# Pull new images and restart +docker compose pull +docker compose up -d ``` ## Version Checking diff --git a/on-prem/scripts/check-env.sh b/on-prem/scripts/check-env.sh index c335f57..e56cddf 100755 --- a/on-prem/scripts/check-env.sh +++ b/on-prem/scripts/check-env.sh @@ -58,6 +58,26 @@ while IFS= read -r line || [ -n "$line" ]; do fi done < "$EXAMPLE_FILE" +# ============================================================================= +# Check for version discrepancy +# ============================================================================= +VERSION_FILE="$ON_PREM_DIR/VERSION" +if [ -f "$VERSION_FILE" ]; then + expected_version=$(cat "$VERSION_FILE" | tr -d '[:space:]') + if grep -q "^DC_CURRENTS_IMAGE_TAG=" "$ENV_FILE"; then + current_tag=$(grep "^DC_CURRENTS_IMAGE_TAG=" "$ENV_FILE" | cut -d'=' -f2 | tr -d '[:space:]') + if [ -n "$current_tag" ] && [ "$current_tag" != "$expected_version" ]; then + echo -e "${YELLOW}Note: Version discrepancy detected${NC}" + echo " Your .env has DC_CURRENTS_IMAGE_TAG=$current_tag" + echo " The VERSION file specifies: $expected_version" + echo "" + echo " To upgrade, update DC_CURRENTS_IMAGE_TAG in your .env file," + echo " then run: docker compose pull && docker compose up -d" + echo "" + fi + fi +fi + # ============================================================================= # Check for corrupted values (e.g., line wrapping from terminal editors) # =============================================================================