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,638,946
Community Members
 
Community Events
196
Community Groups

Put the build number into file.

I want to create "revision.txt" file with a build version in the root of my web application. Something like this:

{code}

echo -e "Build: ${bamboo.planRepository.branch}_${bamboo.buildNumber}\nBuild-Time: ${bamboo.buildTimeStamp}\n" >> target/release.txt

{code}

I tried to redirect the output of echo using

{code}

>> target/release.txt

{code}

but it doesn't work. Bamboo just prints ">> target/release.txt" to console.

1 answer

1 accepted

5 votes
Answer accepted
Vani
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Sep 19, 2021 • edited

Hi Rodion,

May I know more details on this issue, e.g., in which environment  Bamboo is running, screenshot or details on how the task was created?

 I did a quick test on the command you have given. Would you mind checking the below sample?

image-20210917-191946.png

Build logs.

simple 18-Sep-2021 05:20:13 Finished task 'output release' with result: Success00

And the file was created in the target directory.

> cat /opt/Bamboo_7_db/bamboo_7_home/local-working-dir/BAM-TES-JOB1/target/release.txt 2
Build: master_50 3
Build-Time: 2021-09-18T05:13:16.064+10:00    

 

For creating task refer: https://confluence.atlassian.com/bamboo/script-289277046.html 

 

Thank you for a hint. My mistake was, that I created the task as a Command Task and not as a Script Task. I converted it to a script and it works smoothly.

Like # people like this
Vani
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Sep 23, 2021

Hi Rodion,

Happy to hear it worked.

Thanks

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events