serverless: BREAKING - Support packaging and deploying artefacts as separate steps
Feature Proposal
Description
For CI / CD scenarios it is common to package and deploy software as separate steps. The package step generates artefacts and the deploy steps deploys those artefacts to different environments. This allows for scenarios like environment promotion ect.
At this stage we sort of have a package step with sls deploy --noDeploy. We might need to consider adding a command like sls package that performs the same task. I remember the discussion around the naming of --noDeploy. Having a separate command was discussed then.
The missing step is a sls deploy --package ./package.zip. This would deploy the package that had been created earlier.
Similar or dependent issues:
- #2460 - This covers the same code base. We should wait until that issue is resolved first.
Additional Data
- _Serverless Framework Version_: 1.0.2
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Reactions: 29
- Comments: 15 (13 by maintainers)
@nicka it should include CF but it should also support other providers. This is how I think it should work
Examples
Scenario 1 - separate package and deploy
sls packagegenerates the required files. For example:artefact.zip. This can be done by CI or could be done by serverlesssls deploy --package artefact.zipskips the package process, extracts the package to.serverlessand deploys.serverlessScenario 2 - normal and deploy
sls deploygenerates the required files in.serverlessand deploys.serverlessMore thoughts
The implementation I am thinking of is not provider specific. It merely works which
.serverlessin different ways.The reason why I would go with this is that as @gertjvr says, the package should not change between environments (except for environment variables).
I’m open to suggestions for improving this.
@johncmckim interesting proposal. I’ll have to think this through a bit and will come back with my opionion then in the next days.