Repository navigation
Make deploy function lifecycle events more fine grain - #2561
Conversation
|
Looks good. I've also been needing this functionality. Let's have one other person on the team check it out before merging :) @eahefnawy are you available for this one? |
|
Hold off on merging this. Looks like there are some issues with
However this is not the case when you do I probably wont get to fixing |
|
OK this is good to go from my perspective. Having a defined The CI error is a lint error not introduced by my code, so not sure why its failing... |
|
@eahefnawy any chance of this making it in next release? I got a few plugins dependent on it. |
|
Ping @flomotlik @eahefnawy @pmuens |
pmuens
left a comment
There was a problem hiding this comment.
Hey @doapp-ryanp thanks for submitting this 👍 💯 !
Really like the new, multiple lifecycle events instead of a single deploy lifecycle event (which is very general).
Just added a few comments.
|
|
||
| zipFunction() { | ||
| packageFunction() { | ||
| this.serverless.cli.log(`Packaging function: ${this.options.function}...`); |
There was a problem hiding this comment.
Would be great if we could add the ellipsis at the end (instead of three dots).
There was a problem hiding this comment.
Not quite sure what you mean, can you elaborate? An ellipsis is 3 trailing dots.
There was a problem hiding this comment.
@doapp-ryanp to be precise an ellipsis is a character that looks like three dots
… <- ellipsis
... <- 3 dots
There was a problem hiding this comment.
Why is ellipsis favored over 3 dots it renders poorly in non uni-code consoles.
Serverless: Packaging service…
Serverless: Deleted .env file from D:\Source\.env
Serverless: Uploading CloudFormation file to S3…
Serverless: Uploading function .zip files to S3…
Serverless: Updating Stack…
Serverless: Checking Stack update progress…
There was a problem hiding this comment.
good point @gertjvr, I didn't expect anyone still running without a terminal without unicode 😱
let's go back to 3 dots for terminal output? @flomotlik @ac360
There was a problem hiding this comment.
@nikgraf some of use still use windows as our main os 😱
There was a problem hiding this comment.
oh, that's a bummer. just opened a PR to improve to fix the experience on Windows again: #2714
| }); | ||
|
|
||
| it('should run promise chain in order', () => { | ||
| describe('hooks', () => { |
There was a problem hiding this comment.
Not sure about this describe block as we've not used it anywhere else
There was a problem hiding this comment.
I'm fine with whatever eye catcher string you wish to use
| functionObject.artifact = null; // reset the current artifact | ||
|
|
||
| if (funcPackageConfig.artifact) { | ||
| if (process.env.SLS_DEBUG) { |
There was a problem hiding this comment.
Love the ability to get debug information about the current status. Although I'm not sure if we should add it that way or find a more general way to deal with it.
There was a problem hiding this comment.
I'd prefer a method in the sls framework that is something like utils.debug() that handles the env var checking. However I felt like adding that function to the core is outside the scope of this feature branch/pr.
Comments are trivial and unclear.
What did you implement:
Exposed new lifecycle events for
sls deploy functionCurrently there is no way to hook into the different phases of
sls deploy function. This prevents things like being able to browserify/webpack duringsls deploy function. This can be done on thesls deployvia thedeploy:createDeploymentArtifactshook, so this PR adds equivalent capabilities.How did you implement it:
Exposed 2 new
lifecycleEventstodeploy.functionHow can we verify it:
Just run
sls deploy function -f <name>and verify function deploys the same it did before this PR._Is this ready for review?:_ YES