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_DB=ploughshares
|
||||||
- POSTGRES_USER=ploughshares
|
- POSTGRES_USER=ploughshares
|
||||||
- POSTGRES_PASSWORD=ploughshares_password
|
- POSTGRES_PASSWORD=ploughshares_password
|
||||||
|
- APP_VERSION=0.1.1
|
||||||
depends_on:
|
depends_on:
|
||||||
db:
|
db:
|
||||||
condition: service_healthy
|
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:
|
It updates the version in multiple locations:
|
||||||
|
|
||||||
1. The VERSION file (source of truth)
|
1. The VERSION file (source of truth)
|
||||||
2. Console log messages in app.py
|
2. Docker Compose environment variables
|
||||||
3. 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
|
After running this script, you need to rebuild and restart the application
|
||||||
for the changes to take effect.
|
for the changes to take effect.
|
||||||
|
@ -74,16 +76,24 @@ update_version_everywhere() {
|
||||||
# 2. Log the version change
|
# 2. Log the version change
|
||||||
echo "$(date): Version changed from $CURRENT_VERSION to $NEW_VERSION" >> version_history.log
|
echo "$(date): Version changed from $CURRENT_VERSION to $NEW_VERSION" >> version_history.log
|
||||||
|
|
||||||
# 3. Update version in console log messages
|
# 3. Update version in docker-compose.yml
|
||||||
# This ensures the version is visible in logs when the app starts
|
# Add APP_VERSION environment variable if it doesn't exist
|
||||||
sed -i.bak "s/print(f\"Connected to PostgreSQL at/print(f\"Ploughshares v$NEW_VERSION - Connected to PostgreSQL at/" docker/ploughshares/app.py
|
if ! grep -q "APP_VERSION=" "$DOCKER_COMPOSE_FILE"; then
|
||||||
rm -f docker/ploughshares/app.py.bak
|
# Find the environment section for the app service
|
||||||
echo "Updated version in app.py console logs"
|
LINE_NUM=$(grep -n "environment:" "$DOCKER_COMPOSE_FILE" | head -1 | cut -d: -f1)
|
||||||
|
if [ -n "$LINE_NUM" ]; then
|
||||||
# 4. Update version in docker-compose.yml
|
# Insert APP_VERSION after the environment line
|
||||||
sed -i.bak "s/APP_VERSION=.*/APP_VERSION=$NEW_VERSION/" "$DOCKER_COMPOSE_FILE"
|
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"
|
rm -f "$DOCKER_COMPOSE_FILE.bak"
|
||||||
echo "Updated version in $DOCKER_COMPOSE_FILE"
|
|
||||||
|
|
||||||
echo "Version update complete! New version: $NEW_VERSION"
|
echo "Version update complete! New version: $NEW_VERSION"
|
||||||
echo "Remember to rebuild and restart the application for changes to take effect."
|
echo "Remember to rebuild and restart the application for changes to take effect."
|
||||||
|
|
Loading…
Reference in New Issue