I have a mono repo with nested node apps. I install node and serverless globally and trying to put them in a cache. But when I try to use the cache (or even explicit global node_modules it fails)
<1s
+ /usr/local/lib/node_modules/serverless/bin/serverless deploy
bash: /usr/local/lib/node_modules/serverless/bin/serverless: No such file or directory
# This is a sample build configuration for JavaScript.
# Check our guides at https://confluence.atlassian.com/x/14UWN for more examples.
# Only use spaces to indent your .yml configuration.
# -----
# You can specify a custom docker image from Docker Hub as your build environment.
image: node:6.9.4
pipelines:
default:
- step:
caches:
- global-node
script: # Modify the commands below to build your repository.
- npm install serverless -g
- npm install serviceless -g
- serverless config credentials --provider aws --key $aws_secret_access_key --secret $aws_access_key_id
- parallel:
- step:
name: service-one..
caches:
- service-one-node
- service-one-serverless
script:
- cd ./backend/services/service-one
- npm install
- npm test
- /usr/local/lib/node_modules/serverless/bin/serverless deploy
- step:
name: service-two..
caches:
- service-two-node
- service-two-serverless
script:
- cd ./backend/services/service-two
- npm install
- npm test
- /usr/local/lib/node_modules/serverless/bin/serverless deploy
- step:
script:
- echo "we would deploy all here if all tests succeeded"
definitions:
caches:
global-node: /usr/local/lib/node_modules
service-one-node: ./backend/services/service-one/node_modules
service-one-serverless: ./backend/services/service-one/.serverless
service-two-node: ./backend/services/service-two/node_modules
service-two-serverless: ./backend/services/service-two/.serverless