Add deploy command to upload and enable plugin bundles

- New deploy.go implements RunDeployCommand function
- Auto-discovers plugin bundle from ./dist/ folder based on manifest
- Supports --bundle-path flag for custom bundle location
- Reuses existing client connection logic for server authentication
- Updated main.go to register deploy command and add help documentation
- Follows existing patterns for error handling and structured logging

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Felipe M 2025-07-14 19:17:25 +02:00
parent 6639dad2d6
commit 278958d1e4
No known key found for this signature in database
GPG key ID: 52E5D65FCF99808A
3 changed files with 108 additions and 1 deletions

View file

@ -52,6 +52,8 @@ func runCommand(command string, args []string, pluginPath string) error {
return runDisableCommand(args, pluginPath)
case "reset":
return runResetCommand(args, pluginPath)
case "deploy":
return runDeployCommand(args, pluginPath)
case "updateassets":
return runUpdateAssetsCommand(args, pluginPath)
case "manifest":
@ -103,6 +105,10 @@ func runLogsCommand(args []string, pluginPath string) error {
return pluginctl.RunLogsCommand(args, pluginPath)
}
func runDeployCommand(args []string, pluginPath string) error {
return pluginctl.RunDeployCommand(args, pluginPath)
}
func showUsage() {
usageText := `pluginctl - Mattermost Plugin Development CLI
@ -117,6 +123,7 @@ Commands:
enable Enable plugin from current directory in Mattermost server
disable Disable plugin from current directory in Mattermost server
reset Reset plugin from current directory (disable then enable)
deploy Upload and enable plugin bundle to Mattermost server
updateassets Update plugin files from embedded assets
manifest Get plugin manifest information (id, version, has_server, has_webapp, check)
logs View plugin logs (use --watch to follow logs in real-time)
@ -129,6 +136,8 @@ Examples:
pluginctl enable # Enable plugin from current directory
pluginctl disable # Disable plugin from current directory
pluginctl reset # Reset plugin from current directory (disable then enable)
pluginctl deploy # Upload and enable plugin bundle from ./dist/
pluginctl deploy --bundle-path ./bundle.tar.gz # Deploy specific bundle file
pluginctl updateassets # Update plugin files from embedded assets
pluginctl manifest id # Get plugin ID
pluginctl manifest version # Get plugin version