You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
BREAKING - Support packaging and deploying artefacts as separate steps #2473
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:
Rework include/exclude #2460 - This covers the same code base. We should wait until that issue is resolved first.
Additional Data
_Serverless Framework Version_: 1.0.2
Reacted by rowan, Gert Jansen van Rensburg, Björn Holdt, Michael Wolfenden, Nick den Engelsman, Adrien, Daniel Dyrnes, Martin Micunda, Luciano Mammino, Gionata "Joe" Minichino and 19 more
Love this idea. we where thinking about how to resolve this.
Scenarios for us:
We use Teamcity for running tests and compiling / building assets. These assets are then package and promoted to be deployed with Octopus Deploy. During deployment OD replaces tokens injected at build time with configuration for the environment its deploying too.
Making the assets a first-class citizen would make deployments repeatable and controlled.
@johncmckim Thanks for documenting the issue. One thing I would like to be clarified though.
The missing step is a sls deploy --package ./package.zip. This would deploy the package that had been created earlier.
Would this also take in account the generated CloudFormation templates from an earlier build phase? I'm not really sure if including the templates is really that important though(since they will be autogenerated). Also including the templates would make it provider specific again, while --package should be common among providers.
@nicka it very important for us that nothing changes to the artifacts after they are generated and packaged. As the promotion path requires consistent / unchanged artifacst. As I mentioned in my comment OD will replace tokens injected into the artifacts. if you regenerated them these replaced tokens might get reset.
I just created 3 different new issues after a little more discussion that should solve this by creating a separate build command and documenting how to use the variable system to make this work.
We need to further discuss during the implementation of those issues how we're dealing with CF templates, if those are created during the build process as well and then just handed to the deploy command, so the deploy command really only deploys but does not do any further building of artifacts.
changed the title [-]Support packaging and deploying artefacts as separate steps[/-][+]BREAKING - Support packaging and deploying artefacts as separate steps[/+]on Mar 9, 2017
Activity
gertjvr commentedon Oct 20, 2016
Love this idea. we where thinking about how to resolve this.
Scenarios for us:
We use Teamcity for running tests and compiling / building assets. These assets are then package and promoted to be deployed with Octopus Deploy. During deployment OD replaces tokens injected at build time with configuration for the environment its deploying too.
Making the assets a first-class citizen would make deployments repeatable and controlled.
nicka commentedon Oct 20, 2016
@johncmckim Thanks for documenting the issue. One thing I would like to be clarified though.
Would this also take in account the generated CloudFormation templates from an earlier build phase? I'm not really sure if including the templates is really that important though(since they will be autogenerated). Also including the templates would make it provider specific again, while --package should be common among providers.
gertjvr commentedon Oct 20, 2016
@nicka it very important for us that nothing changes to the artifacts after they are generated and packaged. As the promotion path requires consistent / unchanged artifacst. As I mentioned in my comment OD will replace tokens injected into the artifacts. if you regenerated them these replaced tokens might get reset.
nicka commentedon Oct 20, 2016
@gertjvr I'm working on a feature proposal #2477 for the use of CloudFormation Change Sets. Since I think it could be two separate deploy arguments.
johncmckim commentedon Oct 20, 2016
@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.
nicka commentedon Oct 20, 2016
@johncmckim Thanks for elaborating on this, sounds and reads 👍
flomotlik commentedon Oct 20, 2016
@johncmckim interesting proposal. I'll have to think this through a bit and will come back with my opionion then in the next days.
gertjvr commentedon Oct 27, 2016
Any update on this discussion?
lmammino commentedon Oct 28, 2016
I am also interested in knowing if there is a plan to develop and release these feature.
flomotlik commentedon Nov 8, 2016
I just created 3 different new issues after a little more discussion that should solve this by creating a separate build command and documenting how to use the variable system to make this work.
We need to further discuss during the implementation of those issues how we're dealing with CF templates, if those are created during the build process as well and then just handed to the deploy command, so the deploy command really only deploys but does not do any further building of artifacts.
16 remaining items
pmuens commentedon Mar 9, 2017
@gertjvr yes, @eahefnawy is currently working on it!
Furthermore there's @HyperBrain great work with the entrypoint PR (#3327) and the CI / CD plugin (https://github.com/HyperBrain/serverless-cicd) which implements just that.
[-]Support packaging and deploying artefacts as separate steps[/-][+]BREAKING - Support packaging and deploying artefacts as separate steps[/+]