Skip to content
This repository has been archived by the owner on Jun 15, 2024. It is now read-only.

2.2.0 broken - new layer created each time #31

Closed
marcinkowalczyk opened this issue Apr 19, 2020 · 2 comments
Closed

2.2.0 broken - new layer created each time #31

marcinkowalczyk opened this issue Apr 19, 2020 · 2 comments

Comments

@marcinkowalczyk
Copy link

marcinkowalczyk commented Apr 19, 2020

Hi,

I've recetenly migrated from 1.x branch to 2.2.0 and seems there is a bug. Looks like each time severless is called new layer gets created.
I've downloaded s3 manifest and diff/md5 compared it with local manifest and they are same

kowal@LAPTOP-UJ4M2HCE:/mnt/c/Users/marci/IdeaProjects/comm$ aws s3 cp s3://serverless-layers/serverless/stack/staging/layers/package.json from3
download: s3://serverless-layers/serverless/stack/staging/layers/package.json to ./from3
kowal@LAPTOP-UJ4M2HCE:/mnt/c/Users/marci/IdeaProjects/comm$ diff package.json from3
kowal@LAPTOP-UJ4M2HCE:/mnt/c/Users/marci/IdeaProjects/comm$ md5sum package.json 
1377a1a91e3e2115d4e3960c22adf311  package.json
kowal@LAPTOP-UJ4M2HCE:/mnt/c/Users/marci/IdeaProjects/comm$ md5sum from3
1377a1a91e3e2115d4e3960c22adf311  from3
kowal@LAPTOP-UJ4M2HCE:/mnt/c/Users/marci/IdeaProjects/comm$ sls deploy --stage staging 

Serverless: [ LayersPlugin ]: => common
... ○ Downloading __meta__/manifest-settings.json from bucket...
... ○ Downloading package.json from bucket...
... ○ Comparing package.json dependencies...
... ○  Changes identified ! Re-installing...

On 1.x branch new layer was created only if there was a change in a package.json file

My config:

custom:
  serverless-layers:
    - common:
        packageManager: npm
        dependenciesPath: package.json
        layersDeploymentBucket: 2wayapp-serverless-layers
        compatibleRuntimes: ['nodejs']
        compileDir: .serverless-layers/${self:service}

tried with
dependenciesPath: ./package.json
but no luck either

With SLS_DEBUG=true I was able to check if remote package.json file is correct (in fact I've used it to download remote file with aws s3 cli)

agutoli pushed a commit that referenced this issue Apr 20, 2020
@agutoli
Copy link
Owner

agutoli commented Apr 20, 2020

Please try serverless-layers@2.2.2. It should work fine now.

@marcinkowalczyk
Copy link
Author

Hi,
Looks fine with 2.2.2.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants