Repository navigation
Update artifact deployment process - #1906
Conversation
| newFunction.Properties.Code | ||
| .S3Key = this.serverless.service.package.artifact.split(path.sep).pop(); | ||
| .S3Key = `${this.serverless.service.package.artifactDirectoryName | ||
| }/${this.serverless.service.package.artifact.split(path.sep).pop()}`; |
There was a problem hiding this comment.
We should not use the filename of the artefact, but create our own filename. Otherwise files might not be correctly renamed and CF won't detect an update. This also means we have more control over it
There was a problem hiding this comment.
My bad it actually will work as we put it into separate folders that have a date in the folder name, so everything will change. I this case this is fine for me like this
|
I think we should keep the last 5 folders for now. One thing to also make sure is that --noDeploy also works in this PR still, I didn't see that in the update artefacts code yet. |
|
Thanks! Will add a note about it in the todo list! |
|
@flomotlik just pushed some changes and finished the implementation |
30957ec to
0098353
Compare
|
�With existing buckets it looks like it is throwing an exception. I could replicate it by uploading a random file into there: |
|
Deploying a Java app through the package->artefact header worked perfectly fine. Other than the bug mentioned before this works great |
|
Alright. Thanks for testing it. Will look into it! |
0098353 to
b233ee3
Compare
|
@flomotlik just pushed a fix which prevents the error above. |
So that the S3Key properties are prepended with the artifactDirectoryName.
So that it's more encapsulated and easier to test in isolation.
The timestamp is not necessary anymore as the zip file is uploaded into a timestamped directory on S3.
b233ee3 to
d72617d
Compare
This PR implements a way so that artifacts (right now the zipped service and the corresponding CloudFormation file) are uploaded to a directory (with a timestamp as a name) in S3 rather than the root directory.
This way it's possible to keep different versions of deployments and switch between different deployments (e.g. rollback could be solved with this).
Stuff todo:
deployFunctionscodegetServerlessDeploymentBucketNamemethod indeploy:deployhook into own methodnoDeploystill worksCorresponding issue: #1898
@flomotlik @eahefnawy would be cool if you could take a look at it!
Furthermore I'd like to know if we should implement a "keep only 5 versions" functionality or just store each and every deployment. Might pollute the S3 bucket but this way the user has the whole history of deployments.