Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Problema with pipeline artifacts

julio_solvd August 16, 2018

Hello there!

So, I have the follow bitbucket-pipelines.yml

image: juliocsmelo/awscliandnode
pipelines:
  branches:
    master:
      - step:
          name: Lerna bootstrap
          image: node:8-alpine
          caches:
            - node
          script:
            - npm install -g yarn lerna
            - lerna bootstrap
          artifacts:
            - node_modules
      - step:
          name: Deploy web application
          caches:
            - node
          script:
            - sh deploy.sh web
      - step:
          name: Deploy storybook
          caches:
            - node
          trigger: manual
          script:
              # build and upload storybook to S3 bucket
              - sh deploy.sh storybook

When the first step is finished the artifacts node_modules that is a directory should be available to following steps. But is not happening. Why?

1 answer

2 votes
Philip Hodder
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 21, 2018

Hello Julio

Your current definition will only copy the node_modules directory. Not the contents itself. To have the entire directory and its files copied, you can change your configuration to:

artifacts:
- node_modules/**

The other issue is you have the node cache enable on all your steps, which caches the same directory. This will cause conflicts on file writes. So instead you can remove the caches on the second and third steps. i.e.

image: juliocsmelo/awscliandnode
pipelines:
  branches:
    master:
      - step:
          name: Lerna bootstrap
          image: node:8-alpine
          caches:
            - node
          script:
            - npm install -g yarn lerna
            - lerna bootstrap
          artifacts:
            - node_modules/**
      - step:
          name: Deploy web application
          script:
            - sh deploy.sh web
      - step:
          name: Deploy storybook
          trigger: manual
          script:
              # build and upload storybook to S3 bucket
              - sh deploy.sh storybook

Everything else looks like it should be good to go! :)

Thanks,

Phil

julio_solvd August 21, 2018

It worked! Thank you so much!

Like Shlomo Sfez likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events