From 094d9229fbfc35a0b2090287554e99b5209aa9ca Mon Sep 17 00:00:00 2001 From: Alex Van Boxel Date: Wed, 14 Jul 2021 23:38:44 +0200 Subject: [PATCH] Add RPM packages for CentOS 7 to the release --- pkg/build/build.go | 3 +++ pkg/build/rpm.go | 16 +++++++++++++++- pkg/validate/validate.go | 3 +++ 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/pkg/build/build.go b/pkg/build/build.go index 6ad7135e..f1a0cd69 100644 --- a/pkg/build/build.go +++ b/pkg/build/build.go @@ -61,6 +61,9 @@ func Build(manifest model.Manifest, githubToken string) error { if err := Rpm(manifest); err != nil { return fmt.Errorf("failed to build Rpm: %v", err) } + if err := Rpm7(manifest); err != nil { + return fmt.Errorf("failed to build Rpm for CentOS-7: %v", err) + } } if _, f := manifest.BuildOutputs[model.Archive]; f { diff --git a/pkg/build/rpm.go b/pkg/build/rpm.go index 76cf231e..16d99360 100644 --- a/pkg/build/rpm.go +++ b/pkg/build/rpm.go @@ -25,7 +25,7 @@ import ( // Rpm produces an rpm package just for the sidecar func Rpm(manifest model.Manifest) error { if err := util.RunMake(manifest, "istio", nil, "rpm/fpm"); err != nil { - return fmt.Errorf("failed to build sidecar.rpm: %v", err) + return fmt.Errorf("failed to build istio-sidecar.rpm: %v", err) } if err := util.CopyFile(path.Join(manifest.RepoOutDir("istio"), "istio-sidecar.rpm"), path.Join(manifest.OutDir(), "rpm", "istio-sidecar.rpm")); err != nil { return fmt.Errorf("failed to package istio-sidecar.rpm: %v", err) @@ -35,3 +35,17 @@ func Rpm(manifest model.Manifest) error { } return nil } + +// Rpm produces an rpm package for CentOS-7 just for the sidecar +func Rpm7(manifest model.Manifest) error { + if err := util.RunMake(manifest, "istio", nil, "rpm-7/fpm"); err != nil { + return fmt.Errorf("failed to build istio-sidecar-centos-7.rpm: %v", err) + } + if err := util.CopyFile(path.Join(manifest.RepoOutDir("istio"), "istio-sidecar-centos-7.rpm"), path.Join(manifest.OutDir(), "rpm", "istio-sidecar-centos-7.rpm")); err != nil { + return fmt.Errorf("failed to package istio-sidecar-centos-7.rpm: %v", err) + } + if err := util.CreateSha(path.Join(manifest.OutDir(), "rpm", "istio-sidecar-centos-7.rpm")); err != nil { + return fmt.Errorf("failed to package istio-sidecar-centos-7.rpm: %v", err) + } + return nil +} diff --git a/pkg/validate/validate.go b/pkg/validate/validate.go index bfab9a65..549e6491 100644 --- a/pkg/validate/validate.go +++ b/pkg/validate/validate.go @@ -435,6 +435,9 @@ func TestRpm(info ReleaseInfo) error { if !fileExists(filepath.Join(info.release, "rpm", "istio-sidecar.rpm")) { return fmt.Errorf("rpm package not found") } + if !fileExists(filepath.Join(info.release, "rpm", "istio-sidecar-centos-7.rpm")) { + return fmt.Errorf("rpm package for CentOS 7 not found") + } return nil }