Skip to content

Commit

Permalink
- add ideas on how to manage multi-env goals
Browse files Browse the repository at this point in the history
  • Loading branch information
aaabramov committed Nov 8, 2021
1 parent 9a45347 commit 90835ca
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ $ goal tf-apply-stage
- [X] Add `assert.fix`. Display when assertion failed, e.g. `terraform workspace select dev`
- [ ] Simpler `brew tap aaabramov/goal`
- [ ] Manual approvals for proceeding like `assert.approval`
- [ ] Add "environment" management to avoid tf-plan-dev, tf-plan-stage, tf-plan-prod, etc.
- [ ] Add "environment" management to avoid tf-plan-dev, tf-plan-stage, tf-plan-prod, etc. E.g. `goal tf-apply --on dev` & `goal.env: dev` matches
- [ ] Add "depends on" other task like switch to dev?
- [ ] Recursive dependencies
- [ ] Assertions
Expand Down
2 changes: 2 additions & 0 deletions commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ type YamlCommand struct {
Cmd string `yaml:"cmd"`
Args []string `yaml:"args"`
Assert *Assert `yaml:"assert"`
Env string `yaml:"env"`
Desc string `yaml:"desc"`
}

Expand All @@ -31,6 +32,7 @@ type Command struct {
Cmd string
Args []string
Assert *Assert
Env string
Desc string
}

Expand Down
5 changes: 4 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,16 @@ func parseCommands(bytes []byte) (*Commands, error) {
Args: args,
Desc: command.Desc,
Assert: command.Assert,
Env: command.Env,
})
}
return &Commands{commands: res}, nil
}

func main() {

// TODO: add arg parser
// - handle -f [file] option
// - handle --on [env] option and do commands.exec(name, env)
defaultFilename := "goal.yaml"

if _, err := os.Stat(defaultFilename); errors.Is(err, os.ErrNotExist) {
Expand Down

0 comments on commit 90835ca

Please sign in to comment.