Skip to content

Commit

Permalink
Merge pull request #36 from thorstenhuhn/master
Browse files Browse the repository at this point in the history
Added new keyword 'stackname' to overwrite default stack name
  • Loading branch information
daidokoro authored Oct 24, 2019
2 parents c76d72e + 5ed01fb commit d18e529
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions commands/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ func Configure(confSource string, conf string) (err error) {
DependsOn: v.DependsOn,
Policy: v.Policy,
Source: v.Source,
Stackname: v.Name,
Bucket: v.Bucket,
Role: v.Role,
DeployDelims: &config.DeployDelimiter,
Expand Down
1 change: 1 addition & 0 deletions stacks/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ type Config struct {
Profile string `yaml:"profile,omitempty" json:"profile,omitempty" hcl:"profile,omitempty"`
Region string `yaml:"region,omitempty" json:"region,omitempty" hcl:"region,omitempty"`
Source string `yaml:"source,omitempty" json:"source,omitempty" hcl:"source,omitempty"`
Name string `yaml:"name,omitempty" json:"name,omitempty" hcl:"name,omitempty"`
Bucket string `yaml:"bucket,omitempty" json:"bucket,omitempty" hcl:"bucket,omitempty"`
Role string `yaml:"role,omitempty" json:"role,omitempty" hcl:"role,omitempty"`
Tags []map[string]string `yaml:"tags,omitempty" json:"tags,omitempty" hcl:"tags,omitempty"`
Expand Down
4 changes: 3 additions & 1 deletion stacks/stack.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@ type Stack struct {

// SetStackName - sets the stackname with struct
func (s *Stack) SetStackName() {
s.Stackname = fmt.Sprintf("%s-%s", *s.Project, s.Name)
if s.Stackname == "" {
s.Stackname = fmt.Sprintf("%s-%s", *s.Project, s.Name)
}
}

// creds - Returns credentials if role set
Expand Down

0 comments on commit d18e529

Please sign in to comment.