Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Find undeployed commits

Tom Allen August 14, 2018

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. 

1 answer

0 votes
Aaron
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 15, 2018

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

Tom Allen August 16, 2018

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

Aaron
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 17, 2018

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

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events