Skills

Skills

Skills are addons that run on deploy and rollback events: Slack and Discord notifications, webhooks, monitoring. A skill is a folder with a skill.json manifest and a run.sh script.

Install and enable a skill

Terminal
muster skill marketplace discord   # browse and install from the registry
muster skill configure discord     # webhook URL, API keys…
muster skill enable discord        # run it on its hooks from now on

You can also install from a git URL or a local path with muster skill add. A muster-skill- prefix is dropped from the name, so muster-skill-ssl installs as ssl. Skills are per project (.muster/skills/) unless you pass --global (~/.muster/skills/).

Skills never block a deploy: a failing skill prints a warning and the deploy carries on. On a failed deploy, post-deploy skills run straight away with MUSTER_DEPLOY_STATUS=failed, so notifications go out before you pick a recovery option.

Write a skill

Terminal
muster skill create my-skill    # scaffolds skill.json and run.sh
muster skill run my-skill       # run it by hand while you work on it
Skill folder
my-skill/
├── skill.json
├── run.sh
└── lib/          optional helpers
skill.json
{
  "name": "my-skill",
  "version": "1.0.0",
  "description": "Post deploy results to a webhook",
  "hooks": ["post-deploy", "post-rollback"],
  "requires": ["curl"],
  "config": [
    { "key": "WEBHOOK_URL", "label": "Webhook URL", "secret": true }
  ]
}
run.sh
#!/usr/bin/env bash
set -euo pipefail

curl -fsS -X POST "$WEBHOOK_URL" \
  -d "{\"service\":\"$MUSTER_SERVICE\",\"status\":\"$MUSTER_DEPLOY_STATUS\"}"

muster skill configure saves values to config.env in the skill folder, which is loaded before run.sh. Exit 0 means success.

Publish a skill

  • Your own repository: name it muster-skill-<name> with skill.json and run.sh at the root. Anyone can install it with muster skill add <url>.
  • The official registry: fork Muster-dev/muster-skills, add your skill folder and a registry.json entry, and open a pull request.

Reference

skill.json fields

FieldDescription
nameRequired. Unique identifier.
versionRequired. Semver, e.g. 1.0.0.
descriptionRequired. One line.
authorName or GitHub handle.
hooksEvents to run on, e.g. ["post-deploy"].
requiresCommands the skill needs, e.g. ["curl", "jq"].
configValues to ask for: key (the env var run.sh reads), label, hint, secret (masked input).

Events

EventWhen
pre-deployBefore each service deploys.
post-deployAfter each service: success, failed or skipped.
pre-rollbackBefore a service rollback.
post-rollbackAfter a service rollback.
fleet-deploy-start, fleet-deploy-endAround a fleet deploy.
fleet-machine-deploy-start, fleet-machine-deploy-endAround each server in a fleet deploy.
fleet-rollback-start, fleet-rollback-endAround a fleet rollback.

Variables

VariableDescription
MUSTER_SERVICEService key.
MUSTER_SERVICE_NAMEDisplay name.
MUSTER_HOOKThe event, e.g. post-deploy.
MUSTER_DEPLOY_STATUSsuccess, failed or skipped.
MUSTER_PROJECT_DIRProject root.
MUSTER_CONFIG_FILEPath to muster.json.
MUSTER_FLEET_NAME, MUSTER_FLEET_MACHINE, MUSTER_FLEET_HOSTFleet events: fleet, server name, host.
MUSTER_FLEET_STRATEGY, MUSTER_FLEET_MODEFleet events: sequential, parallel or rolling; deploy mode.