Skip to content

Featured Mod Auto Deployment

Brutus5000 edited this page Jul 23, 2019 · 1 revision

Prerequisites

  • The featured mod is hosted on a public GitHub repository
  • A server admin has permissions to setup webhooks. (Preferably the repo is hosted inside the FAForever project)
  • The repository contains a file mod_info.lua in the root directory.

Limitations

  • Auto deployment of stuff outside git (models, textures, videos, sounds) is not possible.

Deployment process

  • A push to a dedicated deployment branch triggers a webhook calling the API at https://api.faforever.com/gitHub/webhook . The call contains a secret configured in the java api environment and a payload describing the push (e.g. the referenced commit).
  • The API validates the secret.
  • The API looks up for auto deployment setting of the featured mod (table game_featuredMods)
    • The git url and the git branch must match a record in the table.
    • If no match is found, throw an error.
    • If featured mod is known, but the version already exists, error (unless allow_override is active). This is being checked against the updates_{featured_mod}_files tables.
  • The API checks out the git repo at the given branch.
  • The API zips each subfolder into a zip file having the name of the subfolder + file extension from the featured mod table.
  • The files are copied to the featured mod patch directories with a version id <filename>.<version>.<extension>.
  • The new files are inserted into updates_{featured_mod}_files table along with their hash codes.
  • If setup in the featured mod table, a webhook is invoked after the deployment.
  • Edge case: The ForgedAlliance.exe is patched for fa / fabeta / fadevelop (hardcoded)