Documentation ¶
Index ¶
- func DefaultMain()
- func NewAPIHandler(h APIHandler) http.Handler
- func NewSlack(tokenFile, signingSecretFile string, ciFilePath string, templates TemplateSet) (*slackCmds, error)
- func NewWorkflowSyner(kubeclient kubernetes.Interface, clientset clientset.Interface, ...) *workflowSyncer
- func StatusUpdate(ctx context.Context, info *githubInfo, status GithubStatus)
- type APIConfig
- type APIHandler
- type CacheSpec
- type Config
- type DeploymentPayload
- type GithubClientInterface
- type GithubEvent
- type GithubKeyStore
- type GithubStatus
- type HookHandler
- type K8sStorageManager
- type KubeCIPayload
- type RunRequest
- type RunResp
- type SlashHandler
- type StatusHandler
- type TemplateSet
- type TemplateSpec
- type WorkflowContext
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultMain ¶ added in v0.9.2
func DefaultMain()
func NewAPIHandler ¶ added in v0.10.0
func NewAPIHandler(h APIHandler) http.Handler
func NewSlack ¶ added in v0.9.1
func NewSlack(tokenFile, signingSecretFile string, ciFilePath string, templates TemplateSet) (*slackCmds, error)
func NewWorkflowSyner ¶ added in v0.9.1
func NewWorkflowSyner( kubeclient kubernetes.Interface, clientset clientset.Interface, sinf informers.SharedInformerFactory, storage storageManager, ghClientSrc githubClientSource, appID int64, ghSecret []byte, baseURL string, config Config, ) *workflowSyncer
func StatusUpdate ¶ added in v0.9.1
func StatusUpdate( ctx context.Context, info *githubInfo, status GithubStatus, )
Types ¶
type APIConfig ¶ added in v0.10.0
type APIConfig struct {
DefaultInstallID int `yaml:"defaultInstallID"`
}
type APIHandler ¶ added in v0.10.0
type APIHandler struct { Storage pvcManager Clients githubClientSource Runner workflowRunner Slash slashRunner UIBase string GitHubSecret []byte AppID int64 InstallID int }
func (*APIHandler) HandleRun ¶ added in v0.10.0
func (h *APIHandler) HandleRun(w http.ResponseWriter, r *http.Request)
type CacheSpec ¶
type CacheSpec struct { Scope string `yaml:"scope"` Size string `yaml:"size"` StorageClassName string `yaml:"storageClassName"` }
CacheSpec lets you choose the default settings for a per-job cache volume.
type Config ¶
type Config struct { CIContextPath string `yaml:"ciContextPath"` CIYAMLFile string `yaml:"ciYAMLFile"` CIStarlarkFile string `yaml:"ciStarlarkFile"` Namespace string `yaml:"namespace"` ManagedBy string `yaml:"managedBy"` Tolerations []v1.Toleration `yaml:"tolerations"` NodeSelector map[string]string `yaml:"nodeSelector"` TemplateSet TemplateSet `yaml:"templates"` CacheDefaults CacheSpec `yaml:"cacheDefaults"` BuildDraftPRs bool `yaml:"buildDraftPRs"` BuildBranches string `yaml:"buildBranches"` ManualTemplates string `yaml:"manualTemplates"` EssentialTemplates string `yaml:"essentialTemplates"` DeployTemplates string `yaml:"deployTemplates"` ProductionEnvironments string `yaml:"productionEnvironments"` EnvironmentParameter string `yaml:"environmentParameter"` NonInteractiveBranches string `yaml:"nonInteractiveBranches"` ExtraParameters map[string]string `yaml:"extraParameters"` API APIConfig `yaml:"api"` // contains filtered or unexported fields }
Config defines our configuration file format
func ReadConfig ¶ added in v0.9.1
type DeploymentPayload ¶ added in v0.9.1
type DeploymentPayload struct {
KubeCI KubeCIPayload `json:"kube_ci"`
}
type GithubClientInterface ¶ added in v0.9.1
type GithubClientInterface interface { GetInstallID() int GetHTTPClient() *http.Client GetRef(ctx context.Context, ref string) (*github.Reference, error) CreateCheckRun(ctx context.Context, opts github.CreateCheckRunOptions) (*github.CheckRun, error) GetRepo(ctx context.Context) (*github.Repository, error) UpdateCheckRun(ctx context.Context, id int64, upd github.UpdateCheckRunOptions) (*github.CheckRun, error) CreateDeployment(ctx context.Context, req *github.DeploymentRequest) (*github.Deployment, error) CreateDeploymentStatus(ctx context.Context, id int64, req *github.DeploymentStatusRequest) (*github.DeploymentStatus, error) IsMember(ctx context.Context, user string) (bool, error) CreateFile(ctx context.Context, filepath string, opts *github.RepositoryContentFileOptions) error GetContents(ctx context.Context, filepath string, opts *github.RepositoryContentGetOptions) ([]*github.RepositoryContent, error) GetBranch(ctx context.Context, branch string) (*github.Branch, error) GetPullRequest(ctx context.Context, prid int) (*github.PullRequest, error) CreateIssueComment(ctx context.Context, issueID int, opts *github.IssueComment) error }
type GithubEvent ¶ added in v0.11.0
type GithubEvent interface { GetInstallation() *github.Installation GetRepo() *github.Repository GetSender() *github.User }
GithubEvent is a copy of the type in cistarlark and can probably be replaced by that one in future
type GithubKeyStore ¶ added in v0.9.1
type GithubStatus ¶ added in v0.9.1
type GithubStatus struct { Status string Conclusion string DetailsURL string Actions []*github.CheckRunAction // output Title string Summary string Text string Annotations []*github.CheckRunAnnotation }
GithubStatus is a pseudo-ugly mapping of github checkrun and deployment status into a common struct to make workflow running agnostic to the reason the workflow was launched
type HookHandler ¶ added in v0.9.1
type HookHandler struct { Storage pvcManager Clients githubClientSource Runner workflowRunner Slash slashRunner UIBase string GitHubSecret []byte AppID int64 }
func (*HookHandler) LoggingWebhook ¶ added in v0.9.1
func (h *HookHandler) LoggingWebhook(w http.ResponseWriter, r *http.Request) (int, string)
type K8sStorageManager ¶ added in v0.9.1
type K8sStorageManager struct { Namespace string ManagedBy string KubeClient kubernetes.Interface }
type KubeCIPayload ¶ added in v0.9.1
type KubeCIPayload struct { Run bool `json:"run"` // should we run a workflow CreateDeployment bool `json:"create_deployment"` // if true, don't create a deployment // RefType and RefName avoid going to the github API if we already know what type of // ref the user requested RefType string `json:"ref_type"` RefName string `json:"ref_name"` SHA string `json:"sha"` }
DeploymentPayload will do something useful eventually
type RunRequest ¶ added in v0.10.0
type SlashHandler ¶ added in v0.9.1
type SlashHandler struct { Runner workflowRunner CIContextPath string CIYAMLFile string CIStarlarkFile string Templates TemplateSet }
type StatusHandler ¶ added in v0.9.1
type StatusHandler struct {
Status *int32
}
func (*StatusHandler) ServeHTTP ¶ added in v0.9.1
func (h *StatusHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
func (*StatusHandler) Shutdown ¶ added in v0.9.1
func (h *StatusHandler) Shutdown()
type TemplateSet ¶
type TemplateSet map[string]TemplateSpec
TemplateSet describes a set of templates
func (TemplateSet) Help ¶ added in v0.5.4
func (ts TemplateSet) Help() string
type TemplateSpec ¶
type TemplateSpec struct { Description string `yaml:"description"` CI string `yaml:"ci"` Deploy string `yaml:"deploy"` }
TemplateSpec gives the description, and location, of a set of config files for use by the setup slash command
type WorkflowContext ¶ added in v0.10.0
type WorkflowContext struct { Repo *github.Repository Entrypoint string Ref string RefType string SHA string ContextData map[string]string PRs []*github.PullRequest Event GithubEvent }
WorkflowContext is a copy of the type in cistarlark and can probably be replaced by that one in future