-
-
Notifications
You must be signed in to change notification settings - Fork 10
Deployment
The auto-deployment relies on basic two Github API mechanisms:
- Github webhooks allow catching of push and deployment-events and dispatch them to our own api. See here for further explanation.
- Github deployments allow composing own integrated deployment logic. See here for further explanation.
Each repository that is supposed to perform some kind of auto-deployment needs to add a webhook to the api (or two if we want to deploy to testing and production separately). The webhook is setup to catch push and deployment events. These events are passed to https://api.faforever.com/deployment/github.
On each push the api looks for a matching configuration for the affected repository and branch. The push event contains information about the last commit. A deployment is invoked if the commit contains the message Deploy: <environment> (enforced deployment) or if the configuration is setup for auto-deployment. In either case the FAF api creates a deployment via the Github api for this repository. This in return fires the webhook again, this time with a deployment event.
On each deployment the api looks (again) for a matching configuration for the affected repository and branch. If it finds one, the actual configuration will perform the deployment on the FAF servers. After the deployment is finished the Github deployment gets the stats success and a Slack message is created in channel #github.
- The affected repository and branch gets checked out
- The web service gets restarted.
- The affected repository and branch gets checked out
- It is checked, whether the version is already deployed and whether overwriting is allowed (otherwise it stops)
- The ForgedAlliance.exe gets patched to the right version.
- The mod files are built and copied to the correct featured-mod path
- The database entries are made.