CI: Build pre-release artifacts in GhA on merge to release branches and main. (#106779)
* Add grafana-build action and workflow * Fix the --verify flag stalling on tar.gz builds * Add event sources for main / release branches * Update CODEOWNERS
This commit is contained in:
@@ -29,6 +29,7 @@ type MSI struct {
|
||||
BuildID string
|
||||
Distribution backend.Distribution
|
||||
Enterprise bool
|
||||
Grafana *dagger.Directory
|
||||
|
||||
Tarball *pipeline.Artifact
|
||||
}
|
||||
@@ -40,7 +41,7 @@ func (d *MSI) Dependencies(ctx context.Context) ([]*pipeline.Artifact, error) {
|
||||
}
|
||||
|
||||
func (d *MSI) Builder(ctx context.Context, opts *pipeline.ArtifactContainerOpts) (*dagger.Container, error) {
|
||||
return msi.Builder(opts.Client)
|
||||
return msi.Builder(opts.Client, d.Grafana), nil
|
||||
}
|
||||
|
||||
func (d *MSI) BuildFile(ctx context.Context, builder *dagger.Container, opts *pipeline.ArtifactContainerOpts) (*dagger.File, error) {
|
||||
@@ -105,6 +106,11 @@ func NewMSIFromString(ctx context.Context, log *slog.Logger, artifact string, st
|
||||
return nil, fmt.Errorf("distribution ('%s') for exe '%s' is not a Windows distribution", string(p.Distribution), artifact)
|
||||
}
|
||||
|
||||
src, err := GrafanaDir(ctx, state, p.Enterprise)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return pipeline.ArtifactWithLogging(ctx, log, &pipeline.Artifact{
|
||||
ArtifactString: artifact,
|
||||
Handler: &MSI{
|
||||
@@ -114,6 +120,7 @@ func NewMSIFromString(ctx context.Context, log *slog.Logger, artifact string, st
|
||||
Distribution: p.Distribution,
|
||||
Enterprise: p.Enterprise,
|
||||
Tarball: targz,
|
||||
Grafana: src,
|
||||
},
|
||||
Type: pipeline.ArtifactTypeFile,
|
||||
Flags: ZipFlags,
|
||||
|
||||
@@ -363,19 +363,23 @@ func verifyTarball(
|
||||
Platform: platform,
|
||||
}).From("ubuntu:22.04").
|
||||
WithExec([]string{"apt-get", "update", "-yq"}).
|
||||
WithExec([]string{"apt-get", "install", "-yq", "ca-certificates", "libfontconfig1"}).
|
||||
WithExec([]string{"apt-get", "install", "-yq", "ca-certificates"}).
|
||||
WithDirectory("/src", archive).
|
||||
WithMountedTemp("/tmp").
|
||||
WithWorkdir("/src")
|
||||
|
||||
if err := e2e.ValidateLicense(ctx, service, "/src/LICENSE", enterprise); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
service = service.
|
||||
WithExec([]string{"./bin/grafana", "server"}).
|
||||
WithExposedPort(3000)
|
||||
svc := service.
|
||||
WithEnvVariable("GF_PATHS_PLUGINS", "/tmp").
|
||||
WithEnvVariable("GF_LOG_LEVEL", "error").
|
||||
WithExposedPort(3000).AsService(dagger.ContainerAsServiceOpts{
|
||||
Args: []string{"./bin/grafana", "server"},
|
||||
})
|
||||
|
||||
if _, err := containers.ExitError(ctx, e2e.ValidatePackage(d, service.AsService(), src, yarnCache, nodeVersion)); err != nil {
|
||||
if _, err := containers.ExitError(ctx, e2e.ValidatePackage(d, svc, src, yarnCache, nodeVersion)); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user