metadata

package
v2.7.0 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EventPush       = "push"
	EventPull       = "pull_request"
	EventPullClosed = "pull_request_closed"
	EventTag        = "tag"
	EventRelease    = "release"
	EventDeploy     = "deployment"
	EventCron       = "cron"
	EventManual     = "manual"
)

Event types corresponding to forge hooks.

View Source
const (
	FailureIgnore = "ignore"
	FailureFail   = "fail"
)

Different ways to handle failure states.

Variables

This section is empty.

Functions

func EnvVarSubst added in v2.2.0

func EnvVarSubst(yaml string, environ map[string]string) (string, error)

func SetDroneEnviron

func SetDroneEnviron(env map[string]string)

SetDroneEnviron set dedicated to DroneCI environment vars as compatibility layer. Main purpose is to be compatible with drone plugins.

Types

type Author

type Author struct {
	Name   string `json:"name,omitempty"`
	Email  string `json:"email,omitempty"`
	Avatar string `json:"avatar,omitempty"`
}

Author defines runtime metadata for a commit author.

type Commit

type Commit struct {
	Sha               string   `json:"sha,omitempty"`
	Ref               string   `json:"ref,omitempty"`
	Refspec           string   `json:"refspec,omitempty"`
	Branch            string   `json:"branch,omitempty"`
	Message           string   `json:"message,omitempty"`
	Author            Author   `json:"author,omitempty"`
	ChangedFiles      []string `json:"changed_files,omitempty"`
	PullRequestLabels []string `json:"labels,omitempty"`
	IsPrerelease      bool     `json:"is_prerelease,omitempty"`
}

Commit defines runtime metadata for a commit.

type Forge

type Forge struct {
	Type string `json:"type,omitempty"`
	URL  string `json:"url,omitempty"`
}

Forge defines runtime metadata about the forge that host the repo.

type Metadata

type Metadata struct {
	ID       string   `json:"id,omitempty"`
	Repo     Repo     `json:"repo,omitempty"`
	Curr     Pipeline `json:"curr,omitempty"`
	Prev     Pipeline `json:"prev,omitempty"`
	Workflow Workflow `json:"workflow,omitempty"`
	Step     Step     `json:"step,omitempty"`
	Sys      System   `json:"sys,omitempty"`
	Forge    Forge    `json:"forge,omitempty"`
}

Metadata defines runtime m.

func (*Metadata) Environ

func (m *Metadata) Environ() map[string]string

Environ returns the metadata as a map of environment variables.

type Pipeline

type Pipeline struct {
	Number     int64  `json:"number,omitempty"`
	Created    int64  `json:"created,omitempty"`
	Started    int64  `json:"started,omitempty"`
	Finished   int64  `json:"finished,omitempty"`
	Status     string `json:"status,omitempty"`
	Event      string `json:"event,omitempty"`
	ForgeURL   string `json:"forge_url,omitempty"`
	DeployTo   string `json:"target,omitempty"`
	DeployTask string `json:"task,omitempty"`
	Commit     Commit `json:"commit,omitempty"`
	Parent     int64  `json:"parent,omitempty"`
	Cron       string `json:"cron,omitempty"`
}

Pipeline defines runtime metadata for a pipeline.

type Repo

type Repo struct {
	ID          int64    `json:"id,omitempty"`
	Name        string   `json:"name,omitempty"`
	Owner       string   `json:"owner,omitempty"`
	RemoteID    string   `json:"remote_id,omitempty"`
	ForgeURL    string   `json:"forge_url,omitempty"`
	CloneURL    string   `json:"clone_url,omitempty"`
	CloneSSHURL string   `json:"clone_url_ssh,omitempty"`
	Private     bool     `json:"private,omitempty"`
	Secrets     []Secret `json:"secrets,omitempty"`
	Branch      string   `json:"default_branch,omitempty"`
	Trusted     bool     `json:"trusted,omitempty"`
}

Repo defines runtime metadata for a repository.

type Secret

type Secret struct {
	Name  string `json:"name,omitempty"`
	Value string `json:"value,omitempty"`
	Mount string `json:"mount,omitempty"`
	Mask  bool   `json:"mask,omitempty"`
}

Secret defines a runtime secret.

type ServerForge

type ServerForge interface {
	// Name returns the string name of this driver
	Name() string
	// URL returns the root url of a configured forge
	URL() string
}

ServerForge represent the needed func of a server forge to get its metadata.

type Step

type Step struct {
	Name   string `json:"name,omitempty"`
	Number int    `json:"number,omitempty"`
}

Step defines runtime metadata for a step.

type System

type System struct {
	Name     string `json:"name,omitempty"`
	Host     string `json:"host,omitempty"`
	URL      string `json:"url,omitempty"`
	Platform string `json:"arch,omitempty"`
	Version  string `json:"version,omitempty"`
}

System defines runtime metadata for a ci/cd system.

type Workflow

type Workflow struct {
	Name   string            `json:"name,omitempty"`
	Number int               `json:"number,omitempty"`
	Matrix map[string]string `json:"matrix,omitempty"`
}

Workflow defines runtime metadata for a workflow.

Jump to

Keyboard shortcuts

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