Skip to content

Commit

Permalink
adding GolangCrossSuffix var
Browse files Browse the repository at this point in the history
  • Loading branch information
ermirizio committed Jul 10, 2023
1 parent 309625a commit e492bcd
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 23 deletions.
16 changes: 15 additions & 1 deletion config/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ policy:
# is used for selecting the appropriate golang-cross image
# used for building the binary, packages and docker images.
goversion: 1.19
golangcrosssuffix: -bullseye
# Workflows that need to pass to merge PRs
tests:
- "Go 1.19.x Redis 5"
Expand All @@ -123,8 +124,10 @@ policy:
- api-test
release-5.1:
active: true
golangcrosssuffix: -bullseye
release-5.1.0:
active: true
golangcrosssuffix: -bullseye
release-4-lts:
active: true
tests:
Expand Down Expand Up @@ -186,6 +189,7 @@ policy:
active: true
reviewcount: 1
goversion: 1.19
golangcrosssuffix: -bullseye
features:
- go1.19
- api-test
Expand All @@ -194,6 +198,7 @@ policy:
active: true
reviewcount: 0
goversion: 1.19
golangcrosssuffix: -bullseye
features:
- go1.19
- api-test
Expand All @@ -202,6 +207,7 @@ policy:
active: true
reviewcount: 0
goversion: 1.19
golangcrosssuffix: -bullseye
features:
- go1.19
- api-test
Expand Down Expand Up @@ -376,13 +382,17 @@ policy:
sourcebranch: master
goversion: 1.19
tests: ["1.19-bullseye","Go 1.19 tests"]
features:
- go1.19
reviewcount: 0
branch:
master:
active: true
reviewcount: 2
golangcrosssuffix: -bullseye
release-1.8:
active: true
golangcrosssuffix: -bullseye
tyk-analytics-ui:
description: >-
User interface for our dashboard. Backend: https://github.com/TykTechnologies/tyk-analytics
Expand All @@ -403,7 +413,8 @@ policy:
branch:
master:
active: true
reviewcount: 2
reviewcount: 1
tests: ["test (1.16.x, ubuntu-latest, amd64, 15.x)","test"]
release-5.1:
active: true
reviewcount: 0
Expand All @@ -421,5 +432,8 @@ policy:
active: true
tests: ["test (1.16.x, ubuntu-latest, amd64, 16)", "test"]
release-4-lts:
active: true
tests: []
release-4.0.14:
active: true
tests: []
28 changes: 14 additions & 14 deletions policy/policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,19 @@ func GetRepoPolicy(repo string, branch string) (RepoPolicy, error) {

// branchVals contains the parameters that are specific to a particular branch in a repo
type branchVals struct {
GoVersion string
CleanGoVersion string
Cgo bool
ConfigFile string
VersionPackage string // The package containing version.go
UpgradeFromVer string // Versions to test package upgrades from
PCPrivate bool // indicates whether package cloud repo is private
Branch map[string]branchVals `copier:"-"`
Active bool
ReviewCount string
Convos bool
Tests []string
SourceBranch string
GoVersion string
GolangCrossSuffix string
Cgo bool
ConfigFile string
VersionPackage string // The package containing version.go
UpgradeFromVer string // Versions to test package upgrades from
PCPrivate bool // indicates whether package cloud repo is private
Branch map[string]branchVals `copier:"-"`
Active bool
ReviewCount string
Convos bool
Tests []string
SourceBranch string
// List of arbitrary features whose presence/absence can be
// used as template conditions to render different
// values on different set of branches (eg: el7 for el7 support)
Expand All @@ -52,7 +52,7 @@ type Policies struct {
Binary string
Protected []string `copier:"-"`
Goversion string
CleanGoVersion string
GolangCrossSuffix string
Default string // The default git branch(master/main/anything else)
Repos map[string]Policies // map of reponames to branchPolicies
Ports map[string][]string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,8 @@
matrix:
{{- if and .Branchvals.Cgo (has "el7" .Branchvals.Features) }}{{/* release-3.x version uses the same image for both el7 and non el7 */}}
golang_cross: [ {{ .Branchvals.GoVersion }}, {{ .Branchvals.GoVersion }}-el7 ]
{{- else if and .Branchvals.Cgo (has "go1.19" .Branchvals.Features) }}
golang_cross: [ {{ .Branchvals.GoVersion }}-bullseye ]
{{- else }}
golang_cross: [ {{ .Branchvals.GoVersion }} ]
golang_cross: [ {{ .Branchvals.GoVersion }}{{.Branchvals.GolangCrossSuffix}} ]
{{- end }}
include:
{{- if and .Branchvals.Cgo (has "el7" .Branchvals.Features) }}
Expand All @@ -20,12 +18,10 @@
rpmvers: 'el/7 amazon/2'
debvers: 'ubuntu/xenial ubuntu/bionic debian/jessie'
{{- end }}
{{- if and .Branchvals.Cgo (has "go1.19" .Branchvals.Features) }}
- golang_cross: {{ .Branchvals.GoVersion }}-bullseye
- golang_cross: {{ .Branchvals.GoVersion }}{{.Branchvals.GolangCrossSuffix}}
{{- if and .Branchvals.Cgo (has "go1.19" .Branchvals.Features) }}
go_version: {{ .Branchvals.GoVersion }}
{{- else }}
- golang_cross: {{ .Branchvals.GoVersion }}
{{- end }}
{{- end }}
goreleaser: 'ci/goreleaser/goreleaser.yml'
{{- if .Branchvals.Cgo }}
rpmvers: 'el/8 el/9 amazon/2023'
Expand Down

0 comments on commit e492bcd

Please sign in to comment.