Are you in the loop? Keep up with the latest by making sure you're subscribed to Community Announcements. Just click Watch and select Articles.

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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Copy files from repo to nodemodules of ci pipeline

I am trying to copy @jsplumbtoolkit @jsplumb libraries into node modules folder of ci pipeline on 2nd step and pass that node_modules to third step for angular build. But not able to.

please suggest changes on step two.

 

Angular pipeline :-

image: node:16

pipelines:
   branches:
      ci-cd-test-branch:

       - step:
             name: Installation
             caches:
                  - node
              script:
                  - npm install
              artifacts:
                  - node_modules/** # Save modules for next steps

        - step:
              name: copy jsplumb to node modules artifact
               script:
                   - cp -r @jsplumbtoolkit @jsplumb node_modules/

         - step:
              name: Build
              script:
                 - npm run build:prod
              artifacts:
                 - dist/** # Save build for next steps

2 answers

0 votes
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Feb 24, 2023

Hi @bb.admin!

Since node_modules/** is defined as an artifact in the first step only, only the contents of node_modules in the first step will be saved.

You have two options here:

  1. Either use the same artifacts definition in the second step as well
  2. Or combine the two steps into one, as Erez suggested

The second option might make more sense:

For every step in your bitbucket-pipelines.yml file, a Docker container starts based on the image you have specified, the Bitbucket repo is cloned in that container, then the commands of that step's script are executed, and eventually, the container gets destroyed. You may not want to use a separate step, and thus spin up a new container, only to execute a copy command.

If you have any questions, please feel free to let us know!

Kind regards,
Theodora

0 votes
Erez Maadani
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
Feb 23, 2023

Hey @bb.admin 

Try moving the copy to the first step.

Hope that helps 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events