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,556,178
Community Members
 
Community Events
184
Community Groups

How do we store artifacts in a folder created on same branch

vivek.gopalakrishnan
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
May 18, 2023

Hi Team, 

 My pipeline script is able to successfully build and an Artifact is available for download in the artifact section. however, I want to move the artifact to a folder in the same branch as a pipeline script. How do I do that?


- step:
name: Build React application
caches:
- node
script:
- npm rebuild node-sass
- npm run build-react
- npm run build-cicd
- export ARTIFACT_NAME=example-$(date +%Y-%m-%d-%H%M%S).tar.gz
- ls $ARTIFACT_NAME
- tar -xzvf $ARTIFACT_NAME -C artifacts-dev/
artifacts:
- artifacts-dev/*

1 answer

0 votes
Patrik S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 19, 2023

Hello @vivek.gopalakrishnan and welcome to the community!

My understanding is that you would like to push the artifact back to your repository during your pipeline build. It's possible to push changes back to the repository by committing the changes and doing a git push : 

step:
  nameBuild React application
caches:
node
script:
npm rebuild node-sass
npm run build-react
npm run build-cicd
export ARTIFACT_NAME=example-$(date +%Y-%m-%d-%H%M%S).tar.gz
ls $ARTIFACT_NAME
tar -xzvf $ARTIFACT_NAME -C artifacts-dev/
- git add $ARTIFACT_NAME # adding the artifact to the staging area
- git commit -m "[skip ci] saving artifact to the repository"
- git push

The [skip ci] flag in the commit message is for this push to not trigger a new build, otherwise, the builds could enter a loop state. It's important to note that pushing artifacts directly to the repository is not a good practice, as this will start to inflate the repository size and you can reach the repository size limits of 4GB, which would put your repository in read-only mode.

If your goal is to store the artifacts for more than 14 days, you can either upload it to a third-party storage solution or upload it to the Downloads section of your repository by using the bitbucket cloud API endpoint below : 

Files uploaded as a Download artifact are available by navigating to the repository and selecting the Downloads option in the left side panel.

Hope that helps! Let me know in case you have any questions.

Thank you, @vivek.gopalakrishnan !

Patrik S

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events