diff --git a/docs/sources/plugins/installation.md b/docs/sources/plugins/installation.md index 0dada8b69a7..c83a54bdce3 100644 --- a/docs/sources/plugins/installation.md +++ b/docs/sources/plugins/installation.md @@ -28,14 +28,14 @@ List installed plugins grafana-cli plugins ls ``` -Upgrade all installed plugins +Update all installed plugins ``` -grafana-cli plugins upgrade-all +grafana-cli plugins update-all ``` -Upgrade one plugin +Update one plugin ``` -grafana-cli plugins upgrade +grafana-cli plugins update ``` Remove one plugin diff --git a/latest.json b/latest.json index 79eb42a8527..b4ffb38bab9 100644 --- a/latest.json +++ b/latest.json @@ -1,3 +1,4 @@ { - "version": "2.1.1" + "stable": "2.6.0", + "testing": "3.0.0" } diff --git a/pkg/cmd/grafana-cli/commands/commands.go b/pkg/cmd/grafana-cli/commands/commands.go index 2e0c395727b..b3821a47844 100644 --- a/pkg/cmd/grafana-cli/commands/commands.go +++ b/pkg/cmd/grafana-cli/commands/commands.go @@ -1,9 +1,10 @@ package commands import ( + "os" + "github.com/codegangsta/cli" "github.com/grafana/grafana/pkg/cmd/grafana-cli/log" - "os" ) func runCommand(command func(commandLine CommandLine) error) func(context *cli.Context) { @@ -32,13 +33,15 @@ var pluginCommands = []cli.Command{ Usage: "list remote available plugins", Action: runCommand(listremoteCommand), }, { - Name: "upgrade", - Usage: "upgrade ", - Action: runCommand(upgradeCommand), + Name: "update", + Usage: "update ", + Aliases: []string{"upgrade"}, + Action: runCommand(upgradeCommand), }, { - Name: "upgrade-all", - Usage: "upgrades all your installed plugins", - Action: runCommand(upgradeAllCommand), + Name: "update-all", + Aliases: []string{"upgrade-all"}, + Usage: "update all your installed plugins", + Action: runCommand(upgradeAllCommand), }, { Name: "ls", Usage: "list all installed plugins", diff --git a/pkg/cmd/grafana-cli/commands/upgrade_all_command.go b/pkg/cmd/grafana-cli/commands/upgrade_all_command.go index e805e8e6f34..7f088be3e14 100644 --- a/pkg/cmd/grafana-cli/commands/upgrade_all_command.go +++ b/pkg/cmd/grafana-cli/commands/upgrade_all_command.go @@ -51,7 +51,7 @@ func upgradeAllCommand(c CommandLine) error { } for _, p := range pluginsToUpgrade { - log.Infof("Upgrading %v \n", p.Id) + log.Infof("Updating %v \n", p.Id) s.RemoveInstalledPlugin(pluginsDir, p.Id) InstallPlugin(p.Id, "", c) diff --git a/pkg/cmd/grafana-cli/main.go b/pkg/cmd/grafana-cli/main.go index 5cc3fb6f306..6af55e6177c 100644 --- a/pkg/cmd/grafana-cli/main.go +++ b/pkg/cmd/grafana-cli/main.go @@ -8,7 +8,6 @@ import ( "github.com/codegangsta/cli" "github.com/grafana/grafana/pkg/cmd/grafana-cli/commands" "github.com/grafana/grafana/pkg/cmd/grafana-cli/log" - "strings" ) var version = "master" @@ -18,7 +17,7 @@ func getGrafanaPluginDir() string { defaultNix := "/var/lib/grafana/plugins" if currentOS == "windows" { - return "C:\\opt\\grafana\\plugins" + return "..\\data\\plugins" } pwd, err := os.Getwd() @@ -29,16 +28,16 @@ func getGrafanaPluginDir() string { } if isDevenvironment(pwd) { - return "../../../data/plugins" + return "../data/plugins" } return defaultNix } func isDevenvironment(pwd string) bool { - // if grafana-cli is executed from the cmd folder we can assume - // that its in development environment. - return strings.HasSuffix(pwd, "/pkg/cmd/grafana-cli") + // if ../conf/default.ini exists, grafana is not installed as package + _, err := os.Stat("../conf/default.ini") + return err != nil } func main() {