Closed edigaryev closed 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.
Perhaps https://martinrotter.github.io/it-programming/2016/08/26/pushing-git-travis/ would help.
Or just add the RESTful API call to docker to perform remote build trigger would be more straightforward.
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.
Tried to create automated build on hub.docker.com however it was stuck in 'Creating...' over night so I will try my luck later.
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.
Actually, this seems to have triggered the build on the hub.
But, only for vkotal/docker, not for OpenGrok/docker.
It looks like this change needs to be done by whomever owns https://hub.docker.com/r/opengrok/docker/
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..
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).
Got the permissions, enabled build trigger. From the build logs I can see 1.1-rc74 being downloaded.
Updated the webhook to be triggered only on releases.
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.
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).