How to commit changes after build

Hello. I wiant than bamboo commit changes after build. So I add script file like this:

'git commit -a -m "${bamboo.buildKey} ${bamboo.buildNumber}"

git push origin development'

 

But iot's not do it. Error is [detached HEAD 8943e60] So. This is simply question. How can i commit changes in bamboo task script job?

4 answers

That sounds like generally bad practice - what changes are you making to your source within your build that you want to commit back into source control?

It's not bad practice. Release version and build number.

Ok.  In the actual source?  Usually I've seen that as just tags, but I can see the use case for wanting it to be in the source as well.

I wrote a guide to tagging a commit and pushing it back to BitBucket.  I'll page a link as an answer - I think it should be easily adaptable to your situation.

I wrote this guide specifically for tagging a commit and pushing back to Stash (BitBucket), but it should be easily adaptable.  https://almfirst.wordpress.com/tagging-from-bamboo/

It's surprisingly not as simple as you'd think, as far as I've been able to figure out, because of the somewhat funky way that Bamboo does git and because the build may actually be running on an agent that doesn't share the SSH set up that the server itself uses.

Suggest an answer

Log in or Join to answer
Community showcase
Renan Battaglin
Published May 18, 2017 in Bamboo

FAQ: How to Upgrade Bamboo Server

Bamboo 5.9 will no longer be supported after June 12, 2017. What does this mean? As part of our End of Life policy, Atlassian supports major versions for two years after the first major iteratio...

1,096 views 0 5
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot