deploy to `staging` and `production`
florianherrengt opened this issue · comments
This is a:
- Feature request or change
For feature requests or changes:
Current behavior (if any)
Removed "stage" command-line option. It was not being used for anything
Proposed behavior
Bring it back
Justification
Hey guys, thank you so much for your hard work. Since you removed the stage option, how do we deploy to staging
and production
?
Hi @florianherrengt, great question! Right now, probably through two different configurations. In the future we could definitely bring the option back - it just didn't do anything before.
If you'd like to work on a PR to bring it back and have it actually do something I'm all for it!
Hi @fernando-mc, thanks for your reply. There is still the option of using
provider:
stage: ${opt:stage, 'dev'}
I understand it might be redundant but I feel --stage
was more consistent with the serverless CLI.
@florianherrengt Either or both of those options sounds fine to me! The issue was that there was no code to deploy to a separate bucket name for example. Do you feel comfortable updating the plugin to provide this functionality?
I think using is the direction this plugin is going
provider:
stage: ${opt:stage, 'dev'}
Maybe add something to the README.md? I'm happy to create a PR.
I don't think the plugin needs to support --stage
, since if it's required by the app it's easy to define it in serverless config. I'm using:
custom:
stage: ${opt:stage, self:provider.stage}
client:
bucketName: my-bucket-${self:custom.stage}
Might be worth mentioning this example in README tho.
@artoliukkonen @florianherrengt A README update sounds good to me. I'll merge a PR from either of you, just be sure to post back here to save the other one work.
From what I remember, the behavior of the plugin currently wont change at all with a --stage param so just reminding folks they can add stage with the Framework's config itself is probably a smart idea. Especially if you're already doing something like that @artoliukkonen.
Thanks to you both!
This wasn't immediately clear to me, so thought I'd update this issue.
To set the stage, you can use the following command serverless --stage=qa client deploy
I think the solutions documented here are good enough for anyone searching for how to do this. Since there hasn't been any activity on this issue in a while, and I'm not sure we want to document features outside of this plugin, I'm going to close this issue