forked from open-telemetry/opentelemetry-collector-releases
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "test: run linux package tests nightly against latest contrib …
…main (open-telemetry#666)" (open-telemetry#761) This reverts commit 1271690.
- Loading branch information
1 parent
3ae3def
commit a61f843
Showing
12 changed files
with
58 additions
and
233 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -92,4 +92,4 @@ delete-tags: | |
# Used for debug only | ||
REMOTE?[email protected]:open-telemetry/opentelemetry-collector-releases.git | ||
.PHONY: repeat-tags | ||
repeat-tags: delete-tags push-tags | ||
repeat-tags: delete-tags push-tags |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,32 +42,22 @@ const ( | |
var ( | ||
ImagePrefixes = []string{DockerHub, GHCR} | ||
Architectures = []string{"386", "amd64", "arm", "arm64", "ppc64le", "s390x"} | ||
ArmVersions = []string{"7"} | ||
DefaultConfigDists = map[string]bool{CoreDistro: true, ContribDistro: true} | ||
MSIWindowsDists = map[string]bool{CoreDistro: true, ContribDistro: true, OTLPDistro: true} | ||
K8sDockerSkipArchs = map[string]bool{"arm": true, "386": true} | ||
K8sGoos = []string{"linux"} | ||
K8sArchs = []string{"amd64", "arm64", "ppc64le", "s390x"} | ||
) | ||
|
||
func GenerateContribBuildOnly(dist string, buildOrRest bool) config.Project { | ||
return config.Project{ | ||
ProjectName: "opentelemetry-collector-releases", | ||
Builds: Builds(dist, buildOrRest), | ||
Version: 2, | ||
Monorepo: config.Monorepo{ | ||
TagPrefix: "v", | ||
}, | ||
} | ||
} | ||
|
||
func Generate(dist string, buildOrRest bool) config.Project { | ||
func Generate(dist string) config.Project { | ||
return config.Project{ | ||
ProjectName: "opentelemetry-collector-releases", | ||
Checksum: config.Checksum{ | ||
NameTemplate: fmt.Sprintf("{{ .ProjectName }}_%v_checksums.txt", dist), | ||
}, | ||
Env: []string{"COSIGN_YES=true"}, | ||
Builds: Builds(dist, buildOrRest), | ||
Builds: Builds(dist), | ||
Archives: Archives(dist), | ||
MSI: WinPackages(dist), | ||
NFPMs: Packages(dist), | ||
|
@@ -83,41 +73,37 @@ func Generate(dist string, buildOrRest bool) config.Project { | |
} | ||
} | ||
|
||
func Builds(dist string, buildOrRest bool) []config.Build { | ||
func Builds(dist string) []config.Build { | ||
return []config.Build{ | ||
Build(dist, buildOrRest), | ||
Build(dist), | ||
} | ||
} | ||
|
||
// Build configures a goreleaser build. | ||
// https://goreleaser.com/customization/build/ | ||
func Build(dist string, buildOrRest bool) config.Build { | ||
goos := []string{"darwin", "linux", "windows"} | ||
archs := Architectures | ||
|
||
if dist == ContribDistro && !buildOrRest { | ||
// only return build config for contrib build file | ||
return config.Build{ | ||
ID: dist, | ||
Builder: "prebuilt", | ||
PreBuilt: config.PreBuiltOptions{ | ||
Path: "artifacts/otelcol-contrib_{{ .Target }}" + | ||
"/otelcol-contrib{{- if eq .Os \"windows\" }}.exe{{ end }}", | ||
}, | ||
Goos: goos, | ||
Goarch: archs, | ||
Goarm: ArmVersions(dist), | ||
Dir: "_build", | ||
Binary: dist, | ||
Ignore: IgnoreBuildCombinations(dist), | ||
} | ||
} | ||
|
||
func Build(dist string) config.Build { | ||
var goos []string | ||
var archs []string | ||
var ignore []config.IgnoredBuild | ||
var armVersions []string | ||
if dist == K8sDistro { | ||
goos = K8sGoos | ||
archs = K8sArchs | ||
ignore = make([]config.IgnoredBuild, 0) | ||
armVersions = make([]string, 0) | ||
} else { | ||
goos = []string{"darwin", "linux", "windows"} | ||
archs = Architectures | ||
ignore = []config.IgnoredBuild{ | ||
{Goos: "darwin", Goarch: "386"}, | ||
{Goos: "darwin", Goarch: "arm"}, | ||
{Goos: "darwin", Goarch: "s390x"}, | ||
{Goos: "windows", Goarch: "arm"}, | ||
{Goos: "windows", Goarch: "arm64"}, | ||
{Goos: "windows", Goarch: "s390x"}, | ||
} | ||
armVersions = ArmVersions | ||
} | ||
|
||
return config.Build{ | ||
ID: dist, | ||
Dir: "_build", | ||
|
@@ -129,33 +115,12 @@ func Build(dist string, buildOrRest bool) config.Build { | |
}, | ||
Goos: goos, | ||
Goarch: archs, | ||
Goarm: ArmVersions(dist), | ||
Ignore: IgnoreBuildCombinations(dist), | ||
Goarm: armVersions, | ||
Ignore: ignore, | ||
} | ||
} | ||
|
||
func IgnoreBuildCombinations(dist string) []config.IgnoredBuild { | ||
if dist == K8sDistro { | ||
return nil | ||
} | ||
return []config.IgnoredBuild{ | ||
{Goos: "darwin", Goarch: "386"}, | ||
{Goos: "darwin", Goarch: "arm"}, | ||
{Goos: "darwin", Goarch: "s390x"}, | ||
{Goos: "windows", Goarch: "arm"}, | ||
{Goos: "windows", Goarch: "arm64"}, | ||
{Goos: "windows", Goarch: "s390x"}, | ||
} | ||
} | ||
|
||
func ArmVersions(dist string) []string { | ||
if dist == K8sDistro { | ||
return nil | ||
} | ||
return []string{"7"} | ||
} | ||
|
||
func Archives(dist string) []config.Archive { | ||
func Archives(dist string) (r []config.Archive) { | ||
return []config.Archive{ | ||
Archive(dist), | ||
} | ||
|
@@ -173,7 +138,7 @@ func Archive(dist string) config.Archive { | |
|
||
func WinPackages(dist string) []config.MSI { | ||
if _, ok := MSIWindowsDists[dist]; !ok { | ||
return nil | ||
return []config.MSI{} | ||
} | ||
return []config.MSI{ | ||
WinPackage(dist), | ||
|
@@ -195,9 +160,9 @@ func WinPackage(dist string) config.MSI { | |
} | ||
} | ||
|
||
func Packages(dist string) []config.NFPM { | ||
func Packages(dist string) (r []config.NFPM) { | ||
if dist == K8sDistro { | ||
return nil | ||
return []config.NFPM{} | ||
} | ||
return []config.NFPM{ | ||
Package(dist), | ||
|
@@ -226,17 +191,21 @@ func Package(dist string) config.NFPM { | |
}) | ||
} | ||
return config.NFPM{ | ||
ID: dist, | ||
Builds: []string{dist}, | ||
Formats: []string{"deb", "rpm"}, | ||
ID: dist, | ||
Builds: []string{dist}, | ||
Formats: []string{"deb", "rpm"}, | ||
|
||
License: "Apache 2.0", | ||
Description: fmt.Sprintf("OpenTelemetry Collector - %s", dist), | ||
Maintainer: "The OpenTelemetry Collector maintainers <[email protected]>", | ||
Overrides: map[string]config.NFPMOverridables{ | ||
"rpm": { | ||
Dependencies: []string{"/bin/sh"}, | ||
Dependencies: []string{ | ||
"/bin/sh", | ||
}, | ||
}, | ||
}, | ||
|
||
NFPMOverridables: config.NFPMOverridables{ | ||
PackageName: dist, | ||
Scripts: config.NFPMScripts{ | ||
|
@@ -250,14 +219,16 @@ func Package(dist string) config.NFPM { | |
} | ||
|
||
func DockerImages(dist string) []config.Docker { | ||
var r []config.Docker | ||
r := make([]config.Docker, 0) | ||
for _, arch := range Architectures { | ||
if dist == K8sDistro && K8sDockerSkipArchs[arch] { | ||
continue | ||
if dist == K8sDistro { | ||
if _, ok := K8sDockerSkipArchs[arch]; ok { | ||
continue | ||
} | ||
} | ||
switch arch { | ||
case ArmArch: | ||
for _, vers := range ArmVersions(dist) { | ||
for _, vers := range ArmVersions { | ||
r = append(r, DockerImage(dist, arch, vers)) | ||
} | ||
default: | ||
|
@@ -331,7 +302,7 @@ func DockerManifest(prefix, version, dist string) config.DockerManifest { | |
} | ||
switch arch { | ||
case ArmArch: | ||
for _, armVers := range ArmVersions(dist) { | ||
for _, armVers := range ArmVersions { | ||
dockerArchTag := strings.ReplaceAll(archName(arch, armVers), "/", "") | ||
imageTemplates = append( | ||
imageTemplates, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.