OpenGrok / docker

WARNING: this repository is archived !
58 stars 31 forks source link

Tagging Docker image with OpenGrok version? #26

Closed dhose closed 5 years ago

dhose commented 5 years ago

It would be nice if the resulting Docker image is also tagged with the actual OpenGrok version and not just latest.

Thanks!

vladak commented 5 years ago

I'd like to have this capability as well. Build rules in Docker settings allow to tag images based on repository tag however this would not work in our case as the Docker repository is not the OpenGrok main repository and hence it is not tagged.

vladak commented 5 years ago

https://stackoverflow.com/questions/38993182/how-to-tag-an-image-in-a-dockerfile answers (negatively) the same question I had.

Folding this repository into the main OpenGrok repository would solve the problem (and also would remove the awkward hook that triggers Docker builds).

vladak commented 5 years ago

Actually, it might be possible to push the image to Docker hub from Travis build (recently added) - https://docs.travis-ci.com/user/docker/

vladak commented 5 years ago

The problem with the previous approach is that all build would have to happen in Travis so they are properly tagged. Currently there is a webhook setup on Github to trigger builds on Docker hub. It would have to be replaced by Github webhook to Travis. It is possible to trigger builds in Travis (https://docs.travis-ci.com/user/triggering-builds/) however that seems to require custom JSON payload and custom HTTP headers which is not currently possible with Github webhooks (https://developer.github.com/v3/repos/hooks/).

vladak commented 5 years ago

One possibility would be to trigger the OpenGrok/docker Travis build from oracle/OpenGrok Travis build.

vladak commented 5 years ago

Looks like this is working.