I got project repository hosted on gitlab. I am using gitlab-ci to build docker container from my project. What I would like to achieve is deploying that container to heroku.
The reason for
"No such image: registry.gitlab.com/username/image:tag"
error is that tag source should be pulled beforehand. script block should include a docker pull
statement. The overall script block should be as follows:
script:
- docker login --email=_ --username=_ --password= registry.heroku.com
- docker pull registry.gitlab.com/maciejsobala/myApp:latest
- docker tag registry.gitlab.com/maciejsobala/myApp:latest registry.heroku.com/maciejsobala/myApp:latest
- docker push registry.heroku.com/maciejsobala/myApp:latest
Still this is not enough. Heroku changed its release policy so that pushing to Heroku Container Registry does not trigger a release anymore. Here is the extra command to fulfill the missing release task:
- docker run --rm -e HEROKU_API_KEY= wingrunr21/alpine-heroku-cli container:release web --app myApp