Harha / trackmania-server-docker

Docker image for running a trackmania 2020 dedicated server easily
14 stars 5 forks source link

Automated build when pyplanet updates #4

Open Harha opened 3 years ago

Harha commented 3 years ago

We don't have a script for starting a new docker image build when pyplanet has been updated on pip.

I can add this check to my server as a cron job, like we already have a script for automated build trigger when TM2020 server latest zip is updated.

ineentho commented 3 years ago

Ok, I see. Another way of solving it could be to use something like renovate or dependabot to check for dependency updates and automatically create a commit when something is updated.

I'm using this technique on a few of my projects, for example: https://gitlab.henrik.ninja/kubetools/pgcli/-/commits/master. When a new version is available, a merge request is created: https://gitlab.henrik.ninja/kubetools/pgcli/-/merge_requests/61. A basic test is run, and if it succeeds it is automatically merged.

That may of course increase the complexity of the project a bit, but it offers a nice overview of why a new version was released.

If you are interested I could try to set something up for this project using github actions + renovate

Harha commented 3 years ago

Oh, well that would be way better I imagine! Feel free to set it up, I'll add you as a collaborator to this repository. :-) I'm personally more familiar with gitlab and mainly gitlab-ci, I don't know much about github and these bots but that seems nice indeed.

ineentho commented 3 years ago

Thanks for the invitation! I'll give it a try during the weekend. I'm also mostly used to gitlab/gitlab-ci, but given that this is hosted on github it's probably easier to use actions :)

Harha commented 3 years ago

Yeah, thanks in advance! I'll manually trigger a rebuild for the time being.

ineentho commented 3 years ago

I gave it a (quick) try, but it is complicated a bit by the fact that the trackmania server isn't available in any package registry, nor is it even easy to check the current version without downloading the whole zip.

We can keep this issue open if you want to, but it is more work than initially expected, so i may get to it later (or maybe never :()

Harha commented 3 years ago

Ah I see. Well I can look into it too whenever I have energy and time. I just started on a new job so maybe next weekend. :P

If the bots and whatnot are not flexible enough to handle the TM 2020 server case then we might have to leave that part to my server's cron job and use a bot just for the pyplanet image. But we'll see...

dgalli1 commented 3 years ago

I gave it a (quick) try, but it is complicated a bit by the fact that the trackmania server isn't available in any package registry, nor is it even easy to check the current version without downloading the whole zip.

We can keep this issue open if you want to, but it is more work than initially expected, so i may get to it later (or maybe never :()

If you guys ever try this again its possible to check for updates on the trackmania server by only downloading the headers. The header Last-modified seems to change whenever theirs an update. curl -s -I http://files.v04.maniaplanet.com/server/TrackmaniaServer_Latest.zip

Harha commented 3 years ago

I gave it a (quick) try, but it is complicated a bit by the fact that the trackmania server isn't available in any package registry, nor is it even easy to check the current version without downloading the whole zip. We can keep this issue open if you want to, but it is more work than initially expected, so i may get to it later (or maybe never :()

If you guys ever try this again its possible to check for updates on the trackmania server by only downloading the headers. The header Last-modified seems to change whenever theirs an update. curl -s -I http://files.v04.maniaplanet.com/server/TrackmaniaServer_Latest.zip

Good point. That's actually what my personal server does periodically with a cron-job and if it notices a change in the timestamp then it triggers a rebuild of this pyplanet image on dockerhub.

I overlooked that before in this thread even though I knew the answer. Though I'm not sure if those bots @ineentho was trying to configure stretch into this use-case.

ineentho commented 3 years ago

That's good to know. In theory it would be possible to have it as two steps: A bot that polls for updates and pushes a new tag to a mostly blank git repository, and then having renovate pick up the new tags.

It should be very doable, but it still feels a little bit overcomplicated