title: Jenkins CI deploying docker image on Heroku
body: <p>I have a Jenkins CI and use it to build (mvn) and containerize (docker) my app using Jenkins scripted pipeline. Lastly, I want to deploy my container to Heroku dyno (I have already created an app). </p>
  
  <p>I have followed this documentation <a href="https://devcenter.heroku.com/articles/container-registry-and-runtime" rel="nofollow noreferrer">https://devcenter.heroku.com/articles/container-registry-and-runtime</a> and have been successfully pushed my docker image to registry.heroku.com/sunset-sailing-4049/web. </p>
  
  <p>The issue is since this announcement <a href="https://devcenter.heroku.com/changelog-items/1426" rel="nofollow noreferrer">https://devcenter.heroku.com/changelog-items/1426</a> I now need to explicitly execute "heroku container:release web" in order to get my docker container running from registry to app dyno. This is where I am royally stuck. See my below issues:</p>
  
  <ol>
  <li><p>Heroku is not recognized by Jenkins. (My Jenkins is running on ec2, I have installed heroku toolbelt as ec2-user user. But Jenkins throws error: heroku: command not found). How do I resolve this issue?</p></li>
  <li><p>How to do "heroku login" from Jenkins, since the login command prompts for browser login. I have added ssh key but I do not know how to use it from the command line, hence Jenkins "shell script"</p></li>
  </ol>
  
  <p>The only other way I could think of is deploying via heroku pipeline using a dummy git repo onto which Jenkins will upload the source code on a successful build.</p>
  
  <p>Would really appreciate your help solving the above 2 issues.</p>
  
  <p>Thanks in Advance.</p>