drone

package
v0.99.18 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 21, 2026 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Overview

Package drone implements the Drone CI capability.

Index

Constants

View Source
const (
	OpDeploy = "deploy"
	OpHealth = "health"
)

Variables

This section is empty.

Functions

func CatalogSpec

func CatalogSpec() capability.Spec

CatalogSpec returns capability metadata for documentation (handlers may close over a nil service and must not be invoked).

func Register

func Register(app string, svc Service) error

Register registers the drone capability with hub and invoker registry. When svc is nil the provider is not configured and registration is skipped.

Types

type Adapter

type Adapter struct {
	// contains filtered or unexported fields
}

Adapter implements Service using the Drone provider and the Gitea user as the namespace.

func (*Adapter) Deploy

func (a *Adapter) Deploy(ctx context.Context, in DeployInput) (*Build, error)

Deploy resolves the Gitea namespace, creates a build of the deploy repository, and notifies.

func (*Adapter) HealthCheck

func (*Adapter) HealthCheck(ctx context.Context) (bool, error)

HealthCheck reports that the Drone client is configured.

type Build

type Build struct {
	Number    int    `json:"number"`
	Namespace string `json:"namespace"`
	Repo      string `json:"repo"`
	URL       string `json:"url,omitempty"`
}

Build is a Drone CI build created for the deploy repository.

type DeployInput

type DeployInput struct {
	UID types.Uid
}

DeployInput carries the user who should receive the deploy notification.

type Service

type Service interface {
	Deploy(ctx context.Context, in DeployInput) (*Build, error)
	HealthCheck(ctx context.Context) (bool, error)
}

Service triggers the deploy repository build.

func New

func New() Service

New creates an Adapter from provider config. Returns nil when the Drone endpoint is not configured.

func NewWithDeps

func NewWithDeps(builds buildClient, namespace namespaceFunc, send notifyFunc, droneURL func() string) Service

NewWithDeps creates an Adapter from explicit dependencies. Returns nil when builds or namespace is nil.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL