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
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
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.