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

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,459,770
Community Members
 
Community Events
176
Community Groups

Using build files from docker container in other pipeline steps

In the first step in my pipeline, I am building my application with docker and deploying it to AWS ECR. However, in a follow up step, I would like to use those same build files I uploaded to AWS for a shell script. They need to be the same files I uploaded because each `npm run build` creates different hashed file names. How can I export the build folder from step 1 to use in future pipeline steps?

 

- step: &build-staging
name: Build and publish docker image
services:
- docker
caches:
- docker
script:
- docker build -t web . #/dist folder gets created and uploaded to AWS
- pipe: atlassian/aws-ecr-push-image:1.4.2

- step: &upload-source-maps-staging
name: Upload source maps
script:
- npm ci
- /bin/bash upload-source-maps.sh #I want to use the /dist folder created in the build-staging step above

 

1 answer

0 votes

Hi James and welcome to the community!

If the dist folder is created in the clone directory, then you can define it as an artifact so that its contents become available for the next step. You can do this the following way:

- step: &build-staging
name: Build and publish docker image
services:
- docker
caches:
- docker
script:
- docker build -t web . #/dist folder gets created and uploaded to AWS
- pipe: atlassian/aws-ecr-push-image:1.4.2
artifacts:
- dist/**

You can check the following documentation page for more info:

Keep in mind that the step that generates the artifact and the steps that use it cannot be parallel steps.

Please feel free to let me know how it goes and if you have any questions.

Kind regards,
Theodora

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events