OpenGrok / docker

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

Docker image builds aren't triggered by new OpenGrok releases #23

Closed edigaryev closed 5 years ago

edigaryev commented 5 years ago

The latest OpenGrok release was uploaded day ago, yet the latest image build was made 10 days ago.

It seems that Docker Hub won't build a new image unless it gets triggered remotely or someone updates the repo with Dockerfile (it's probably assumed that Dockerfile resides in the same repo as project most of the time, which is not the case).

vladak commented 5 years ago

Perhaps there is a way how to trigger commit into external repository (this one) from the oracle/opengrok deploy build stage in Travis.

vladak commented 5 years ago

Perhaps https://martinrotter.github.io/it-programming/2016/08/26/pushing-git-travis/ would help.

vladak commented 5 years ago

Or just add the RESTful API call to docker to perform remote build trigger would be more straightforward.

edigaryev commented 5 years ago

Or just add the RESTful API call to docker to perform remote build trigger would be more straightforward.

Yes, you can configure a GitHub repo to send HTTP requests when certain event happens (e.g. new release is published), and that HTTP request URL can be a Docker Hub's trigger URL as described above.

But I just realized that it probably won't be enough if Docker Hub caches image layers (it may skip the build if Dockerfile and it's dependencies haven't changed), but I'm not sure if this is the case.

vladak commented 5 years ago

Tried to create automated build on hub.docker.com however it was stuck in 'Creating...' over night so I will try my luck later.

vladak commented 5 years ago

Okay, this time the automated build was successfully created. However, it expects certain JSON payload to trigger the build and Github can only supply the payloads specific to events, in this case the push event (https://developer.github.com/v3/activity/events/types/#pushevent) and there does not seem to be a way how to change the payload.

vladak commented 5 years ago

Actually, this seems to have triggered the build on the hub.

vladak commented 5 years ago

But, only for vkotal/docker, not for OpenGrok/docker.

vladak commented 5 years ago

It looks like this change needs to be done by whomever owns https://hub.docker.com/r/opengrok/docker/

vladak commented 5 years ago

Okay, it's @tarzanek. I will try to enable the auto builds there as well however my vladak/docker does not seem to update the image so possibly we will have to go with the triggered push..

vladak commented 5 years ago

Or, maybe consider moving the dockerfile into the main repo and let Maven set its version during the normal release procedure (https://github.com/oracle/opengrok/wiki/Release-process).

vladak commented 5 years ago

Got the permissions, enabled build trigger. From the build logs I can see 1.1-rc74 being downloaded.

vladak commented 5 years ago

Updated the webhook to be triggered only on releases.

vladak commented 5 years ago

Seems like it's working - just created OpenGrok release 1.1-rc75, build was triggered on Docker hub with the webhook, docker pull gets the new image, docker container exec XYZ java -jar /opengrok/lib/opengrok.jar -V reports 1.1-rc75.