config

package
v0.80.2 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2018 License: MIT Imports: 6 Imported by: 0

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 added in v0.5.0

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

	Format          string           `yaml:",omitempty"`
	FormatOverrides []FormatOverride `yaml:"format_overrides,omitempty"`
	WrapInDirectory bool             `yaml:"wrap_in_directory,omitempty"`
	Files           []string         `yaml:",omitempty"`
}

Archive config used for the archive

type Before added in v0.65.0

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

Before config

type Build added in v0.5.0

type Build struct {
	Goos     []string       `yaml:",omitempty"`
	Goarch   []string       `yaml:",omitempty"`
	Goarm    []string       `yaml:",omitempty"`
	Targets  []string       `yaml:",omitempty"`
	Ignore   []IgnoredBuild `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 added in v0.35.0

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

Changelog Config

type Checksum added in v0.30.4

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

Checksum config

type CommitAuthor added in v0.33.1

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

CommitAuthor is the author of a Git commit

type Docker added in v0.31.0

type Docker struct {
	Binary         string   `yaml:",omitempty"`
	Goos           string   `yaml:",omitempty"`
	Goarch         string   `yaml:",omitempty"`
	Goarm          string   `yaml:",omitempty"`
	Image          string   `yaml:",omitempty"`
	Dockerfile     string   `yaml:",omitempty"`
	Latest         bool     `yaml:",omitempty"`
	SkipPush       bool     `yaml:"skip_push,omitempty"`
	OldTagTemplate string   `yaml:"tag_template,omitempty"`
	TagTemplates   []string `yaml:"tag_templates,omitempty"`
	Files          []string `yaml:"extra_files,omitempty"`
}

Docker image config

type EnvFiles added in v0.47.0

type EnvFiles struct {
	GitHubToken string `yaml:"github_token,omitempty"`
}

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

type Filters added in v0.35.0

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

Filters config

type FlagArray added in v0.75.0

type FlagArray []string

FlagArray is a wrapper for an array of strings

func (*FlagArray) UnmarshalYAML added in v0.75.0

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

UnmarshalYAML is a custom unmarshaler that wraps strings in arrays

type FormatOverride added in v0.12.3

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

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

type Git added in v0.59.0

type Git struct {
	ShortHash bool `yaml:"short_hash,omitempty"`
}

Git config

type GitHubURLs added in v0.33.0

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

GitHubURLs holds the URLs to be used when using github enterprise

type Homebrew added in v0.1.6

type Homebrew struct {
	Name             string       `yaml:",omitempty"`
	GitHub           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       bool         `yaml:"skip_upload,omitempty"`
	DownloadStrategy string       `yaml:"download_strategy,omitempty"`
	SourceTarball    string       `yaml:"-"`
}

Homebrew contains the brew section

type Hooks added in v0.6.0

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

Hooks define actions to run before and/or after something

type IgnoredBuild added in v0.17.0

type IgnoredBuild struct {
	Goos, Goarch, Goarm string
}

IgnoredBuild represents a build ignored by the user

type NFPM added in v0.57.0

type NFPM struct {
	NFPMOverridables `yaml:",inline"`
	Overrides        map[string]NFPMOverridables `yaml:"overrides,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 added in v0.70.0

type NFPMOverridables struct {
	NameTemplate string            `yaml:"name_template,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 added in v0.68.0

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 added in v0.5.0

type Project struct {
	ProjectName   string    `yaml:"project_name,omitempty"`
	Release       Release   `yaml:",omitempty"`
	Brew          Homebrew  `yaml:",omitempty"`
	Scoop         Scoop     `yaml:",omitempty"`
	Builds        []Build   `yaml:",omitempty"`
	Archive       Archive   `yaml:",omitempty"`
	FPM           NFPM      `yaml:",omitempty"` // deprecated
	NFPM          NFPM      `yaml:",omitempty"`
	Snapcraft     Snapcraft `yaml:",omitempty"`
	Snapshot      Snapshot  `yaml:",omitempty"`
	Checksum      Checksum  `yaml:",omitempty"`
	Dockers       []Docker  `yaml:",omitempty"`
	Artifactories []Put     `yaml:",omitempty"`
	Puts          []Put     `yaml:",omitempty"`
	S3            []S3      `yaml:"s3,omitempty"`
	Changelog     Changelog `yaml:",omitempty"`
	Dist          string    `yaml:",omitempty"`
	Sign          Sign      `yaml:",omitempty"`
	EnvFiles      EnvFiles  `yaml:"env_files,omitempty"`
	Git           Git       `yaml:",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"`
}

Project includes all project configuration

func Load

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

Load config file

func LoadReader added in v0.17.4

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

LoadReader config via io.Reader

type Put added in v0.79.0

type Put struct {
	Name      string `yaml:",omitempty"`
	Target    string `yaml:",omitempty"`
	Username  string `yaml:",omitempty"`
	Mode      string `yaml:",omitempty"`
	Checksum  bool   `yaml:",omitempty"`
	Signature bool   `yaml:",omitempty"`
}

Put HTTP upload configuration

type Release added in v0.5.0

type Release struct {
	GitHub       Repo   `yaml:",omitempty"`
	Draft        bool   `yaml:",omitempty"`
	Prerelease   bool   `yaml:",omitempty"`
	Disable      bool   `yaml:",omitempty"`
	NameTemplate string `yaml:"name_template,omitempty"`
}

Release config used for the GitHub release

type Repo added in v0.8.6

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

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

func (Repo) String added in v0.8.6

func (r Repo) String() string

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

type S3 added in v0.74.0

type S3 struct {
	Region   string
	Bucket   string
	Folder   string
	Profile  string
	Endpoint string // used for minio for example
}

S3 contains s3 config

type Scoop added in v0.48.0

type Scoop struct {
	Bucket       Repo         `yaml:",omitempty"`
	CommitAuthor CommitAuthor `yaml:"commit_author,omitempty"`
	Homepage     string       `yaml:",omitempty"`
	Description  string       `yaml:",omitempty"`
	License      string       `yaml:",omitempty"`
}

Scoop contains the scoop.sh section

type Sign added in v0.39.0

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

Sign config

type Snapcraft added in v0.28.0

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

	Name        string                          `yaml:",omitempty"`
	Summary     string                          `yaml:",omitempty"`
	Description string                          `yaml:",omitempty"`
	Grade       string                          `yaml:",omitempty"`
	Confinement string                          `yaml:",omitempty"`
	Apps        map[string]SnapcraftAppMetadata `yaml:",omitempty"`
}

Snapcraft config

type SnapcraftAppMetadata added in v0.28.3

type SnapcraftAppMetadata struct {
	Plugs  []string
	Daemon string
	Args   string
}

SnapcraftAppMetadata for the binaries that will be in the snap package

type Snapshot added in v0.16.0

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

Snapshot config

type StringArray added in v0.75.0

type StringArray []string

StringArray is a wrapper for an array of strings

func (*StringArray) UnmarshalYAML added in v0.75.0

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

UnmarshalYAML is a custom unmarshaler that wraps strings in arrays

Jump to

Keyboard shortcuts

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