github

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ActionCreate action = "create"
	ActionDelete action = "delete"
	ActionUpdate action = "update"
)
View Source
const (
	RegistryDockerhub   RegistryType = "dockerhub"
	RegistryHarbor      RegistryType = "harbor"
	CommitMessage                    = "GitHub Actions workflow, created by DevStream"
	PRBuilderFileName                = "pr-builder.yml"
	MainBuilderFileName              = "main-builder.yml"
)

Variables

This section is empty.

Functions

func BuildWorkFlowsWrapper

func BuildWorkFlowsWrapper(workflows []*github.Workflow) plugininstaller.MutableOperation

func GetStaticWorkFlowState

func GetStaticWorkFlowState(options plugininstaller.RawOptions) (statemanager.ResourceState, error)

func ProcessAction

func ProcessAction(act action) plugininstaller.BaseOperation

ProcessAction config github

Types

type Build

type Build struct {
	Enable  bool
	Command string
}

Build is the struct for githubactions job.

type Coverage

type Coverage struct {
	Enable  bool
	Profile string
	Output  string
}

Coverage is the struct for githubactions job.

type Docker

type Docker struct {
	Enable   bool
	Registry Registry
}

Docker is the struct for githubactions job.

func (*Docker) Validate

func (d *Docker) Validate() []error

type GithubActionLanguage

type GithubActionLanguage struct {
	Name    string `validate:"required"`
	Version string
}

GithubActionLanguage is the language of repo

type GithubActionOptions

type GithubActionOptions struct {
	Owner    string                `validate:"required_without=Org"`
	Org      string                `validate:"required_without=Owner"`
	Repo     string                `validate:"required"`
	Branch   string                `validate:"required"`
	Language *GithubActionLanguage `validate:"required"`

	// optional
	Workflows []*github.Workflow
	Build     Build
	Test      *Test
	Docker    *Docker
}

GithubActionOptions is the struct for configurations of the plugin.

func NewGithubActionOptions

func NewGithubActionOptions(options plugininstaller.RawOptions) (*GithubActionOptions, error)

func (*GithubActionOptions) CheckAddDockerHubToken added in v0.9.0

func (opts *GithubActionOptions) CheckAddDockerHubToken() bool

func (*GithubActionOptions) Encode

func (opts *GithubActionOptions) Encode() (map[string]interface{}, error)

func (*GithubActionOptions) GetGithubClient

func (opts *GithubActionOptions) GetGithubClient() (*github.Client, error)

func (*GithubActionOptions) GetLanguage

func (opts *GithubActionOptions) GetLanguage() string

func (*GithubActionOptions) RenderWorkFlow

func (opts *GithubActionOptions) RenderWorkFlow(content string) (string, error)

type Image

type Image struct {
}

Image is the struct for githubactions job.

type Registry

type Registry struct {
	// only support dockerhub now
	Type       RegistryType
	Username   string
	Repository string
}

type RegistryType

type RegistryType string

type Tag

type Tag struct {
}

Tag is the struct for githubactions job.

type Test

type Test struct {
	Enable   bool
	Command  string
	Coverage Coverage
}

Test is the struct for githubactions job.

Jump to

Keyboard shortcuts

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