config

package
v0.0.0-...-ef9846f Latest Latest
Warning

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

Go to latest
Published: May 4, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MarshalJob

func MarshalJob(j *Job) ([]byte, error)

func UnmarshalJob

func UnmarshalJob(b []byte, j *Job) error

Types

type Config

type Config struct {
	Jobs            []*Job
	RepositoryOwner string
	RepositoryName  string
}

func Read

func Read(r io.Reader, owner, repo string) (*Config, error)

func (*Config) Job

func (c *Config) Job(event EventType) []*Job

type EventType

type EventType string
const (
	EventPush        EventType = "push"
	EventPullRequest EventType = "pull_request"
	EventRelease     EventType = "release"
	EventManual      EventType = "manual"
)

type Job

type Job struct {
	// Name is a job name
	Name  string      `attr:"name"`
	Event []EventType `attr:"event"`
	// If true, build at each revision
	AllRevision bool   `attr:"all_revision,allowempty"`
	Command     string `attr:"command"`
	Container   string `attr:"container,allowempty"`
	// Limit of CPU
	CPULimit string `attr:"cpu_limit,allowempty"`
	// Limit of memory
	MemoryLimit  string   `attr:"memory_limit,allowempty"`
	GitHubStatus bool     `attr:"github_status,allowempty"`
	Platforms    []string `attr:"platforms"`
	Targets      []string `attr:"targets"`
	Args         []string `attr:"args,allowempty"`
	// Do not allow parallelized build in this job
	Exclusive bool `attr:"exclusive,allowempty"`
	// The name of config
	ConfigName string `attr:"config_name,allowempty"`
	// Job schedule
	Schedule string           `attr:"schedule,allowempty"`
	Secrets  []starlark.Value `attr:"secrets,allowempty"`
	Env      map[string]any   `attr:"env,allowempty"`

	RepositoryOwner string
	RepositoryName  string
}

func (*Job) Copy

func (j *Job) Copy() *Job

func (*Job) Identification

func (j *Job) Identification() string

func (*Job) IsValid

func (j *Job) IsValid() error

type RegistrySecret

type RegistrySecret struct {
	Host       string `attr:"host"`
	VaultMount string `attr:"vault_mount"`
	VaultPath  string `attr:"vault_path"`
	VaultKey   string `attr:"vault_key"`
}

func (*RegistrySecret) Freeze

func (s *RegistrySecret) Freeze()

func (*RegistrySecret) Hash

func (s *RegistrySecret) Hash() (uint32, error)

func (*RegistrySecret) String

func (s *RegistrySecret) String() string

func (*RegistrySecret) Truth

func (s *RegistrySecret) Truth() starlark.Bool

func (*RegistrySecret) Type

func (s *RegistrySecret) Type() string

type Secret

type Secret struct {
	MountPath  string `attr:"mount_path"`
	VaultMount string `attr:"vault_mount"`
	VaultPath  string `attr:"vault_path"`
	VaultKey   string `attr:"vault_key"`
}

func (*Secret) Freeze

func (s *Secret) Freeze()

func (*Secret) Hash

func (s *Secret) Hash() (uint32, error)

func (*Secret) String

func (s *Secret) String() string

func (*Secret) Truth

func (s *Secret) Truth() starlark.Bool

func (*Secret) Type

func (s *Secret) Type() string

Jump to

Keyboard shortcuts

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