Shared server and production
Deploy, rollback and team roles
How a deploy protects the production database, what happens when a migration fails, and who can run production.
A deploy sends the current state of the shared server to production as a new release. You do it in the studio: status bar → Shared server → Production.
Before a deploy
The studio checks the files named in fxmanifest.lua. Production runs on Linux, which tells letter case apart: Config.lua in the manifest and config.lua on the disk work on Windows, and the resource fails on the server. Such a file is listed in Problems and stops the deploy until the names match.
Migrations and the database
Files in db/migrations run on the production database, each once. Before the agent runs new migrations:
- it copies the production database (
backups/on the server, the last ten are kept); - it runs the migrations;
- if one fails, it restores the database from the copy and starts the previous release. The new release stays in the list with the error.
The database is then exactly as before the deploy, and players keep playing on the previous version.
Stop and restart
Before production stops, the agent sends the server’s scripts the txAdmin:events:serverShuttingDown event, which many packages wait for to save players, vehicles and stashes. Packages that do not listen to it save through their adapters (the server.saveAll capability). Only then does the server close.
Rollback
Any earlier release in the list can run again. The server keeps the last ten releases; older ones leave the disk and their description stays in the history.
Team roles
| Role | Can |
|---|---|
| owner | everything, including invites, roles and new production instances |
| administrator | runs production: start, stop, restart, console, deploy, rollback |
| dev | works on the development server; cannot stop production or use its console |
The owner gives the role in the Team tab. The production console runs any command on a server people play on, so a dev does not get it.