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.

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 Sign up to answer
Community showcase
Posted Tuesday in Statuspage

Introducing Statuspage Getting Started guides! First up: What is Statuspage?

Over the next several weeks we'll be sharing some of our Getting Started guides here in the community. Throughout this series of posts, we'd love to hear from customers and non-customers ab...

181 views 4 1
Join discussion

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