Every time after building and pushing docker image from Gitlab registry to Heroku registry I need to execute heroku container:release web
to Heroku run image (release), but I wanna automate this
I added heroku CLI tool installation into gitlab-ci-yml
, but I can't auth heroku CLI by token
When I try to set HEROKU_API_KEY=token and run heroku login
I get an error Error: Cannot log in with HEROKU_API_KEY set
Also tried to do this with HEROKU_DEBUG on, but debugger info couldn't help me
I can't use ~/.netrc
Any way to auth heroku CLI or automate releasing docker images in heroku?
current gitlab-ci.yml:
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 & push lines
- heroku container:release web