Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Address stacks and envs by path #62

Closed
jamesroutley opened this issue Feb 27, 2017 · 11 comments
Closed

Address stacks and envs by path #62

jamesroutley opened this issue Feb 27, 2017 · 11 comments
Milestone

Comments

@jamesroutley
Copy link
Contributor

Implementation

We currently build stacks and environments with the syntax:

sceptre <action>-stack env stack
sceptre <action>-env env

This proposal would change the addressing to:

sceptre <action> path/to/stack.yaml
sceptre <action> --recursive path/to/env/

Pros

  • By supplying file paths, we get native tab completion (only tested on zsh on macOS)

Cons

@jamesroutley jamesroutley modified the milestone: v2 Feb 27, 2017
@theseanything
Copy link
Contributor

Pro this! But not sure about the --recursive flag.

@mitom
Copy link
Contributor

mitom commented Mar 1, 2017

Instead of --recursive could we have just:

sceptre <action> path/to/env/

As in passing in a directory would be the same as launch-env and passing in a file would be the same as launch-stack?

@theseanything
Copy link
Contributor

Yeah that would be ideal. But we need to put some sort of protection around doing actions to a whole environment. It would be too easy for a user to accidentally create or update stacks unintentionally. CloudFormation slip-ups can be costly :(

@jamesroutley
Copy link
Contributor Author

@seanrankine what about it are you not sure about?

@theseanything
Copy link
Contributor

its in an awkward position and the word recursive is long... Just means its not super easy to switch between a stack or env command in the terminal.

@jamesroutley
Copy link
Contributor Author

oh yeah I think we'd do a -r as well.

@theseanything
Copy link
Contributor

theseanything commented Mar 5, 2017

Yup but still not a huge fan of it sitting in between the command and path. It'd be nice to just tack it on the end

@mitom
Copy link
Contributor

mitom commented Mar 5, 2017

I'd rather have it in front, -r is not too bad and flags generally come in front of positional arguments, not after.

Also, to avoid potentially harmful/accidental actions you could add a simple verification
You are about to update the entire <env> envrionment, do you want to continue? [Y|n]. It would make it easy to switch between commands (no other arguments need to change) and it would make it clear what is going to happen. For CI tools a -y flag could assume yes.

@theseanything
Copy link
Contributor

I like the verification step way of doing it and the safety. Thoughts @jamesroutley? Also would we want to put .yaml at the end of a stack? I'd prefer to omit it.

@jamesroutley
Copy link
Contributor Author

I've opened an issue about adding verification to the delete commands #61. Should we add one for other commands as well? Maybe for "dangerous" commands like update?

I put the .yaml for a couple of reasons:

  1. Sceptre fundamentally deals with files. Each stack maps onto a single file. I think it's beneficial to emphasise this by getting users to supply a path to a file.
  2. Using an actual file path gives you tab-completion. This completes to /path/stack.yaml, so if we didn't have the .yaml users could tab in the filename but would have to delete those five chars
  3. It makes the yaml vs yml thing ( Allow .yml as well as .yaml #67 ) a bit more explicit and removes some ambiguity about which one we use.

@theseanything
Copy link
Contributor

#278

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants