title: heroku CLI auth by token
body: <p>Every time after building and pushing docker image from Gitlab registry to Heroku registry I need to execute <code>heroku container:release web</code> to Heroku run image (release), but I wanna automate this  </p>
  
  <p>I added heroku CLI tool installation into <code>gitlab-ci-yml</code>, but I can't auth heroku CLI by token<br>
  When I try to set HEROKU_API_KEY=token and run <code>heroku login</code> I get an error <code>Error: Cannot log in with HEROKU_API_KEY set</code><br>
  Also tried to do this with HEROKU_DEBUG on, but debugger info couldn't help me<br>
  I can't use <code>~/.netrc</code>  </p>
  
  <p><strong>Any way to auth heroku CLI or automate releasing docker images in heroku?</strong></p>
  
  <p>current gitlab-ci.yml:</p>
  
  <pre><code>before_script:
      - apt install snapd
      - snap install --classic heroku
      - HEROKU_API_KEY=$HEROKU_API_TOKEN heroku login
      - docker login -u $REGISTRY_UNAME -p $REGISTRY_PWD registry.gitlab.com
      - docker login --username=_ --password=$HEROKU_PWD registry.heroku.com
  script:
      # a lot of tag &amp; push lines
      - heroku container:release web
  </code></pre>