serverless: `serverless package` doesn't honor the artifact and package individually configuration

This is a (Bug Report)

Description

I’m trying to use this command: serverless package --stage devd --account dev to create packages for my AWS Lambda functions and it doesn’t work properly.

It’s supposed to use the files that I reference in the artifact property instead it archives the root zip folder.

What went wrong?

When using serverless package command with config artifact and package.individually: true it zips/archives the whole root folder instead of honoring the configuration in the serverless.yml file.

What did you expect should have happened?

I’m trying to use the artifact and package.individually: true to have separate packages for each of my function and use the zip files that I generate with gulp.

What was the config you used?

service: test

package:
  individually: true

provider:
  name: aws
  runtime: nodejs6.10
  stage: ${opt:stage}
  region: us-east-1
  profile: ${opt:account}

functions:
  hello1:
    handler: handler1.hello1
    package:
      artifact: dist/hello1.zip
    events:
        - schedule: rate(1 minute)
  
  hello2:
    handler: handler2.hello2
    package:
      artifact: dist/hello2.zip
    events:
        - schedule: rate(1 minute)

What stacktrace or error message from your provider did you see?

None.

Similar or dependent issues:

Additional Data

  • Serverless Framework Version you’re using: v.1.14.0
  • Operating System: Windows 7
  • Stack Trace: None.
  • Provider Error messages: None.

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 18 (6 by maintainers)

Most upvoted comments

@dlcron @HyperBrain This bug has been stopping us from upgrading from 1.11.0, and serverless is up to 1.15.3. Has there been any update on it?

Right, so we have the bug here.

Dunno if we are on the same page with how artifacts works. If you use artifact, then you must be the one to build it. So first you build, then you provide it in configs.

Serverless framework will still build the package, but when deploying it will use yours artifact.