Skip to content
This repository has been archived by the owner on Jul 4, 2024. It is now read-only.

Commit

Permalink
Add a new --message parameter for delta and run
Browse files Browse the repository at this point in the history
Signed-off-by: Mathieu Benoit <mathieu-benoit@hotmail.fr>
  • Loading branch information
mathieu-benoit authored and ghen committed Aug 3, 2023
1 parent 54d995e commit eb751a9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions internal/command/consts.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const (
extensionsFileDefault = "./humanitec.score.yaml"
apiUrlDefault = "https://api.humanitec.io"
uiUrlDefault = "https://app.humanitec.io"
messageDefault = "Auto-deployment (SCORE)"
)

var (
Expand All @@ -27,6 +28,7 @@ var (
envID string

overrideParams []string
message string

// deltaID is a cli flag receiver used to support "score-humanitec delta --use foo"
deltaID string
Expand Down
3 changes: 2 additions & 1 deletion internal/command/delta.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ func init() {
deltaCmd.MarkFlagRequired("env")

deltaCmd.Flags().StringArrayVarP(&overrideParams, "property", "p", nil, "Overrides selected property value")
deltaCmd.Flags().StringVar(&message, "message", "m", messageDefault, "Message")

Check failure on line 42 in internal/command/delta.go

View workflow job for this annotation

GitHub Actions / test

too many arguments in call to deltaCmd.Flags().StringVar

deltaCmd.Flags().BoolVar(&deploy, "deploy", false, "Trigger a new delta deployment at the end")
deltaCmd.Flags().BoolVar(&retry, "retry", false, "Retry deployments when a deployment is currently in progress")
Expand Down Expand Up @@ -73,7 +74,7 @@ func delta(cmd *cobra.Command, args []string) error {
// Prepare a new deployment
//
log.Print("Preparing a new deployment...\n")
delta, err := humanitec.ConvertSpec("Auto-generated (SCORE)", envID, spec, ext)
delta, err := humanitec.ConvertSpec(message, envID, spec, ext)
if err != nil {
return fmt.Errorf("preparing new deployment: %w", err)
}
Expand Down
3 changes: 2 additions & 1 deletion internal/command/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ func init() {
runCmd.MarkFlagRequired("env")

runCmd.Flags().StringArrayVarP(&overrideParams, "property", "p", nil, "Overrides selected property value")
runCmd.Flags().StringVar(&message, "message", "m", messageDefault, "Message")

Check failure on line 42 in internal/command/run.go

View workflow job for this annotation

GitHub Actions / test

too many arguments in call to runCmd.Flags().StringVar

runCmd.Flags().BoolVar(&skipValidation, "skip-validation", false, "DEPRECATED: Disables Score file schema validation.")
runCmd.Flags().BoolVar(&verbose, "verbose", false, "Enable diagnostic messages (written to STDERR)")
Expand Down Expand Up @@ -67,7 +68,7 @@ func run(cmd *cobra.Command, args []string) error {
// Prepare a new deployment
//
log.Print("Preparing a new deployment...\n")
delta, err := humanitec.ConvertSpec("Auto-generated (SCORE)", envID, spec, ext)
delta, err := humanitec.ConvertSpec(message, envID, spec, ext)
if err != nil {
return fmt.Errorf("preparing new deployment: %w", err)
}
Expand Down

0 comments on commit eb751a9

Please sign in to comment.