tknautogenerate

package
v0.0.0-...-e286655 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2023 License: Apache-2.0 Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Detect

func Detect(cli *CliStruct) (string, error)

Types

type AutoGenerate

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

func (*AutoGenerate) GetAllFilesInRepo

func (ag *AutoGenerate) GetAllFilesInRepo(ctx context.Context) ([]string, error)

func (*AutoGenerate) GetFilePatternTasks

func (ag *AutoGenerate) GetFilePatternTasks(ctx context.Context, config Config) (bool, []string, error)

func (*AutoGenerate) GetTasks

func (ag *AutoGenerate) GetTasks() ([]string, error)

func (*AutoGenerate) New

func (ag *AutoGenerate) New(filename string) error

func (*AutoGenerate) Output

func (ag *AutoGenerate) Output(configs map[string]Config, content string) (string, error)

type CliStruct

type CliStruct struct {
	OwnerRepo            string `arg:"" help:"GitHub owner/repo" placeholder:"OWNER/REPO"`
	Token                string `help:"GitHub token to use" env:"GITHUB_TOKEN" placeholder:"TOKEN" short:"t"`
	TargetRef            string `help:"The target reference when fetching the files (default: main branch)" placeholder:"REF"`
	AutoGenerateYaml     string `help:"Path to the autogenerate.yaml file" placeholder:"FILE" type:"existingfile"`
	PipelineRunYaml      string `help:"path to the default pipelinerun template" placeholder:"FILE" type:"existingfile"`
	TemplatesLanguageDir string `help:"path to the per language templates directory" placeholder:"DIR" type:"existingdir"`
}

type Config

type Config struct {
	Name        string `yaml:"name"`
	Tasks       []Task `yaml:"tasks"`
	Pattern     string `yaml:"pattern,omitempty"`
	PipelineRun string `yaml:"pipelinerun,omitempty"`
}

type Params

type Params struct {
	Name  string `yaml:"name"`
	Value string `yaml:"value"`
}

type Task

type Task struct {
	Name      string    `yaml:"name"`
	Params    []Params  `yaml:"params,omitempty"`
	Workspace Workspace `yaml:"workspace,omitempty"`
	RunAfter  []string  `yaml:"runAfter,omitempty"`
}

type Workspace

type Workspace struct {
	Disabled bool   `yaml:"disabled,omitempty"`
	Name     string `yaml:"name,omitempty"`
}

Jump to

Keyboard shortcuts

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