[9.4.x] CI: Allow other modules to register build sub-commands (PR #62741) (#62774)

CI: Allow other modules to register build sub-commands (#62741)

* Allow other modules to register build sub-commands

* CI: Fix retries on artifacts-page clone

* Fix linting errors

* Fix golint issues

* Update to grabpl 3.0.21

(cherry picked from commit 312ea59e6d)
This commit is contained in:
Horst Gutmann
2023-02-02 15:14:41 +01:00
committed by GitHub
parent a03069fb08
commit 5b305cb696
5 changed files with 102 additions and 59 deletions
+4
View File
@@ -52,4 +52,8 @@ var (
EnvVars: []string{"GITHUB_TOKEN"},
Usage: "GitHub token",
}
tagFlag = cli.StringFlag{
Name: "tag",
Usage: "Grafana version tag",
}
)
+12 -12
View File
@@ -9,6 +9,13 @@ import (
"github.com/urfave/cli/v2"
)
var additionalCommands []*cli.Command = make([]*cli.Command, 0, 5)
//nolint:unused
func registerAppCommand(c *cli.Command) {
additionalCommands = append(additionalCommands, c)
}
func main() {
app := cli.NewApp()
app.Commands = cli.Commands{
@@ -279,10 +286,7 @@ func main() {
ArgsUsage: "[version]",
Action: NpmReleaseAction,
Flags: []cli.Flag{
&cli.StringFlag{
Name: "tag",
Usage: "Grafana version tag",
},
&tagFlag,
},
},
{
@@ -290,10 +294,7 @@ func main() {
Usage: "Store npm packages tarball",
Action: NpmStoreAction,
Flags: []cli.Flag{
&cli.StringFlag{
Name: "tag",
Usage: "Grafana version tag",
},
&tagFlag,
},
},
{
@@ -301,10 +302,7 @@ func main() {
Usage: "Retrieve npm packages tarball",
Action: NpmRetrieveAction,
Flags: []cli.Flag{
&cli.StringFlag{
Name: "tag",
Usage: "Grafana version tag",
},
&tagFlag,
},
},
},
@@ -416,6 +414,8 @@ func main() {
},
}
app.Commands = append(app.Commands, additionalCommands...)
if err := app.Run(os.Args); err != nil {
log.Fatalln(err)
}