Skip to content

Commit

Permalink
bug fix: host.deploy.slack_channel_id didn't work
Browse files Browse the repository at this point in the history
  • Loading branch information
ShotaKitazawa committed Jul 22, 2022
1 parent 210c03a commit 13b4a13
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions pkg/cmd/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,16 +79,16 @@ func runDeploy(
"Deploy",
func(ctx context.Context, host config.Host) error {
// Notify to Slack
if err := slackClient.SendText(ctx, host.Deploy.SlackChannel,
if err := slackClient.SendText(ctx, host.Deploy.SlackChannelId,
fmt.Sprintf("*<%s> deploying to %s...*", conf.GitRevision, host.Host)); err != nil {
return err
}
defer func() {
if err != nil {
_ = slackClient.SendText(ctx, host.Deploy.SlackChannel,
_ = slackClient.SendText(ctx, host.Deploy.SlackChannelId,
fmt.Sprintf("*<%s> deploy was failed to %s* :sob:", conf.GitRevision, host.Host))
} else {
_ = slackClient.SendText(ctx, host.Deploy.SlackChannel,
_ = slackClient.SendText(ctx, host.Deploy.SlackChannelId,
fmt.Sprintf("*<%s> deploy was succeeded to %s* :laughing:", conf.GitRevision, host.Host))
}
}()
Expand Down
8 changes: 4 additions & 4 deletions pkg/config/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,10 @@ func (c Host) ListTarget() []DeployTarget {
}

type Deploy struct {
SlackChannel string `yaml:"slack_channel,omitempty"`
PreCommand string `yaml:"pre_command,omitempty"`
PostCommand string `yaml:"post_command,omitempty"`
Targets []DeployTarget `yaml:"targets,omitempty"`
SlackChannelId string `yaml:"slack_channel_id,omitempty"`
PreCommand string `yaml:"pre_command,omitempty"`
PostCommand string `yaml:"post_command,omitempty"`
Targets []DeployTarget `yaml:"targets,omitempty"`
}

type DeployTarget struct {
Expand Down

0 comments on commit 13b4a13

Please sign in to comment.