We are using BitBucket Server for source and Bamboo Server for builds and deployment. I'm trying to work out via the API's if it is possible to find all the commits on the default branch of a given repo that have been made since the last time that repo was successfully deployed.
I can get bits out of the API's such as commits for a repo, build plans and deployments, but can't seem to figure out how join the pieces up.
Hello Tom,
Welcome to the Atlassian Community!
It might be easier to use Git instead of the API in this situation (on the Bitbucket Server side anyway). If you can get the bamboo_planRepository_X_revision hash through the Bamboo API you can just run a git diff in any local copy of the repository that has the change (if you are planning on doing this with a script you can have a clone of the repository or simply run the script from the directory where the deployment build was run).
git diff <revision hash of the deployed instance> origin/<name of the branch you are checking against>
It will have a list of all of the changes and the last characters in the hash (more than enough to find any commit you are looking for). It'll be on the line with index <some hash>..<hash of the committed change>
That should get what you are looking for! Let me know if you have any other questions.
Regards,
Aaron Levinson
Dev Tools Support Engineer
P.S I love the Hobbes picture :D
Thanks for the reply. I did consider that, the only issue is that i'm trying to create a report which wont necessarily run somewhere that can pull the repos locally. I have managed to get pretty much what i need via the Bitbucket + Bamboo APIs but the thing I'm still missing is how to link a Bamboo deployment to the repo. I figure there must be something linking Deployment > Build Plan and then something that links Build Plan > Repo, but I just can't figure it out.
And thanks! <3 Calvin and Hobbes
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Well, there is this endpoint that has the plankey value for the build plan coming from the deploy. There is this other thread as well that might be helpful too! I must admit, I'm on the Fisheye/Bitbucket side of things. So it'll take me a bit longer to find the Bamboo info, but I appreciate the patience!
Regards,
Aaron Levinson
Dev Tools Support Engineer
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.