Skip to content

Commit

Permalink
Merge pull request #9262 from radTuti/cp-hashrelease
Browse files Browse the repository at this point in the history
[cherry-pick] fix hashrelease for v3.29
  • Loading branch information
caseydavenport authored Sep 20, 2024
2 parents ace8c64 + ddffc6b commit 4ba7c4c
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion release/internal/hashrelease/hashrelease.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func Publish(name, hash, note, stream, dir string, sshConfig *command.SSHConfig)
logrus.WithError(err).Error("Failed to publish hashrelease")
return err
}
if _, err := command.RunSSHCommand(sshConfig, fmt.Sprintf(`echo "%s" > %s/latest-os/%s.txt && echo %s >> %s`, URL(name), remoteDocsPath(sshConfig.User), stream, name, remoteReleasesLibraryPath(sshConfig.User))); err != nil {
if _, err := command.RunSSHCommand(sshConfig, fmt.Sprintf(`echo "%s/" > %s/latest-os/%s.txt && echo %s >> %s`, URL(name), remoteDocsPath(sshConfig.User), stream, name, remoteReleasesLibraryPath(sshConfig.User))); err != nil {
logrus.WithError(err).Error("Failed to update latest hashrelease and hashrelease library")
return err
}
Expand Down
2 changes: 2 additions & 0 deletions release/internal/hashrelease/pinnedversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"html/template"
"os"
"path/filepath"
"strings"
"time"

"github.com/sirupsen/logrus"
Expand Down Expand Up @@ -104,6 +105,7 @@ func GeneratePinnedVersionFile(rootDir, releaseBranchPrefix, devTagSuffix string
}
productVersion := version.GitVersion()
releaseName := fmt.Sprintf("%s-%s-%s", time.Now().Format("2006-01-02"), version.DeterminePublishStream(productBranch, string(productVersion)), RandomWord())
releaseName = strings.ReplaceAll(releaseName, ".", "-")
operatorBranch, err := operator.GitBranch(operatorConfig.Dir)
if err != nil {
return "", nil, err
Expand Down
4 changes: 2 additions & 2 deletions release/internal/slack/slack.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ type MessageData struct {
// Product is the name of the product
Product string

// Branch is the branch of the release
Branch string
// Stream is the stream of the release
Stream string

// Version is the version of the release
Version string
Expand Down
2 changes: 1 addition & 1 deletion release/internal/slack/templates/failure.json.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"type": "header",
"text": {
"type": "plain_text",
"text": ":warning: Failed to create {{.Product}} {{.Branch}} release"
"text": ":warning: Failed to create {{.Product}} {{.Stream}} release"
}
},
{
Expand Down
2 changes: 1 addition & 1 deletion release/internal/slack/templates/success.json.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"type": "header",
"text": {
"type": "plain_text",
"text": ":loud_sound: New {{.Product}} {{.Branch}} release"
"text": ":loud_sound: New {{.Product}} {{.Stream}} release"
}
},
{
Expand Down
4 changes: 2 additions & 2 deletions release/pkg/tasks/hashrelease.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ func HashreleaseValidate(cfg *config.Config, skipISS bool) {
Data: slack.MessageData{
ReleaseName: name,
Product: utils.DisplayProductName(),
Branch: productBranch,
Stream: version.DeterminePublishStream(productBranch, productVersion),
Version: productVersion,
OperatorVersion: operatorVersion,
CIURL: ciURL,
Expand Down Expand Up @@ -204,7 +204,7 @@ func HashreleasePush(cfg *config.Config, path string) {
Data: slack.MessageData{
ReleaseName: name,
Product: utils.DisplayProductName(),
Branch: productBranch,
Stream: version.DeterminePublishStream(productBranch, productVersion),
Version: productVersion,
OperatorVersion: operatorVersion,
DocsURL: hashrelease.URL(name),
Expand Down

0 comments on commit 4ba7c4c

Please sign in to comment.