Skip to content

Commit

Permalink
[SYSE-337]: Fixes in el7, and s390x feature conditions (#300)
Browse files Browse the repository at this point in the history
- CGO_ENABLED was set to be off for all the el7 builds. We'll need to set
it off only for the pgo build which is for dashboard - fixes this.
- s390x feature conditions were not set for the goreleaser.el7
  templates, fixes it as well.
- It appears gateway doesn't need separate el7 conditionals
at all - so adds the el7 feature only to dashboard, and
change the conditionals accordingly.
- Adds a new feature python-support to conditionally manage python
plugin support in gateway
  • Loading branch information
asutosh authored Apr 15, 2024
1 parent d1d0060 commit 8a46e5c
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 30 deletions.
6 changes: 3 additions & 3 deletions config/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,17 +90,17 @@ policy:
- auto-test
release-4-lts:
features:
- el7
- plugin-compiler-fix-vendor
- python-support
buildenv: 1.15
release-5-lts:
buildenv: 1.16
deletedfiles:
- .github/workflows/api-tests.yml
features:
- el7
- plugin-compiler-fix-vendor
- auto-test
- python-support

tyk-analytics:
description: >-
Expand All @@ -115,7 +115,7 @@ policy:
upgradefromver: 3.0.9
configfile: tyk_analytics.conf
versionpackage: github.com/TykTechnologies/tyk-analytics/internal/build
sourcebranch: master
sourcebranch: master
buildenv: 1.21-bullseye
features:
- el7
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ builds:
goarch:
- amd64
- arm64
{{ if has "s390x" .Branchvals.Features }}
- s390x
{{ end }}
binary: {{.Binary}}
{{end}}

Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ builds:
goarch:
- arm64
binary: {{.Binary}}
{{ if has "s390x" .Branchvals.Features -}}
- id: std-s390x
{{- if eq .Name "tyk" }}
flags:
Expand All @@ -58,22 +59,5 @@ builds:
goarch:
- s390x
binary: {{.Binary}}
{{- if eq .Name "tyk-analytics"}}
# With special license pubkey
- id: payg
flags:
- -v
- -x
ldflags:
- -s -w -X {{.Branchvals.VersionPackage}}.Version={{`{{.Version}}`}}
- -X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lV0eApnK1dqbnoyVEdPT2wyaWhUMWVBM2pQUUFyejk4VFUwMjhYbE1xWEgzNE5hN3owb003dkF0VXpUbmwrOWNRSS85Cm45YUlqQVJYclNsNWd0azRVZkFDSURVQ0F3RUFBUT09Ci0tLS0tRU5EIFBVQkxJQyBLRVktLS0tLQo='"
goos:
- linux
goarch:
- amd64
binary: {{.Binary}}
{{- end}}
{{ end }} {{/* s390x */}}
{{end}}
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,23 @@
golang_cross:
- {{ .Branchvals.Buildenv }}
{{- if has "el7" .Branchvals.Features }}
{{ if eq .Branch "release-5-lts" -}}
{{ if or (eq .Branch "release-5-lts") (eq .Branch "release-4-lts") -}}
- 1.16-el7
{{ else if eq .Branch "release-4-lts" -}}
- 1.15-el7
{{ else if eq .Branch "master" -}}
{{ else -}}
- {{ .Branchvals.Buildenv }}-pgo
{{- end -}}
{{- end }} {{/* el7 */}}
include:
{{- if has "el7" .Branchvals.Features }}
- golang_cross: {{ if eq .Branch "release-5-lts"}}1.16-el7{{ else if eq .Branch "release-4-lts" }}1.15-el7{{ else if eq .Branch "master" }}{{ .Branchvals.Buildenv }}-pgo{{ end }}
- golang_cross: {{ if or (eq .Branch "release-5-lts") ( eq .Branch "release-4-lts" ) }}1.16-el7{{ else }}{{ .Branchvals.Buildenv }}-pgo{{ end }}
goreleaser: 'ci/goreleaser/goreleaser-el7.yml'
rpmvers: 'el/7 amazon/2'
debvers: 'ubuntu/xenial ubuntu/bionic debian/jessie'
{{- if or (eq .Branch "release-5-lts") (eq .Branch "release-4-lts") }}
cgo: 1
{{- else }}
cgo: 0
{{- end }}
{{- end }} {{/* el7 */}}
- golang_cross: {{ .Branchvals.Buildenv }}
goreleaser: 'ci/goreleaser/goreleaser.yml'
Expand Down
6 changes: 2 additions & 4 deletions policy/templates/releng/ci/Dockerfile.std
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update \
&& apt-get dist-upgrade -y ca-certificates

{{- if and (eq .Name "tyk") (eq .Branch "release-5-lts") }}
{{- if has "python-support" .Branchvals.Features }}
# For Python plugins
RUN apt-get install -y python3-setuptools libpython3-dev python3-dev python3-grpcio
{{- end }}
Expand All @@ -21,9 +21,7 @@ RUN rm -fv /usr/bin/passwd /usr/sbin/adduser || true
RUN rm -rf /root/.cache \
&& apt-get -y autoremove \
&& apt-get clean \
{{- if and (eq .Name "tyk") (eq .Branch "release-5-lts") }}
&& rm -rf /usr/include/* \
{{- end }}
&& rm -rf /usr/include/* /var/cache/apt/archives /var/lib/{apt,dpkg,cache,log} \
&& find /usr/lib -type f -name '*.a' -o -name '*.o' -delete

# Comment this to test in dev
Expand Down

0 comments on commit 8a46e5c

Please sign in to comment.