Prelaunch & Uplinks
Mothership fails fast: before a single ship launches, it verifies that external dependencies are reachable (uplinks) and runs your setup tasks (prelaunch jobs). If either fails, the launch aborts.
Execution order
Section titled “Execution order”- Uplinks are verified (if configured)
- Prelaunch jobs run in dependency order
- Ships and bays launch
Uplinks
Section titled “Uplinks”Uplinks are pre-flight connectivity checks for databases, caches, and services your fleet depends on:
[[mothership.uplinks]]url = "postgres://localhost:5432/mydb"name = "postgres"
[[mothership.uplinks]]url = "$DATABASE_URL" # env var expansionname = "primary-db"timeout = "10s" # default: 5s
[[mothership.uplinks]]url = "redis://cache.internal:6379"name = "redis"Supported schemes
Section titled “Supported schemes”| Scheme | Default port | Check |
|---|---|---|
postgres://, postgresql:// |
5432 | TCP |
mysql:// |
3306 | TCP |
redis:// |
6379 | TCP |
memgraph://, neo4j:// |
7687 | TCP |
http://, https:// |
80/443 | HTTP GET |
tcp:// |
required | TCP |
Deduplication
Section titled “Deduplication”Uplinks sharing the same host:port are checked only once:
# These share the same server — only one TCP check happens[[mothership.uplinks]]url = "postgres://localhost:5432/app_production"name = "primary"
[[mothership.uplinks]]url = "postgres://localhost:5432/app_replica"name = "replica"Checking uplinks from the CLI
Section titled “Checking uplinks from the CLI”mothership preflight # validate manifest + verify uplinks (needs network access)mothership clearance # offline manifest validation onlypreflight requires network access to the configured uplinks — running it on your laptop may fail if the uplinks are only reachable from the deployment environment.
Prelaunch jobs
Section titled “Prelaunch jobs”Prelaunch jobs run setup tasks — migrations, cache warmup, schema initialization — before any ship or bay starts. All jobs must complete successfully or the launch is aborted.
[[mothership.prelaunch]]name = "ar-migrate"command = "rails"args = ["db:migrate"]
[[mothership.prelaunch]]name = "memgraph-migrate"command = "./migrate-memgraph"depends_on = ["ar-migrate"] # runs after ar-migrate completes| Field | Type | Default | Description |
|---|---|---|---|
name |
string | required | Unique identifier |
command |
string | required | Command to execute |
args |
string[] | [] |
Command arguments |
env |
table | {} |
Environment variables |
depends_on |
string[] | [] |
Other prelaunch jobs to wait for |
If any prelaunch job exits non-zero, the entire launch is aborted.
Deploying the same manifest across multiple servers? Use Flagship so migrations run on exactly one instance.