Skip to content

Generate per-game docker-compose examples from structured game data (e.g. ports) #161

Open

Description

@dgibbs64

Idea

Generate each game's docker-compose example (and Dockerfile, where useful) from richer per-game data, so the examples are correct for that game out of the box. For example, publish the game's default ports rather than a generic example.

Today

generate-dockerfiles.sh and generate-docker-compose.sh read LinuxGSM's serverlist.csv, which has only four fields per game: shortname, server name, game name and distro. The templates get those as separate environment variables, so there is nothing game-specific to put in the compose examples beyond the name and image tag.

Possible approach

  • Build one structured record per game (for example JSON). Start with the four serverlist.csv fields, and add data read from LinuxGSM, such as default ports from lgsm/config-default/config-lgsm/<shortname>server/_default.cfg.
  • Pass each game's record to the Jinja templates as one object (game.shortname, game.ports, and so on).
  • Keep the publish workflow's matrix as a list ({"include":[{"shortname":"..."}]}), the dockerfiles/Dockerfile-<shortname> names, and the ghcr.io base image.

Background

#103 (B13rg, 2024) started the refactor towards per-game JSON records but stopped before adding any new data, and it no longer fits the current generator and workflow. Its JSON conversion with yq and its game.* template variables are a useful starting point.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions