6. Deploy and changes
Goal: Roll out a change to hello, use dry-run to preview actions, and verify on the worker.
Prerequisites: Chapter 5 — Build (version bumped to 1.0.1).
Step 1 — Preview with dry-run
maand deploy --dry-run
Dry-run shows what deploy would do per allocation: start, restart, reload, sync, or skip. For an upgrade after a version bump, expect restart on hello.
Step 2 — Deploy the change
maand deploy
Deploy rsyncs updated files and runs make restart on upgraded allocations (default restart_policy: always).
Inspect rollout state:
maand cat deployments --jobs hello
Step 3 — Verify on the worker
maand run_command "cat /opt/maand/*/jobs/hello/data/status"
maand run_command "tail -1 /opt/maand/*/jobs/hello/logs/start.log"
After restart, data/status should still show running and start.log has a new line.
Step 4 — Deploy one job only
maand deploy --jobs hello
Useful when the bucket has many jobs but you only changed one.
When deploy skips an allocation
Deploy compares content hashes per allocation. If nothing changed and version matches, the allocation is skipped unless you pass --force.
maand deploy --dry-run # see skip vs restart before running
If deploy fails partway, fix the issue and run maand deploy again — maand resumes incomplete work.
Guide: debugging deploy. Reference: deploy.
What you learned
- Upgrades run
make restartby default after rsync --dry-runpreviews per-allocation actionsmaand cat deploymentsshows hash and version state
Next
Chapter 7 — Placement: add a second worker and run hello on both.