Skip to content

Commit

Permalink
Add RPM packages for CentOS 7 to the release
Browse files Browse the repository at this point in the history
  • Loading branch information
alexvanboxel committed Jul 14, 2021
1 parent 343862e commit 094d922
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
3 changes: 3 additions & 0 deletions pkg/build/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
16 changes: 15 additions & 1 deletion pkg/build/rpm.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
}
3 changes: 3 additions & 0 deletions pkg/validate/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit 094d922

Please sign in to comment.