title: Jenkins: find build number for git commit
body: <p>Each commit to my git repo triggers a build of my Jenkins pipeline.</p>
  
  <p>I want to retrieve the buildNumber of an old build by commit hash. How can I do that?</p>
  
  <p>I know this information exists because I can find it in the UI.</p>
  
  <hr>
  
  <p>Some background as to why I want this: 
  When someone tags a commit I want to create a release (by tagging a docker image). Each build will push an image containing the build number. So I want to find out which build number corresponds to that commit so that I can find the image that I want to release.</p>