[v11.3.x] CI: Additional changes for +security versions (#94923)
CI: Additional changes for +security versions (#94854)
* Build: Fix docker manifest create not using correct IMAGE_TAG
* Support publishing security versions of NPM packages
---------
Co-authored-by: Andreas Christou <andreas.christou@grafana.com>
Co-authored-by: Kevin Minehart <kmineh0151@gmail.com>
Co-authored-by: Diego Augusto Molina <diegoaugustomolina@gmail.com>
(cherry picked from commit 8f7352e862)
Co-authored-by: Josh Hunt <joshhunt@users.noreply.github.com>
This commit is contained in:
co-authored by
Josh Hunt
parent
efeb05386b
commit
a577031ba9
@@ -145,6 +145,9 @@ func Builds(baseURL *url.URL, grafana, version string, packages []packaging.Buil
|
||||
if arch == "aarch64" {
|
||||
arch = "arm64"
|
||||
}
|
||||
if arch == "x86_64" {
|
||||
arch = "amd64"
|
||||
}
|
||||
}
|
||||
|
||||
if v.Distro == "deb" {
|
||||
|
||||
@@ -2,6 +2,7 @@ package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"log"
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
@@ -23,6 +24,11 @@ func NpmRetrieveAction(c *cli.Context) error {
|
||||
return fmt.Errorf("no tag version specified, exitting")
|
||||
}
|
||||
|
||||
if strings.Contains(tag, "security") {
|
||||
log.Printf("skipping npm publish because version '%s' has 'security'", tag)
|
||||
return nil
|
||||
}
|
||||
|
||||
prereleaseBucket := strings.TrimSpace(os.Getenv("PRERELEASE_BUCKET"))
|
||||
if prereleaseBucket == "" {
|
||||
return cli.Exit("the environment variable PRERELEASE_BUCKET must be set", 1)
|
||||
@@ -48,6 +54,11 @@ func NpmStoreAction(c *cli.Context) error {
|
||||
return fmt.Errorf("no tag version specified, exiting")
|
||||
}
|
||||
|
||||
if strings.Contains(tag, "security") {
|
||||
log.Printf("skipping npm publish because version '%s' has 'security'", tag)
|
||||
return nil
|
||||
}
|
||||
|
||||
prereleaseBucket := strings.TrimSpace(os.Getenv("PRERELEASE_BUCKET"))
|
||||
if prereleaseBucket == "" {
|
||||
return cli.Exit("the environment variable PRERELEASE_BUCKET must be set", 1)
|
||||
@@ -73,6 +84,11 @@ func NpmReleaseAction(c *cli.Context) error {
|
||||
return fmt.Errorf("no tag version specified, exitting")
|
||||
}
|
||||
|
||||
if strings.Contains(tag, "security") {
|
||||
log.Printf("skipping npm publish because version '%s' has 'security'", tag)
|
||||
return nil
|
||||
}
|
||||
|
||||
err := npm.PublishNpmPackages(c.Context, tag)
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
@@ -113,6 +113,16 @@ var ARMArtifacts = []BuildArtifact{
|
||||
Arch: "armv7",
|
||||
Ext: "tar.gz",
|
||||
},
|
||||
{
|
||||
Distro: "linux",
|
||||
Arch: "arm64",
|
||||
Ext: "tar.gz",
|
||||
},
|
||||
{
|
||||
Distro: "linux",
|
||||
Arch: "amd64",
|
||||
Ext: "tar.gz",
|
||||
},
|
||||
}
|
||||
|
||||
func join(a []BuildArtifact, b ...[]BuildArtifact) []BuildArtifact {
|
||||
|
||||
@@ -13,15 +13,17 @@ import (
|
||||
)
|
||||
|
||||
var (
|
||||
reGrafanaTag = regexp.MustCompile(`^v(\d+\.\d+\.\d+$)`)
|
||||
reGrafanaTagPreview = regexp.MustCompile(`^v(\d+\.\d+\.\d+-preview)`)
|
||||
reGrafanaTagCustom = regexp.MustCompile(`^v(\d+\.\d+\.\d+-\w+)`)
|
||||
reGrafanaTag = regexp.MustCompile(`^v(\d+\.\d+\.\d+$)`)
|
||||
reGrafanaTagPreview = regexp.MustCompile(`^v(\d+\.\d+\.\d+-preview)`)
|
||||
reGrafanaTagCustom = regexp.MustCompile(`^v(\d+\.\d+\.\d+-\w+)`)
|
||||
reGrafanaTagSecurity = regexp.MustCompile(`^v(\d+\.\d+\.\d+\+\w+\-\d+)`)
|
||||
)
|
||||
|
||||
const (
|
||||
Latest = "latest"
|
||||
Next = "next"
|
||||
Test = "test"
|
||||
Latest = "latest"
|
||||
Next = "next"
|
||||
Test = "test"
|
||||
Security = "security"
|
||||
)
|
||||
|
||||
type Version struct {
|
||||
@@ -152,6 +154,11 @@ func GetVersion(tag string) (*Version, error) {
|
||||
Version: reGrafanaTagCustom.FindStringSubmatch(tag)[1],
|
||||
Channel: Test,
|
||||
}
|
||||
case reGrafanaTagSecurity.MatchString(tag):
|
||||
version = Version{
|
||||
Version: reGrafanaTagSecurity.FindStringSubmatch(tag)[1],
|
||||
Channel: Security,
|
||||
}
|
||||
default:
|
||||
return nil, fmt.Errorf("%s not a supported Grafana version, exitting", tag)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user