Deploy a package does not seem to work

Hi! I am using serverless package to create … well a package and try to deploy that later in a CI server. It does not seem to work the deployment part. It creates the folder .serverless that contains the serverless-state.json the couldformation stuff and a zip with what I will deploy.

I run:

serverless deploy --stage test --package .serverless/

And nothing happens, I put the SLS_DEBUG=* variable and it prints thew following

Serverless Error ---------------------------------------

 No serverless-state.json file found in the package path
 you provided.

Stack Trace --------------------------------------------

blah blah

Get Support --------------------------------------------
Docs: docs.serverless.com
Bugs: github.com/serverless/serverless/issues
Forums: forum.serverless.com
Chat: gitter.im/serverless/serverless

Your Environment Information -----------------------------
OS: win32
Node Version: 7.7.1
Serverless Version: 1.13.2

Worth checking you are in the project root directory and then try:

serverless deploy --stage test --package ./.serverless/

In other words… I need to be in the same directory where the serverless.yml is? I thought the purpose of the package was that I could send that to my CI server and just deploy it, but it seems I still need the serverless.yml right?

Yeah I think you will need to be as it needs the serverless yml. The idea of packaging with CI is not to package first locally then push up, rather that your CI task runner runs the " serverless deploy --stage test --package ./.serverless/ ". This allows you create consistent deploy packages (using a version number param, or commit tag for example). :smile: :ship:

quick ref in the Docs: https://serverless.com/framework/docs/providers/aws/guide/packaging/

You are right, it is not very good from CI/CD prospective.
I follow below workaround.

  1. Create package
  2. Copy serverless.yml to package
  3. Upload package to wherever you want to.
  4. Download anywhere with serverless installed and deploy.
    5 Hurray !!!