releaser

package
v1.0.11875-8ede93d Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Plugin is the name of the plugin/subcommand binary
	Plugin string
	// Version is the version of the binary to release
	Version string

	// Platforms is a map of OSes to architectures that the target binary will be compiled for
	Platforms map[string][]string

	// Bucket is the name of the S3 bucket that the compiled binaries will be uploaded to
	Bucket string
	// Namespace is the namespace prefix to use in the upload key for the binary. If not provided then
	// defaults to `task-agent-plugins`. Valid options are: `task-agent-plugins` or `task-agent-subcommands`
	Namespace Namespace

	// Client is an S3 client
	Client *s3.Client
}

type Namespace

type Namespace int

Namespace is an enum representing the valid namespaces that a binary can be uploaded to

const (
	// NamespacePlugin is the namespace used to upload plugin binaries
	NamespacePlugin Namespace = iota
	// NamespaceSubcommand is the namespace used to upload subcommand binaries
	NamespaceSubcommand
)

func (Namespace) String

func (n Namespace) String() string

type Opts

type Opts struct {
	// Source is the source package of the plugin to compile and upload
	Source string
	// WorkingDir is the directory from which the compilation should be run from
	WorkingDir string
	// LDFlags are any linker flags to be included when building the binary
	LDFlags string
}

Opts are the options available when running the Releaser

type Releaser

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

Releaser is responsible for compiling and uploading the Go binaries for task-agent plugins/subcommands in a standardised way

func New

func New(cfg Config) (Releaser, error)

New constructs a new Releaser

func (Releaser) Run

func (r Releaser) Run(ctx context.Context, opts Opts) error

Run compiles the binary at opts.Source for each of the configured platforms and then uploads the resulting binaries to the configured S3 bucket using the key with the format: `namespace/plugin_name/version/os/arch/plugin_name`

Directories

Path Synopsis
internal
cmd

Jump to

Keyboard shortcuts

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