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
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 onYou 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
muster skill create my-skill # scaffolds skill.json and run.sh
muster skill run my-skill # run it by hand while you work on itmy-skill/
├── skill.json
├── run.sh
└── lib/ optional helpers{
"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 }
]
}#!/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>withskill.jsonandrun.shat the root. Anyone can install it withmuster skill add <url>. - The official registry: fork Muster-dev/muster-skills, add your skill folder and a
registry.jsonentry, and open a pull request.
Reference
skill.json fields
| Field | Description |
|---|---|
name | Required. Unique identifier. |
version | Required. Semver, e.g. 1.0.0. |
description | Required. One line. |
author | Name or GitHub handle. |
hooks | Events to run on, e.g. ["post-deploy"]. |
requires | Commands the skill needs, e.g. ["curl", "jq"]. |
config | Values to ask for: key (the env var run.sh reads), label, hint, secret (masked input). |
Events
| Event | When |
|---|---|
pre-deploy | Before each service deploys. |
post-deploy | After each service: success, failed or skipped. |
pre-rollback | Before a service rollback. |
post-rollback | After a service rollback. |
fleet-deploy-start, fleet-deploy-end | Around a fleet deploy. |
fleet-machine-deploy-start, fleet-machine-deploy-end | Around each server in a fleet deploy. |
fleet-rollback-start, fleet-rollback-end | Around a fleet rollback. |
Variables
| Variable | Description |
|---|---|
MUSTER_SERVICE | Service key. |
MUSTER_SERVICE_NAME | Display name. |
MUSTER_HOOK | The event, e.g. post-deploy. |
MUSTER_DEPLOY_STATUS | success, failed or skipped. |
MUSTER_PROJECT_DIR | Project root. |
MUSTER_CONFIG_FILE | Path to muster.json. |
MUSTER_FLEET_NAME, MUSTER_FLEET_MACHINE, MUSTER_FLEET_HOST | Fleet events: fleet, server name, host. |
MUSTER_FLEET_STRATEGY, MUSTER_FLEET_MODE | Fleet events: sequential, parallel or rolling; deploy mode. |