rfvgyhn / docker-avorion

Docker container for Avorion dedicated server
https://hub.docker.com/r/rfvgyhn/avorion
MIT License
25 stars 12 forks source link

[DevOps] automatic Workflow for container publish #21

Open lightlike opened 2 years ago

lightlike commented 2 years ago

This Repository needs an automatic Deploy job. I started testing and found a way of doing this. The pipeline can be found in my fork of this (https://github.com/lightlike/docker-avorion)

The job currently only pushes to ghcr but that should be changable with some credentials.

There are still two points I need to discuss.

1. How should versioning work?

My pipeline is currently only setting the tag of the container statically (e.g. stable/beta) It would be nice for compatibility to set the version for containers but this is only optional as this could bring instability.

This could be done using one of the following methods:

  1. set version as manual parameter (only manual triggering) or via a push
  2. get the version via https://api.steampowered.com/ISteamNews/GetNewsForApp/v2/?appid=445220&count=1&tags=patchnotes and grep

The second possibility is only as reliable as the posts from the dev team but would mean that the pipeline could run automatically.

2. Should this pipeline run automatically?

If the automatic versioning should be used. The build could run daily and the would be no maintanance except for errors. This would not be a Problem when using the free plan as you get 2,000 min/month and the pipeline currently takes one minute. This maybe could also be triggered using some e-mail hook or similar but that is not supported by github and one would need to run a third party tool for that.

rfvgyhn commented 2 years ago

I'd like to keep the full game version which I think rules out scraping patch notes. I currently get this from the server binary (AvorionServer --version). I'd also like the readme to be kept up to date automatically.

An automatic pipeline would be great though. Just a few ideas that could be worth looking into:

lightlike commented 2 years ago

I have the version working by just Running a steamcmd container and installing Avorion there. This will only get the current Version. I have tried to find any way of getting the version otherwise or downloading a depot using the steam API but no luck.

The last thing missing is the checking if the build has to run. I would try to use Tags or (Pre-)Releases for that. That would also allow to have the Readme static and let shields.io get the Version from the Releases. After that the Builds could just run Daily and not publish if there are no changes.

The only Problem, that I could see with that is that the version for the beta tag show the stable number if there is a stable release later than the beta. I have no idea if or when this could come up but I'll try some stuff.

lightlike commented 2 years ago

The Pipeline should be done. The only changes needed are some small ones like the shields.io links, the trigger and the login to docker hub if you do not want to use ghcr.

I had to change the way latest works because I need a static way to set the tags. So that now constantly links to stable. I already changed the Readme to reflect those changes.

Please look into my changes and tell me everything you might want changed.