Skip to content

Commit 6f4cad9

Browse files
committed
feat: add development mode for AI plugin building
Add dev-build-ai-plugin and dev-run-server targets to support development workflow with latest plugin changes. - dev-build-ai-plugin: builds latest plugin and backs up system version - dev-restore-ai-plugin: restores original system version - dev-run-server: runs server with development plugin version This solves the issue where system cached plugins from ghcr.io override local development changes.
1 parent 41d63ef commit 6f4cad9

File tree

1 file changed

+34
-1
lines changed

1 file changed

+34
-1
lines changed

tools/make/run.mk

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,46 @@ build-ai-plugin:
1919
elif [ -d "$(AI_PLUGIN_DIR)" ]; then \
2020
echo "🔨 Building AI plugin from source..."; \
2121
cd $(AI_PLUGIN_DIR) && make build; \
22+
mkdir -p bin; \
23+
cp $(AI_PLUGIN_DIR)/bin/atest-ext-ai bin/; \
2224
echo "✅ AI plugin built from source"; \
2325
else \
2426
echo "⚠️ AI plugin directory not found, skipping"; \
2527
fi
2628

29+
.PHONY: dev-build-ai-plugin
30+
dev-build-ai-plugin:
31+
@echo "🔧 Building AI plugin for development..."
32+
@if [ -d "$(AI_PLUGIN_DIR)" ]; then \
33+
cd $(AI_PLUGIN_DIR) && make build; \
34+
mkdir -p bin; \
35+
cp $(AI_PLUGIN_DIR)/bin/atest-ext-ai bin/; \
36+
if [ -f ~/.config/atest/bin/atest-ext-ai ]; then \
37+
mv ~/.config/atest/bin/atest-ext-ai ~/.config/atest/bin/atest-ext-ai.backup; \
38+
echo "✅ Backed up system version, now using development version"; \
39+
else \
40+
echo "ℹ️ No system version found, using development version"; \
41+
fi; \
42+
else \
43+
echo "❌ AI plugin directory not found"; \
44+
fi
45+
46+
.PHONY: dev-restore-ai-plugin
47+
dev-restore-ai-plugin:
48+
@echo "🔄 Restoring system AI plugin..."
49+
@if [ -f ~/.config/atest/bin/atest-ext-ai.backup ]; then \
50+
mv ~/.config/atest/bin/atest-ext-ai.backup ~/.config/atest/bin/atest-ext-ai; \
51+
echo "✅ System version restored"; \
52+
else \
53+
echo "ℹ️ No backup found to restore"; \
54+
fi
55+
56+
.PHONY: dev-run-server
57+
dev-run-server: ## Run server in development mode with latest AI plugin
58+
dev-run-server: build-ui dev-build-ai-plugin run-backend
59+
2760
.PHONY: run-server
28-
run-server: ## Run the API Testing server
61+
run-server: ## Run the API Testing server (production mode)
2962
run-server: build-ui build-ai-plugin run-backend
3063
run-backend:
3164
go run . server --local-storage 'bin/*.yaml' --console-path ${ATEST_UI}/dist \

0 commit comments

Comments
 (0)