Hello again from serverdude. Since it’s cold season and i stay warm and cozy more at my desk at home i decided to remember my childhood and tackle on a new project involving old game server with modern deploying techniques.
The thing i am talking about is Counter strike 1.6, Kreedz mod.
Many hours of my childhood were spent climbing and jumping in various maps. A game mode which does not result in any violence and has a loving community up to this day.
To begin, i wanted to have separate environments – staging and prod, where i could test new settings, plugins, maps and other components without breaking the production. I had a plan to make changes with CI/CD just like in real world application deployments are done. The DevOps way.
My setup involves :
- 1 local server[staging]
- 1 cloud server[prod]
- local Gitlab runner
- Gitlab CI/CD to deploy changes
- Everything Linux
Game uses static files which do not change. The only things that change and are different in each environment are configs(IPs, names, database credentials, plugin configs) and of course pre-production changes like new maps,models, plugins and so on.
Having this in mind i made a git repository containing static game files in one directory and configs in separate staging and prod directories which my Gitlab CI/CD is utilizing via templating. Rsync was the perfect candidate for this job since it needed to sync only changed files inside servers and not copy everything over when 1 thing changes. This saved precious bandwidth and made pipelines run faster.
One other Gitlab setting which made the job run faster is default caching function on repository. This setting caches the content and basically increments changes on top. Therefore in my case each job didn’t need to download 500MB++ repository every time.
Now that everything is set-up in game mode settings the only things that will change will be new maps,models,sounds increasing my repository size and utilizing rsync to deploy new maps to game servers.
In the final result we can see that job is completed in 34 seconds, in this case removing a map. This includes downloading repo(using cache) and syncing only changes in server.
So Hooray, the server is alive, changes are being deployed without breaking anything and pretty fast if you ask me.
For this project i really wanted to try GitHub Actions since i work with Gitlab but it seems that GitHub Free plan has some strict permissions on repository size and limits on transferred bandwidth and GitLab Free is much more flexible in this case, well next time or for some simpler things, i guess.
I hope you enjoyed some of my thoughts and maybe they will inspire you to create new things or maybe try Kreedz mode yourself. Cheers.