An example fledge plugin demonstrating deploy, rollback, and post-lane hooks. Use this as a reference when building your own plugin.
fledge plugin install CorvidLabs/fledge-plugin-deployThis clones the repo into ~/.config/fledge/plugins/fledge-plugin-deploy/ and registers the commands and hooks from plugin.toml.
Deploys your project to the target environment.
fledge deploy # deploy to staging (default)
fledge deploy --env production --version v1.2.3
fledge deploy --dry-run # print steps without runningEnvironment variables:
| Variable | Default | Description |
|---|---|---|
DEPLOY_ENV |
staging |
Target environment |
DEPLOY_VERSION |
(latest) | Version/tag to deploy (required in prod) |
DRY_RUN |
false |
Print steps without executing |
Rolls back to the previous stable deployment.
fledge rollback # rollback staging with prompt
fledge rollback --env production --yesRuns automatically after every fledge lane completes. Prints a status line:
[fledge-deploy] lane:post — ✓ build [success] (run: abc123)
fledge injects FLEDGE_LANE_NAME, FLEDGE_LANE_STATUS, and FLEDGE_LANE_RUN_ID into the hook's environment.
fledge-plugin-deploy/
├── plugin.toml ← manifest: name, version, commands, hooks
├── bin/
│ ├── fledge-deploy ← executable for `fledge deploy`
│ └── fledge-rollback ← executable for `fledge rollback`
└── hooks/
└── lane-post ← runs on lane:post event
[plugin]
name = "fledge-plugin-deploy"
version = "0.1.0"
description = "..."
author = "CorvidLabs"
[[commands]]
name = "deploy"
binary = "bin/fledge-deploy" # relative to plugin root
[[commands]]
name = "rollback"
binary = "bin/fledge-rollback"
[[hooks]]
event = "lane:post"
binary = "hooks/lane-post"- Fork or copy this repo
- Edit
plugin.toml— changename, add your commands and hooks - Replace the scripts in
bin/andhooks/with your logic - Tag your repo with the
fledge-plugintopic so it shows up infledge plugin search - Publish: anyone can install with
fledge plugin install <owner>/<repo>
See the fledge plugin docs for the full manifest reference and hook event list.
MIT