|
|
@@ -61,13 +61,21 @@ func (p *publisher) postRelease(r *release) error {
|
|
|
return nil
|
|
|
}
|
|
|
|
|
|
+type ReleaseType int
|
|
|
+
|
|
|
+const (
|
|
|
+ STABLE ReleaseType = iota + 1
|
|
|
+ BETA
|
|
|
+ NIGHTLY
|
|
|
+)
|
|
|
+
|
|
|
type buildArtifact struct {
|
|
|
os string
|
|
|
arch string
|
|
|
urlPostfix string
|
|
|
}
|
|
|
|
|
|
-func (t buildArtifact) getUrl(baseArchiveUrl, version string, isBeta bool) string {
|
|
|
+func (t buildArtifact) getUrl(baseArchiveUrl, version string, rt ReleaseType) string {
|
|
|
prefix := "-"
|
|
|
rhelReleaseExtra := ""
|
|
|
|
|
|
@@ -75,7 +83,7 @@ func (t buildArtifact) getUrl(baseArchiveUrl, version string, isBeta bool) strin
|
|
|
prefix = "_"
|
|
|
}
|
|
|
|
|
|
- if !isBeta && t.os == "rhel" {
|
|
|
+ if rt == BETA && t.os == "rhel" {
|
|
|
rhelReleaseExtra = "-1"
|
|
|
}
|
|
|
|
|
|
@@ -141,10 +149,10 @@ var buildArtifactConfigurations = []buildArtifact{
|
|
|
},
|
|
|
}
|
|
|
|
|
|
-func newBuild(baseArchiveUrl string, ba buildArtifact, version string, isBeta bool, sha256 string) build {
|
|
|
+func newBuild(baseArchiveUrl string, ba buildArtifact, version string, rt ReleaseType, sha256 string) build {
|
|
|
return build{
|
|
|
Os: ba.os,
|
|
|
- Url: ba.getUrl(baseArchiveUrl, version, isBeta),
|
|
|
+ Url: ba.getUrl(baseArchiveUrl, version, rt),
|
|
|
Sha256: sha256,
|
|
|
Arch: ba.arch,
|
|
|
}
|