Update versionbump.sh to use VERSION file as source of truth for web UI
ci/woodpecker/push/woodpecker Pipeline was successful
Details
ci/woodpecker/push/woodpecker Pipeline was successful
Details
This commit is contained in:
parent
52536db6d9
commit
5d0dc3d29a
|
@ -17,6 +17,7 @@ services:
|
|||
- POSTGRES_DB=ploughshares
|
||||
- POSTGRES_USER=ploughshares
|
||||
- POSTGRES_PASSWORD=ploughshares_password
|
||||
- APP_VERSION=0.1.1
|
||||
depends_on:
|
||||
db:
|
||||
condition: service_healthy
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
Thu Jul 3 13:33:04 EDT 2025: Version changed from 0.1.0 to 0.1.1
|
|
@ -29,8 +29,10 @@ DESCRIPTION:
|
|||
It updates the version in multiple locations:
|
||||
|
||||
1. The VERSION file (source of truth)
|
||||
2. Console log messages in app.py
|
||||
3. Docker Compose environment variables
|
||||
2. Docker Compose environment variables
|
||||
|
||||
The web UI and application will automatically read the version from the
|
||||
VERSION file at the root of the repository.
|
||||
|
||||
After running this script, you need to rebuild and restart the application
|
||||
for the changes to take effect.
|
||||
|
@ -74,16 +76,24 @@ update_version_everywhere() {
|
|||
# 2. Log the version change
|
||||
echo "$(date): Version changed from $CURRENT_VERSION to $NEW_VERSION" >> version_history.log
|
||||
|
||||
# 3. Update version in console log messages
|
||||
# This ensures the version is visible in logs when the app starts
|
||||
sed -i.bak "s/print(f\"Connected to PostgreSQL at/print(f\"Ploughshares v$NEW_VERSION - Connected to PostgreSQL at/" docker/ploughshares/app.py
|
||||
rm -f docker/ploughshares/app.py.bak
|
||||
echo "Updated version in app.py console logs"
|
||||
|
||||
# 4. Update version in docker-compose.yml
|
||||
# 3. Update version in docker-compose.yml
|
||||
# Add APP_VERSION environment variable if it doesn't exist
|
||||
if ! grep -q "APP_VERSION=" "$DOCKER_COMPOSE_FILE"; then
|
||||
# Find the environment section for the app service
|
||||
LINE_NUM=$(grep -n "environment:" "$DOCKER_COMPOSE_FILE" | head -1 | cut -d: -f1)
|
||||
if [ -n "$LINE_NUM" ]; then
|
||||
# Insert APP_VERSION after the environment line
|
||||
sed -i.bak "${LINE_NUM}a\\ - APP_VERSION=$NEW_VERSION" "$DOCKER_COMPOSE_FILE"
|
||||
echo "Added APP_VERSION=$NEW_VERSION to $DOCKER_COMPOSE_FILE"
|
||||
else
|
||||
echo "Warning: Could not find environment section in $DOCKER_COMPOSE_FILE"
|
||||
fi
|
||||
else
|
||||
# Update existing APP_VERSION
|
||||
sed -i.bak "s/APP_VERSION=.*/APP_VERSION=$NEW_VERSION/" "$DOCKER_COMPOSE_FILE"
|
||||
echo "Updated APP_VERSION in $DOCKER_COMPOSE_FILE"
|
||||
fi
|
||||
rm -f "$DOCKER_COMPOSE_FILE.bak"
|
||||
echo "Updated version in $DOCKER_COMPOSE_FILE"
|
||||
|
||||
echo "Version update complete! New version: $NEW_VERSION"
|
||||
echo "Remember to rebuild and restart the application for changes to take effect."
|
||||
|
|
Loading…
Reference in New Issue