Skip to content

CorvidLabs/fledge-plugin-deploy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fledge-plugin-deploy

An example fledge plugin demonstrating deploy, rollback, and post-lane hooks. Use this as a reference when building your own plugin.

Install

fledge plugin install CorvidLabs/fledge-plugin-deploy

This clones the repo into ~/.config/fledge/plugins/fledge-plugin-deploy/ and registers the commands and hooks from plugin.toml.

Commands

fledge deploy

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 running

Environment 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

fledge rollback

Rolls back to the previous stable deployment.

fledge rollback                   # rollback staging with prompt
fledge rollback --env production --yes

Hooks

lane:post

Runs 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.

Plugin structure

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.toml reference

[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"

Building your own plugin

  1. Fork or copy this repo
  2. Edit plugin.toml — change name, add your commands and hooks
  3. Replace the scripts in bin/ and hooks/ with your logic
  4. Tag your repo with the fledge-plugin topic so it shows up in fledge plugin search
  5. Publish: anyone can install with fledge plugin install <owner>/<repo>

See the fledge plugin docs for the full manifest reference and hook event list.

License

MIT

About

Example fledge plugin — deploy, rollback, and lane hooks. Reference implementation for plugin authors.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages