Documentation ¶
Index ¶
- Constants
- Variables
- func NewArtifact() modules.Pluggable
- func NewChecksum() modules.Pluggable
- func NewCutChangelog() modules.Pluggable
- func NewEnv() modules.Pluggable
- func NewGit() modules.Pluggable
- func NewGo() modules.Pluggable
- func NewProject() modules.Pluggable
- func NewSCP() modules.Pluggable
- func NewShow() modules.Pluggable
- func NewSkipPublish() modules.Pluggable
- func NewTar() modules.Pluggable
- func NewUPX() modules.Pluggable
- func Register()
- type Artifact
- type Checksum
- type CompressGz
- type CompressNONE
- type Compression
- type Compressor
- type CutChangelog
- type Env
- type Git
- type Go
- type HashAlgorithm
- type Project
- type SCP
- type Show
- type SkipPublish
- type Tar
- type UPX
Constants ¶
const ( EnvConfigHome = "XDG_CONFIG_HOME" EnvHome = "HOME" EnvHomePath = "HOMEPATH" )
Variables ¶
var ErrSkippedTarget = errors.New("target is skipped")
Functions ¶
func NewArtifact ¶
NewArtifact is a factory method for Artifact module
func NewChecksum ¶
func NewCutChangelog ¶
func NewProject ¶
NewProject is the factory function for Project
func NewSkipPublish ¶
NewSkipPublish is a factory method for SkipPublish plugin
Types ¶
type Artifact ¶
type Artifact struct { // Builds specifies which build names should be uploaded to the // github release. Builds []string // Name specifies the repository's name. No default, no detection (yet). // Required. Name string // Owner specifies the repository's owning organization. No default, // no detection (yet). Required. Owner string // ReleaseName specifies the release's name, using modules.TemplateData. // Default: "{{.Version}}" ReleaseName string `yaml:"release_name,omitempty"` // ReleaseNotes selects the artifact to be used for release notes. // It must select a single artifact. ReleaseNotes string `yaml:"release_notes"` // SkipTLSVerify allows connecting to servers with invalid TLS certs. // default: false SkipTLSVerify bool `yaml:"skip_tls_verify"` // Service specifies which artifact service we are using. Default: "github". Storage *artifacts.Storage // TokenEnv specifies which environment variable the module should look // for for server token. It is discovered from artifacts.Storage if not set. // Example: GITHUB_TOKEN. TokenEnv string `yaml:"token_env"` // TokenFile specifies which file the module should look for artifact storage // token. Variable expansion is available. It is discovered // from artifacts.Storage if not set. Example: // "$XDG_CONFIG_HOME/goshipdone/github_token". TokenFile string `yaml:"token_file"` // URL base URL for the artifact storage. Provide this only for on-premises services. URL string }
Artifact is a publish module for artifact storage servers like GitHub, or GitLab.
type Checksum ¶
type Checksum struct { // Algorithm specifies checksum algorithm Algorithm HashAlgorithm // Builds specifies a build names to find related artifacts to // calculate checksums of. Builds []string // ID specifies the checksum's name, as it stores in artifacts. // Default: "checksum" ID string // Output is where the checksum file is going to be created // Default: "{{.ProjectName}}-{{.Version}}-checksums.txt" Output string // Skip specifies which os-arch items should be skipped Skip []string }
Checksum calculates checksums of artifacts, and stores them in a checksum file
type CompressGz ¶
type CompressGz struct{}
CompressGz defines a gzip compression
func (*CompressGz) Extension ¶
func (c *CompressGz) Extension() string
func (*CompressGz) String ¶
func (c *CompressGz) String() string
func (*CompressGz) Writer ¶
func (c *CompressGz) Writer(writer io.Writer) io.WriteCloser
type CompressNONE ¶
type CompressNONE struct{}
CompressNONE defines a flowthrough compression
func (*CompressNONE) Extension ¶
func (c *CompressNONE) Extension() string
func (*CompressNONE) String ¶
func (c *CompressNONE) String() string
func (*CompressNONE) Writer ¶
func (c *CompressNONE) Writer(writer io.Writer) io.WriteCloser
type Compression ¶
type Compression struct {
Compressor
}
Compression is a YAML representation of a compression format
func (*Compression) UnmarshalYAML ¶
func (c *Compression) UnmarshalYAML(node *yaml.Node) error
UnmarshalYAML detects compression format
type Compressor ¶
Compressor defines compression interface
type CutChangelog ¶
type CutChangelog struct { // ID is the artifact ID of the changelog slice other modules will be // able to refer to. Default: "changelog". ID string // Input points to the original changelog file this module can take a // slice of. It must be in https://keepachangelog.org/ format. Default: // "CHANGELOG.md". Input string // Output is the filename of the changelog slice under Dist folder. // If empty, it will be the same as Input. // Default: "". Output string }
type Git ¶
type Git struct{}
Git is a module, which takes a git repo, and filling in `Version` information into `ctx.Context`
type Go ¶
type Go struct { // After is a list of commands have to be ran after builds. // Any errors cancel the task. After []string // Before is a list of commands have to be ran before builds. // Any errors cancel the task. Before []string // GOOS is a list of all GOOS variations required. It is // set to [`windows`, `linux`] by default. GOOS []string // GOArch is a list of all GOARCH variations required. It is // set to [`amd64`] by default. GOArch []string // GOArm is a list of all GOARM variations required. GOARM=6 is // used by default, as golang's internal default. Providing multiple // GOArm entries provides multiple builds while in GOOS=linux and // GOARCH=arm setting. GOArm []int32 // ID contains the artifact's name used by later stages of the build // pipeline. Archives, and Publishes may refer to this name for // referencing build results. // Default: "default". ID string // LDFlags is a `modules.TemplateData` template for providing // `-ldflags` configuration option to `go build` command. // It defaults to `-s -w -X main.version={{.Version}}`. LDFlags string // Main designates the file / directory where `main` package // (as well as `main` function) is defined. Main string // Output is where the build writes its output. Default: // `{{.ProjectName}}{{.Ext}}` Output string // Skip specifies GOOS-GOArch combinations to be skipped. // They are in `{{.Os}}-{{.Arch}}` format. // // Eg. // // “`go // Go{ // GOOS: []string{"linux", "windows"}, // GOArch: []string{"amd64", "386"}, // Skip: []string{"linux-386"}, // } // “` // // will run builds for linux-amd64, windows-amd64, and windows-386 only. Skip []string }
Go represents build:go module
type HashAlgorithm ¶
func NewHashAlgorithm ¶
func NewHashAlgorithm(hasher string) (*HashAlgorithm, error)
func (*HashAlgorithm) String ¶
func (algo *HashAlgorithm) String() string
func (*HashAlgorithm) UnmarshalYAML ¶
func (algo *HashAlgorithm) UnmarshalYAML(node *yaml.Node) error
type SCP ¶
type SCP struct { // Builds specifies which build names should be added to the archive. Builds []string // Skip specifies GOOS-GOArch combinations to be skipped. // They are in `{{.Os}}-{{.Arch}}` format. // It filters builds to be included. Skip []string // Target specifies SCP endpoint as the last parameter of the `scp` // command. Example: staticfiles@remoteserver.com:/var/www/default/public Target string }
SCP is a module for uploading artifacts to a remote server via scp
type SkipPublish ¶
type SkipPublish struct { // EnvName specifies which environment variable should be used to // signal skipping publish. Default: `SKIP_PUBLISH`, and while it reads // what strconv.ParseBool understands, the only reasonable value for this // variable is falsey (eg. "false", 0, and similar). EnvName string `yaml:"env_name"` }
SkipPublish module controls whether publish phase should be executed, by reading from an environment variable. This is an automatically loaded extension.
type Tar ¶
type Tar struct { // Builds specifies which build names should be added to the archive. Builds []string // CommonDir contains a common directory name for all files inside // the tar archive. An empty CommonDir skips creating subdirectories. // Default: `{{.ProjectName}}-{{.Version}}-{{.OS}}-{{.Arch}}`. CommonDir string // Compression specifies which compression should be applied to the // archive. Compression Compression // Files contains a list of static files should be added to the // archive file. They are interpretered as glob. Files []string // ID contains the artifact's name used by later stages of the build // pipeline. Archives, and Publishes may refer to this name for // referencing build results. // Default: "archive". ID string // Output is where the build writes its output. Default: // `{{.ProjectName}}-{{.Version}}-{{.OS}}-{{.Arch}}.tar{{.Ext}}` // where `{{.Ext}}` contains the compression's default extension Output string // Skip specifies GOOS-GOArch combinations to be skipped. // They are in `{{.Os}}-{{.Arch}}` format. // It filters builds to be included. Skip []string }
Tar is a module for building an archive from prior builds