Skip to content

Commit 9d8e2fc

Browse files
committed
refactor: Improve frontend submodule synchronization logic and ensure proper initialization
1 parent b5ee6b6 commit 9d8e2fc

1 file changed

Lines changed: 15 additions & 15 deletions

File tree

deployment/build/production-build.sh

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,27 @@ set -e
44
MCP_SERVERS_JAR_PATH="java-ecosystem/mcp-servers/vcs-mcp/target/codecrow-vcs-mcp-1.0.jar"
55
PLATFORM_MCP_JAR_PATH="java-ecosystem/mcp-servers/platform-mcp/target/codecrow-platform-mcp-1.0.jar"
66
FRONTEND_DIR="frontend"
7-
FRONTEND_BRANCH="${FRONTEND_BRANCH:-main}"
7+
FRONTEND_BRANCH="main"
88
JAVA_DIR="java-ecosystem"
99
DOCKER_PATH="deployment"
1010
CONFIG_PATH="deployment/config"
1111

1212
cd "$(dirname "$0")/../../"
1313

14-
# echo "--- 1. Ensuring frontend submodule is synchronized ---"
15-
# if [ -d "$FRONTEND_DIR" ] && [ ! -f "$FRONTEND_DIR/.git" ]; then
16-
# echo "Stale frontend directory detected (not a submodule). Removing and re-initializing..."
17-
# rm -rf "$FRONTEND_DIR"
18-
# git submodule update --init -- "$FRONTEND_DIR"
19-
# elif [ ! -d "$FRONTEND_DIR" ]; then
20-
# echo "Initializing frontend submodule..."
21-
# git submodule update --init -- "$FRONTEND_DIR"
22-
# else
23-
# echo "Frontend submodule exists."
24-
# fi
25-
# echo "Fetching latest from origin and resetting to origin/$FRONTEND_BRANCH..."
26-
# (cd "$FRONTEND_DIR" && git fetch origin "$FRONTEND_BRANCH" && git reset --hard "origin/$FRONTEND_BRANCH")
27-
# echo "Frontend at: $(cd "$FRONTEND_DIR" && git log --oneline -1)"
14+
echo "--- 1. Ensuring frontend submodule is synchronized ---"
15+
if [ -d "$FRONTEND_DIR" ] && [ ! -f "$FRONTEND_DIR/.git" ]; then
16+
echo "Stale frontend directory detected (not a submodule). Removing and re-initializing..."
17+
rm -rf "$FRONTEND_DIR"
18+
git submodule update --init -- "$FRONTEND_DIR"
19+
elif [ ! -d "$FRONTEND_DIR" ]; then
20+
echo "Initializing frontend submodule..."
21+
git submodule update --init -- "$FRONTEND_DIR"
22+
else
23+
echo "Frontend submodule exists."
24+
fi
25+
echo "Fetching latest from origin and resetting to origin/$FRONTEND_BRANCH..."
26+
(cd "$FRONTEND_DIR" && git fetch origin "$FRONTEND_BRANCH" && git reset --hard "origin/$FRONTEND_BRANCH")
27+
echo "Frontend at: $(cd "$FRONTEND_DIR" && git log --oneline -1)"
2828

2929
echo "--- 2. Injecting Environment Configurations ---"
3030

0 commit comments

Comments
 (0)