CI: move grafana-build into pkg/build (#105640)
* move grafana-build into pkg/build
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
package flags
|
||||
|
||||
import (
|
||||
"runtime"
|
||||
|
||||
"github.com/urfave/cli/v2"
|
||||
)
|
||||
|
||||
var ConcurrencyFlags = []cli.Flag{
|
||||
&cli.Int64Flag{
|
||||
Name: "parallel",
|
||||
Usage: "The number of parallel pipelines to run. This can be particularly useful for building for multiple distributions at the same time",
|
||||
DefaultText: "Just like with 'go test', this defaults to GOMAXPROCS",
|
||||
Value: int64(runtime.GOMAXPROCS(0)),
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package flags
|
||||
|
||||
import "github.com/urfave/cli/v2"
|
||||
|
||||
var Verbose = &cli.BoolFlag{
|
||||
Name: "verbose",
|
||||
Aliases: []string{"v"},
|
||||
Usage: "Increase log verbosity. WARNING: This setting could potentially log sensitive data",
|
||||
Value: false,
|
||||
}
|
||||
|
||||
var DefaultFlags = []cli.Flag{
|
||||
Platform,
|
||||
Verbose,
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package flags
|
||||
|
||||
// DefaultDistros are distributions that can quickly be built in an ideal scenario for the operating system on the above build tag.
|
||||
var DefaultDistros = []string{"linux/amd64"}
|
||||
|
||||
// DefaultPlatform is the docker platform that will natively / most efficiently run on the OS/arch filtered by the above tag.
|
||||
var DefaultPlatform = "linux/amd64"
|
||||
@@ -0,0 +1,7 @@
|
||||
package flags
|
||||
|
||||
// DefaultDistros are distributions that can quickly be built in an ideal scenario for the operating system on the above build tag.
|
||||
var DefaultDistros = []string{"linux/arm64"}
|
||||
|
||||
// DefaultPlatform is the docker platform that will natively / most efficiently run on the OS/arch filtered by the above tag.
|
||||
var DefaultPlatform = "linux/arm64"
|
||||
@@ -0,0 +1,7 @@
|
||||
package flags
|
||||
|
||||
// DefaultDistros are distributions that can quickly be built in an ideal scenario for the operating system on the above build tag.
|
||||
var DefaultDistros = []string{"linux/amd64"}
|
||||
|
||||
// DefaultPlatform is the docker platform that will natively / most efficiently run on the OS/arch filtered by the above tag.
|
||||
var DefaultPlatform = "linux/amd64"
|
||||
@@ -0,0 +1,7 @@
|
||||
package flags
|
||||
|
||||
// DefaultDistros are distributions that can quickly be built in an ideal scenario for the operating system on the above build tag.
|
||||
var DefaultDistros = []string{"linux/arm64"}
|
||||
|
||||
// DefaultPlatform is the docker platform that will natively / most efficiently run on the OS/arch filtered by the above tag.
|
||||
var DefaultPlatform = "linux/arm64"
|
||||
@@ -0,0 +1,7 @@
|
||||
package flags
|
||||
|
||||
// DefaultDistros are distributions that can quickly be built in an ideal scenario for the operating system on the above build tag.
|
||||
var DefaultDistros = []string{"linux/amd64"}
|
||||
|
||||
// DefaultPlatform is the docker platform that will natively / most efficiently run on the OS/arch filtered by the above tag.
|
||||
var DefaultPlatform = "linux/amd64"
|
||||
@@ -0,0 +1,7 @@
|
||||
package flags
|
||||
|
||||
// DefaultDistros are distributions that can quickly be built in an ideal scenario for the operating system on the above build tag.
|
||||
var DefaultDistros = []string{"linux/arm64"}
|
||||
|
||||
// DefaultPlatform is the docker platform that will natively / most efficiently run on the OS/arch filtered by the above tag.
|
||||
var DefaultPlatform = "linux/arm64"
|
||||
@@ -0,0 +1,12 @@
|
||||
package flags
|
||||
|
||||
import "github.com/urfave/cli/v2"
|
||||
|
||||
func Join(f ...[]cli.Flag) []cli.Flag {
|
||||
flags := []cli.Flag{}
|
||||
for _, v := range f {
|
||||
flags = append(flags, v...)
|
||||
}
|
||||
|
||||
return flags
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package flags
|
||||
|
||||
import "github.com/urfave/cli/v2"
|
||||
|
||||
var Platform = &cli.StringFlag{
|
||||
Name: "platform",
|
||||
Usage: "The buildkit / dagger platform to run containers when building the backend",
|
||||
Value: DefaultPlatform,
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package flags
|
||||
|
||||
import "github.com/urfave/cli/v2"
|
||||
|
||||
var PublishFlags = []cli.Flag{
|
||||
&cli.StringFlag{
|
||||
Name: "destination",
|
||||
Usage: "full URL to upload the artifacts to (examples: '/tmp/package.tar.gz', 'file://package.tar.gz', 'file:///tmp/package.tar.gz', 'gs://bucket/grafana/')",
|
||||
Aliases: []string{"d"},
|
||||
Value: "dist",
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "checksum",
|
||||
Usage: "When enabled, also creates a `.sha256' checksum file in the destination that matches the checksum of the artifact(s) produced",
|
||||
},
|
||||
}
|
||||
Reference in New Issue
Block a user