Skip to content

Commit

Permalink
feat(versioning): 🚀 version images generated by cli
Browse files Browse the repository at this point in the history
PR: Add Versioning
  • Loading branch information
tunahanertekin authored May 25, 2023
2 parents e530494 + fa4999f commit 0043dd4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions pkg/api/launch.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ type LaunchConfig struct {
Logfile string `yaml:"logfile,omitempty"`
Verbose bool `yaml:"verbose,omitempty"`
Cache bool `yaml:"cache,omitempty"`
Version string `yaml:"version,omitempty"`
}

func (lc *LaunchConfig) PrintYAML() error {
Expand Down Expand Up @@ -44,6 +45,9 @@ func (lc *LaunchConfig) Validate() error {
if reflect.DeepEqual(lc.Organization, "") {
return errors.New(".organization cannot be empty")
}
if reflect.DeepEqual(lc.Version, "") {
return errors.New(".version cannot be empty")
}
if err := lc.validateSteps(); err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/api/step.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func (step *Step) Default(lc LaunchConfig) {
}

func (step *Step) setImageName(lc LaunchConfig) {
step.Image.Name = lc.Registry + "/" + lc.Organization + "/" + step.Image.Repository + ":" + step.Image.Tag
step.Image.Name = lc.Registry + "/" + lc.Organization + "/" + step.Image.Repository + ":" + step.Image.Tag + "-" + lc.Version
}

func (step *Step) setContext(lc LaunchConfig) {
Expand Down

0 comments on commit 0043dd4

Please sign in to comment.