Skip to content

Deploying a package stored on S3 #7085

Closed

Description

@mnapoli

Feature Proposal

Description

Maybe this has been discussed before but I haven't found any information about that.

I would like to package my app and store it on S3. Then be able to deploy that S3 package.

Currently, the CI does this:

serverless package
# Upload the package to S3
aws s3 cp --recursive .serverless/ s3://myproject-packages/$VERSION

And then, when manually approved, the deployment is done:

rm -rf .serverless/
aws s3 cp --recursive s3://myproject-packages/$VERSION .serverless/
serverless deploy --package=.serverless

That allows to:

  1. store what was deployed
  2. redeploy the exact same version of the project in different environments (staging/production)

Suggestion: allow to use S3 URLs 👇

serverless package --package=s3://myproject-packages/$VERSION

# then
serverless deploy --package=s3://myproject-packages/$VERSION

Activity

  1. pmuens commented on Dec 13, 2019

    @pmuens
    Contributor

    Hey @mnapoli thanks for opening 👍

    I've already implemented a solution for this via #6196. Do you think you could use this feature or do you still need the extra functionality to pass-in the URL via --package?

  2. mnapoli commented on Dec 13, 2019

    @mnapoli
    ContributorAuthor

    @pmuens thanks for the link!

    Maybe I am missing something, but I don't understand that feature of declaring the package inside serverless.yml: it is hardcoded for all versions.

    In my case, I always create a different package per each version that I want to deploy. So I don't see how it would be possible to put a URL in serverless.yml, because the URL changes every time.

    The only workaround would be to generate a unique serverless.yml on the fly for each version, but that sounds weird. I am really interested to learn if you use those features differently?

  3. pmuens commented on Dec 13, 2019

    @pmuens
    Contributor

    @mnapoli yes, you're right.

    This would only work if it's a location that won't change. If the artifact name varies, then something like an option might be a better solution. You could also go down that path of re-generating the serverless.yml, but this would (as you said) be more like a hack.

  4. alex25784 commented on Jan 1, 2020

    @alex25784

    @mnapoli
    I have the same workflow, it would be great to have the feature you have suggested.
    I have a different issue I wonder how you deal with?
    When you package your development env (I use --satge flag) then all the resources and env variables inside the cloufformation stack have this stage coded, then when I want to promote this env from dev-> prod I cant path the --satge prod to the sls deploy --package .path that was already created.
    *I use stage environments (stage->qa->production) - so the same deploy package should be promoted when for example qa is done.

  5. zomgbre commented on Feb 14, 2020

    @zomgbre
  6. medikoo commented on Dec 8, 2021

    @medikoo
    Contributor

    It feels related to #8499

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions