config

package
v0.130.2 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2020 License: MIT Imports: 6 Imported by: 36

Documentation

Overview

Package config contains the model and loader of the goreleaser configuration file.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Archive

type Archive struct {
	ID              string            `yaml:",omitempty"`
	Builds          []string          `yaml:",omitempty"`
	NameTemplate    string            `yaml:"name_template,omitempty"`
	Replacements    map[string]string `yaml:",omitempty"`
	Format          string            `yaml:",omitempty"`
	FormatOverrides []FormatOverride  `yaml:"format_overrides,omitempty"`
	WrapInDirectory string            `yaml:"wrap_in_directory,omitempty"`
	Files           []string          `yaml:",omitempty"`
}

Archive config used for the archive

type Before

type Before struct {
	Hooks []string `yaml:",omitempty"`
}

Before config

type Blob added in v0.109.0

type Blob struct {
	Bucket     string   `yaml:",omitempty"`
	Provider   string   `yaml:",omitempty"`
	Region     string   `yaml:",omitempty"`
	DisableSSL bool     `yaml:"disableSSL,omitempty"`
	Folder     string   `yaml:",omitempty"`
	KMSKey     string   `yaml:",omitempty"`
	IDs        []string `yaml:"ids,omitempty"`
	Endpoint   string   `yaml:",omitempty"` // used for minio for example
}

Blob contains config for GO CDK blob

type Build

type Build struct {
	ID       string         `yaml:",omitempty"`
	Goos     []string       `yaml:",omitempty"`
	Goarch   []string       `yaml:",omitempty"`
	Goarm    []string       `yaml:",omitempty"`
	Gomips   []string       `yaml:",omitempty"`
	Targets  []string       `yaml:",omitempty"`
	Ignore   []IgnoredBuild `yaml:",omitempty"`
	Dir      string         `yaml:",omitempty"`
	Main     string         `yaml:",omitempty"`
	Ldflags  StringArray    `yaml:",omitempty"`
	Flags    FlagArray      `yaml:",omitempty"`
	Binary   string         `yaml:",omitempty"`
	Hooks    Hooks          `yaml:",omitempty"`
	Env      []string       `yaml:",omitempty"`
	Lang     string         `yaml:",omitempty"`
	Asmflags StringArray    `yaml:",omitempty"`
	Gcflags  StringArray    `yaml:",omitempty"`
}

Build contains the build configuration section

type Changelog

type Changelog struct {
	Filters Filters `yaml:",omitempty"`
	Sort    string  `yaml:",omitempty"`
	Skip    bool    `yaml:",omitempty"`
}

Changelog Config

type Checksum

type Checksum struct {
	NameTemplate string `yaml:"name_template,omitempty"`
	Algorithm    string `yaml:"algorithm,omitempty"`
}

Checksum config

type CommitAuthor

type CommitAuthor struct {
	Name  string `yaml:",omitempty"`
	Email string `yaml:",omitempty"`
}

CommitAuthor is the author of a Git commit

type Docker

type Docker struct {
	Binaries           []string `yaml:",omitempty"`
	Builds             []string `yaml:",omitempty"`
	Goos               string   `yaml:",omitempty"`
	Goarch             string   `yaml:",omitempty"`
	Goarm              string   `yaml:",omitempty"`
	Dockerfile         string   `yaml:",omitempty"`
	ImageTemplates     []string `yaml:"image_templates,omitempty"`
	SkipPush           string   `yaml:"skip_push,omitempty"`
	Files              []string `yaml:"extra_files,omitempty"`
	BuildFlagTemplates []string `yaml:"build_flag_templates,omitempty"`
}

Docker image config

type EnvFiles

type EnvFiles struct {
	GitHubToken string `yaml:"github_token,omitempty"`
	GitLabToken string `yaml:"gitlab_token,omitempty"`
	GiteaToken  string `yaml:"gitea_token,omitempty"`
}

EnvFiles holds paths to files that contains environment variables values like the github token for example

type ExtraFile added in v0.127.0

type ExtraFile struct {
	Glob string `yaml:"glob,omitempty"`
}

ExtraFile on a release

type Filters

type Filters struct {
	Exclude []string `yaml:",omitempty"`
}

Filters config

type FlagArray

type FlagArray []string

FlagArray is a wrapper for an array of strings

func (*FlagArray) UnmarshalYAML

func (a *FlagArray) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML is a custom unmarshaler that wraps strings in arrays

type FormatOverride

type FormatOverride struct {
	Goos   string `yaml:",omitempty"`
	Format string `yaml:",omitempty"`
}

FormatOverride is used to specify a custom format for a specific GOOS.

type GitHubURLs

type GitHubURLs struct {
	API           string `yaml:"api,omitempty"`
	Upload        string `yaml:"upload,omitempty"`
	Download      string `yaml:"download,omitempty"`
	SkipTLSVerify bool   `yaml:"skip_tls_verify,omitempty"`
}

GitHubURLs holds the URLs to be used when using github enterprise

type GitLabURLs added in v0.112.0

type GitLabURLs struct {
	API           string `yaml:"api,omitempty"`
	Download      string `yaml:"download,omitempty"`
	SkipTLSVerify bool   `yaml:"skip_tls_verify,omitempty"`
}

GitLabURLs holds the URLs to be used when using gitlab ce/enterprise

type GiteaURLs added in v0.117.0

type GiteaURLs struct {
	API           string `yaml:"api,omitempty"`
	SkipTLSVerify bool   `yaml:"skip_tls_verify,omitempty"`
}

GiteaURLs holds the URLs to be used when using gitea

type Homebrew

type Homebrew struct {
	Name             string       `yaml:",omitempty"`
	GitHub           Repo         `yaml:",omitempty"`
	GitLab           Repo         `yaml:",omitempty"`
	CommitAuthor     CommitAuthor `yaml:"commit_author,omitempty"`
	Folder           string       `yaml:",omitempty"`
	Caveats          string       `yaml:",omitempty"`
	Plist            string       `yaml:",omitempty"`
	Install          string       `yaml:",omitempty"`
	Dependencies     []string     `yaml:",omitempty"`
	Test             string       `yaml:",omitempty"`
	Conflicts        []string     `yaml:",omitempty"`
	Description      string       `yaml:",omitempty"`
	Homepage         string       `yaml:",omitempty"`
	SkipUpload       string       `yaml:"skip_upload,omitempty"`
	DownloadStrategy string       `yaml:"download_strategy,omitempty"`
	URLTemplate      string       `yaml:"url_template,omitempty"`
	CustomRequire    string       `yaml:"custom_require,omitempty"`
	CustomBlock      string       `yaml:"custom_block,omitempty"`
	IDs              []string     `yaml:"ids,omitempty"`
	Goarm            string       `yaml:"goarm,omitempty"`
}

Homebrew contains the brew section

type Hooks

type Hooks struct {
	Pre  string `yaml:",omitempty"`
	Post string `yaml:",omitempty"`
}

Hooks define actions to run before and/or after something

type IgnoredBuild

type IgnoredBuild struct {
	Goos, Goarch, Goarm, Gomips string
}

IgnoredBuild represents a build ignored by the user

type NFPM

type NFPM struct {
	NFPMOverridables `yaml:",inline"`
	Overrides        map[string]NFPMOverridables `yaml:"overrides,omitempty"`

	ID          string   `yaml:",omitempty"`
	Builds      []string `yaml:",omitempty"`
	Formats     []string `yaml:",omitempty"`
	Vendor      string   `yaml:",omitempty"`
	Homepage    string   `yaml:",omitempty"`
	Maintainer  string   `yaml:",omitempty"`
	Description string   `yaml:",omitempty"`
	License     string   `yaml:",omitempty"`
	Bindir      string   `yaml:",omitempty"`
}

NFPM config

type NFPMOverridables

type NFPMOverridables struct {
	FileNameTemplate string            `yaml:"file_name_template,omitempty"`
	PackageName      string            `yaml:"package_name,omitempty"`
	NameTemplate     string            `yaml:"name_template,omitempty"` // deprecated
	Epoch            string            `yaml:"epoch,omitempty"`
	Release          string            `yaml:"release,omitempty"`
	Replacements     map[string]string `yaml:",omitempty"`
	Dependencies     []string          `yaml:",omitempty"`
	Recommends       []string          `yaml:",omitempty"`
	Suggests         []string          `yaml:",omitempty"`
	Conflicts        []string          `yaml:",omitempty"`
	EmptyFolders     []string          `yaml:"empty_folders,omitempty"`
	Files            map[string]string `yaml:",omitempty"`
	ConfigFiles      map[string]string `yaml:"config_files,omitempty"`
	Scripts          NFPMScripts       `yaml:"scripts,omitempty"`
}

NFPMOverridables is used to specify per package format settings

type NFPMScripts

type NFPMScripts struct {
	PreInstall  string `yaml:"preinstall,omitempty"`
	PostInstall string `yaml:"postinstall,omitempty"`
	PreRemove   string `yaml:"preremove,omitempty"`
	PostRemove  string `yaml:"postremove,omitempty"`
}

NFPMScripts is used to specify maintainer scripts

type Project

type Project struct {
	ProjectName   string      `yaml:"project_name,omitempty"`
	Env           []string    `yaml:",omitempty"`
	Release       Release     `yaml:",omitempty"`
	Brews         []Homebrew  `yaml:",omitempty"`
	Scoop         Scoop       `yaml:",omitempty"`
	Builds        []Build     `yaml:",omitempty"`
	Archives      []Archive   `yaml:",omitempty"`
	NFPMs         []NFPM      `yaml:"nfpms,omitempty"`
	Snapcrafts    []Snapcraft `yaml:",omitempty"`
	Snapshot      Snapshot    `yaml:",omitempty"`
	Checksum      Checksum    `yaml:",omitempty"`
	Dockers       []Docker    `yaml:",omitempty"`
	Artifactories []Upload    `yaml:",omitempty"`
	Uploads       []Upload    `yaml:",omitempty"`
	Puts          []Upload    `yaml:",omitempty"` // TODO: remove this
	Blobs         []Blob      `yaml:"blobs,omitempty"`
	Changelog     Changelog   `yaml:",omitempty"`
	Dist          string      `yaml:",omitempty"`
	Signs         []Sign      `yaml:",omitempty"`
	EnvFiles      EnvFiles    `yaml:"env_files,omitempty"`
	Before        Before      `yaml:",omitempty"`

	// this is a hack ¯\_(ツ)_/¯
	SingleBuild Build `yaml:"build,omitempty"`

	// should be set if using github enterprise
	GitHubURLs GitHubURLs `yaml:"github_urls,omitempty"`

	// should be set if using a private gitlab
	GitLabURLs GitLabURLs `yaml:"gitlab_urls,omitempty"`

	// should be set if using Gitea
	GiteaURLs GiteaURLs `yaml:"gitea_urls,omitempty"`
}

Project includes all project configuration

func Load

func Load(file string) (config Project, err error)

Load config file

func LoadReader

func LoadReader(fd io.Reader) (config Project, err error)

LoadReader config via io.Reader

type Release

type Release struct {
	GitHub       Repo        `yaml:",omitempty"`
	GitLab       Repo        `yaml:",omitempty"`
	Gitea        Repo        `yaml:",omitempty"`
	Draft        bool        `yaml:",omitempty"`
	Disable      bool        `yaml:",omitempty"`
	Prerelease   string      `yaml:",omitempty"`
	NameTemplate string      `yaml:"name_template,omitempty"`
	IDs          []string    `yaml:"ids,omitempty"`
	ExtraFiles   []ExtraFile `yaml:"extra_files,omitempty"`
}

Release config used for the GitHub/GitLab release

type Repo

type Repo struct {
	Owner string `yaml:",omitempty"`
	Name  string `yaml:",omitempty"`
}

Repo represents any kind of repo (github, gitlab, etc)

func (Repo) String

func (r Repo) String() string

String of the repo, e.g. owner/name

type Scoop

type Scoop struct {
	Name         string       `yaml:",omitempty"`
	Bucket       Repo         `yaml:",omitempty"`
	CommitAuthor CommitAuthor `yaml:"commit_author,omitempty"`
	Homepage     string       `yaml:",omitempty"`
	Description  string       `yaml:",omitempty"`
	License      string       `yaml:",omitempty"`
	URLTemplate  string       `yaml:"url_template,omitempty"`
	Persist      []string     `yaml:"persist,omitempty"`
	SkipUpload   string       `yaml:"skip_upload,omitempty"`
}

Scoop contains the scoop.sh section

type Sign

type Sign struct {
	ID        string   `yaml:"id,omitempty"`
	Cmd       string   `yaml:"cmd,omitempty"`
	Args      []string `yaml:"args,omitempty"`
	Signature string   `yaml:"signature,omitempty"`
	Artifacts string   `yaml:"artifacts,omitempty"`
	IDs       []string `yaml:"ids,omitempty"`
}

Sign config

type Snapcraft

type Snapcraft struct {
	NameTemplate string            `yaml:"name_template,omitempty"`
	Replacements map[string]string `yaml:",omitempty"`
	Publish      bool              `yaml:",omitempty"`

	ID          string                          `yaml:",omitempty"`
	Builds      []string                        `yaml:",omitempty"`
	Name        string                          `yaml:",omitempty"`
	Summary     string                          `yaml:",omitempty"`
	Description string                          `yaml:",omitempty"`
	Base        string                          `yaml:",omitempty"`
	License     string                          `yaml:",omitempty"`
	Grade       string                          `yaml:",omitempty"`
	Confinement string                          `yaml:",omitempty"`
	Apps        map[string]SnapcraftAppMetadata `yaml:",omitempty"`
	Plugs       map[string]interface{}          `yaml:",omitempty"`
}

Snapcraft config

type SnapcraftAppMetadata

type SnapcraftAppMetadata struct {
	Plugs     []string
	Daemon    string
	Args      string
	Completer string `yaml:",omitempty"`
}

SnapcraftAppMetadata for the binaries that will be in the snap package

type Snapshot

type Snapshot struct {
	NameTemplate string `yaml:"name_template,omitempty"`
}

Snapshot config

type StringArray

type StringArray []string

StringArray is a wrapper for an array of strings

func (*StringArray) UnmarshalYAML

func (a *StringArray) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML is a custom unmarshaler that wraps strings in arrays

type Upload added in v0.123.0

type Upload struct {
	Name               string   `yaml:",omitempty"`
	IDs                []string `yaml:"ids,omitempty"`
	Target             string   `yaml:",omitempty"`
	Username           string   `yaml:",omitempty"`
	Mode               string   `yaml:",omitempty"`
	Method             string   `yaml:",omitempty"`
	ChecksumHeader     string   `yaml:"checksum_header,omitempty"`
	TrustedCerts       string   `yaml:"trusted_certificates,omitempty"`
	Checksum           bool     `yaml:",omitempty"`
	Signature          bool     `yaml:",omitempty"`
	CustomArtifactName bool     `yaml:"custom_artifact_name,omitempty"`
}

Upload configuration

Jump to

Keyboard shortcuts

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