Skip to content

Commit 6cb31d7

Browse files
committed
new release
1 parent 9c8ab64 commit 6cb31d7

9 files changed

Lines changed: 79 additions & 7 deletions

File tree

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,8 @@ To upgrade the Auto Upgrader when a new release has been deployed, you can run
160160
./scripts/auto_upgrader/auto_upgrader_upgrade.sh
161161
```
162162

163+
Use `-h` to see the options
164+
163165
<br />
164166

165167
# 🛠️ Installation <a id="installation"></a>

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.0.1
1+
0.0.2

scripts/auto_upgrader/auto_upgrader_upgrade.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ setup_process() {
6666
echo "⚙️ Setting up for 'process' mode..."
6767

6868
# Upgrade the auto upgrader as process
69-
./subvortex/auto_upgrader/deployment/proecss/auto_upgrader_process_upgrade.sh
69+
./subvortex/auto_upgrader/deployment/process/auto_upgrader_process_upgrade.sh
7070

7171
# Add any other logic specific to process mode here
7272
echo "✅ Process started."

subvortex/auto_upgrader/deployment/container/auto_upgrader_container_upgrade.sh

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,47 @@
22

33
set -e
44

5+
SERVICE_NAME=auto_upgrader
6+
57
# Determine script directory dynamically to ensure everything runs in ./scripts/api/
68
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
79
cd "$SCRIPT_DIR/../.."
810

11+
# Track whether we stashed anything
12+
STASHED=0
13+
14+
# Check for uncommitted changes
15+
if ! git diff --quiet || ! git diff --cached --quiet; then
16+
echo "📦 Stashing local changes..."
17+
git stash push -u -m "Auto stash before pull"
18+
STASHED=1
19+
fi
20+
21+
# Check if branch is tracking a remote
22+
BRANCH=$(git rev-parse --abbrev-ref HEAD)
23+
UPSTREAM=$(git rev-parse --abbrev-ref "$BRANCH@{upstream}" 2>/dev/null || true)
24+
25+
if [[ -z "$UPSTREAM" ]]; then
26+
echo "❌ Branch '$BRANCH' is not tracking any remote branch. Cannot pull safely."
27+
exit 1
28+
fi
29+
30+
# Pull latest changes from upstream
31+
echo "🔄 Pulling latest changes from $UPSTREAM..."
32+
if ! git pull --ff-only; then
33+
echo "⚠️ Fast-forward pull failed. Trying forced sync with origin/$BRANCH..."
34+
git fetch origin
35+
git reset --hard origin/"$BRANCH"
36+
fi
37+
38+
# Restore stashed changes if we made one
39+
if [[ "$STASHED" -eq 1 ]]; then
40+
echo "🧵 Restoring stashed local changes..."
41+
git stash pop || {
42+
echo "⚠️ Conflicts while restoring stash. You may need to resolve manually."
43+
}
44+
fi
45+
946
# Load environment variables
1047
export $(grep -v '^#' .env | xargs)
1148

subvortex/auto_upgrader/deployment/process/auto_upgrader_process_upgrade.sh

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,14 @@ SERVICE_NAME=subvortex-auto-upgrader
88
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
99
cd "$SCRIPT_DIR/../.."
1010

11+
# Track whether we stashed anything
12+
STASHED=0
13+
1114
# Check for uncommitted changes
1215
if ! git diff --quiet || ! git diff --cached --quiet; then
1316
echo "📦 Stashing local changes..."
1417
git stash push -u -m "Auto stash before pull"
18+
STASHED=1
1519
fi
1620

1721
# Check if branch is tracking a remote
@@ -25,7 +29,19 @@ fi
2529

2630
# Pull latest changes from upstream
2731
echo "🔄 Pulling latest changes from $UPSTREAM..."
28-
git pull --ff-only
32+
if ! git pull --ff-only; then
33+
echo "⚠️ Fast-forward pull failed. Trying forced sync with origin/$BRANCH..."
34+
git fetch origin
35+
git reset --hard origin/"$BRANCH"
36+
fi
37+
38+
# Restore stashed changes if we made one
39+
if [[ "$STASHED" -eq 1 ]]; then
40+
echo "🧵 Restoring stashed local changes..."
41+
git stash pop || {
42+
echo "⚠️ Conflicts while restoring stash. You may need to resolve manually."
43+
}
44+
fi
2945

3046
# Install python if not already done
3147
if ! command -v python3 &> /dev/null; then
@@ -55,6 +71,7 @@ pip install ".[$SUBVORTEX_EXECUTION_ROLE]"
5571
# Install SubVortex in Editable Mode
5672
pip install -e ../../
5773

74+
# Start or restart the process
5875
if pm2 list | grep -qw "$SERVICE_NAME"; then
5976
echo "🔄 Restarting PM2 service: $SERVICE_NAME"
6077
pm2 restart "$SERVICE_NAME"

subvortex/auto_upgrader/deployment/service/auto_upgrader_service_upgrade.sh

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,14 @@ SERVICE_NAME=subvortex-auto-upgrader
88
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
99
cd "$SCRIPT_DIR/../.."
1010

11+
# Track whether we stashed anything
12+
STASHED=0
13+
1114
# Check for uncommitted changes
1215
if ! git diff --quiet || ! git diff --cached --quiet; then
1316
echo "📦 Stashing local changes..."
1417
git stash push -u -m "Auto stash before pull"
18+
STASHED=1
1519
fi
1620

1721
# Check if branch is tracking a remote
@@ -25,7 +29,19 @@ fi
2529

2630
# Pull latest changes from upstream
2731
echo "🔄 Pulling latest changes from $UPSTREAM..."
28-
git pull --ff-only
32+
if ! git pull --ff-only; then
33+
echo "⚠️ Fast-forward pull failed. Trying forced sync with origin/$BRANCH..."
34+
git fetch origin
35+
git reset --hard origin/"$BRANCH"
36+
fi
37+
38+
# Restore stashed changes if we made one
39+
if [[ "$STASHED" -eq 1 ]]; then
40+
echo "🧵 Restoring stashed local changes..."
41+
git stash pop || {
42+
echo "⚠️ Conflicts while restoring stash. You may need to resolve manually."
43+
}
44+
fi
2945

3046
# Install python if not already done
3147
if ! command -v python3 &> /dev/null; then

subvortex/auto_upgrader/entrypoint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ while IFS= read -r line; do
2222
done < <(env)
2323

2424
if [ $# -eq 0 ]; then
25-
python ./subvortex/auto_upgrade/src/main.py \
25+
python ./subvortex/auto_upgrader/src/main.py \
2626
"${ARGS[@]}"
2727
else
2828
exec "$@"

subvortex/auto_upgrader/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "subvortex-auto-upgrader"
7-
version = "0.0.1"
7+
version = "0.0.2"
88
description = "SubVortex Auto Upgrader"
99
authors = [{ name = "Eclipse Vortex", email = "subvortex.bt@gmail.com" }]
1010
readme = "README.md"

subvortex/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "0.0.1"
1+
__version__ = "0.0.2"

0 commit comments

Comments
 (0)