Skip to content

Project Configuration (.pilum.yml)

.pilum.yml holds settings that apply to the whole project rather than one service. It is optional.

Don’t confuse the two files:

FileScopeLocation
pilum.yamlOne serviceIn each service directory, found by discovery
.pilum.ymlWhole projectThe directory you run Pilum from

Pilum reads .pilum.yml from the current working directory only. It does not search parent directories, so run Pilum from the directory that holds it (normally the project root).

Pilum reads two sections:

.pilum.yml
webhooks:
- url: https://hooks.slack.com/services/T000/B000/XXXX
events: [success, failure]
compose:
dependencies:
- type: postgres
secrets: [DATABASE_URL]
- type: redis
secrets: [REDIS_URL]

Webhooks

webhooks is a list of HTTP endpoints that receive a JSON POST when a pipeline starts and when it finishes.

webhooks:
- url: https://hooks.slack.com/services/T000/B000/XXXX
events: [success, failure]
- url: https://ci-events.example.com/pilum
# no events: receives start, success and failure
FieldTypeDefaultDescription
urlstring-Endpoint to POST to. Entries without a url are skipped
eventslistall eventsAny of start, success, failure

When webhooks fire

Webhooks fire for pilum deploy, build, publish, push and dry-run (including --dry-run). start is sent after services are discovered and the lock is taken, before the first step. success or failure is sent when the pipeline ends. rollback, status, logs and the other commands don’t send webhooks.

Payload

{
"event": "success",
"command": "deploy",
"tag": "v1.0.0",
"services": ["api", "worker"],
"duration": "1m23s",
"success": true,
"text": "deploy completed for 2 service(s) in 1m23s"
}
FieldDescription
eventstart, success or failure
commanddeploy, build, publish, push or dry-run
tagThe --tag value; empty when no tag was passed
servicesNames of the services in the run (a multi-region service appears once per region)
durationRun time rounded to the second, e.g. 41s. Omitted on start
successtrue for start and success, false for failure
errorError message. Present only on failure
textOne-line human-readable summary

The text field means Slack-style incoming webhooks display a readable message without extra configuration.

Delivery

  • Requests use Content-Type: application/json and User-Agent: pilum-webhook, with a 10-second timeout.
  • https is required. Plain http is allowed only for localhost, 127.0.0.1 and ::1.
  • Private and link-local addresses (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, 169.254.0.0/16, 127.0.0.0/8, fc00::/7, fe80::/10) are refused, including hostnames that resolve to them. Redirects are not followed.
  • A failed or rejected webhook prints a warning. It never fails the run.

For GitHub commit statuses, use --github-status instead; see Environments & CI.

Compose Dependencies

compose.dependencies declares the infrastructure (databases, caches) that pilum compose adds to the generated docker-compose.yml alongside your services.

compose:
dependencies:
- type: postgres
name: db
database: payments
secrets: [DATABASE_URL]
- type: redis
secrets: [REDIS_URL]
- type: custom
name: nats
image: nats:2.10
port: 4222
healthcheck: "wget -qO- http://localhost:8222/healthz"
FieldTypeDefaultDescription
typestring-Required. postgres, mysql, mariadb, redis, mongo or custom
namestringtypeCompose service and container name
imagestringpreset imageImage to run. Required for custom
portintpreset portPublished as <port>:<port>
userstringappuserDatabase user (not used by redis)
passwordstringapppasswordDatabase password (not used by redis)
databasestringappdbDatabase name (not used by redis)
healthcheckstringpreset commandHealth check command (CMD-SHELL)
environmentmap-Extra environment variables for the container
secretslist-Service secret names this dependency satisfies

Presets

typeImagePortConnection string injected
postgrespostgres:15-alpine5432postgresql://user:password@name:port/database?sslmode=disable
mysqlmysql:8.03306mysql://user:password@name:port/database
mariadbmariadb:113306mysql://user:password@name:port/database
redisredis:7-alpine6379redis://name:port
mongomongo:727017mongodb://user:password@name:port/database
customyour imageyour portnone

Each preset gets a named data volume and a health check; postgres also mounts ./init-scripts into /docker-entrypoint-initdb.d.

Wiring services to dependencies

secrets connects dependencies to services by secret name. When a service’s pilum.yaml declares a secret listed under a dependency’s secrets, the generated compose file:

  • sets that environment variable to the dependency’s connection string, and
  • adds a depends_on on the dependency with condition: service_healthy.
services/api/pilum.yaml
secrets:
DATABASE_URL: database-url:latest # becomes postgresql://appuser:apppassword@db:5432/payments?sslmode=disable

A malformed entry (missing type, unknown type, custom without image) makes pilum compose fail with the entry’s index. See Local Development for the rest of pilum compose.

Flag Defaults and Environment Variables

Flag names with a hyphen (only-tags, max-workers, dry-run) can’t be set from a shell variable, but they can be set as .pilum.yml keys. Other keys in .pilum.yml are ignored.

Next Steps