orchestrator

package module
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseProjectName

func ParseProjectName(comment string) string

func ParseWorkspace

func ParseWorkspace(comment string) (string, error)

Types

type Comment

type Comment struct {
	Id   interface{}
	Body *string
}

type Job

type Job struct {
	ProjectName       string
	ProjectDir        string
	ProjectWorkspace  string
	ProjectWorkflow   string
	Terragrunt        bool
	Commands          []string
	ApplyStage        *Stage
	PlanStage         *Stage
	PullRequestNumber *int
	EventName         string
	RequestedBy       string
	Namespace         string
	StateEnvVars      map[string]string
	CommandEnvVars    map[string]string
}

func JsonToJob

func JsonToJob(jobJson JobJson) Job

type JobJson

type JobJson struct {
	ProjectName       string            `json:"projectName"`
	ProjectDir        string            `json:"projectDir"`
	ProjectWorkspace  string            `json:"projectWorkspace"`
	Terragrunt        bool              `json:"terragrunt"`
	Commands          []string          `json:"commands"`
	ApplyStage        StageJson         `json:"applyStage"`
	PlanStage         StageJson         `json:"planStage"`
	PullRequestNumber *int              `json:"pullRequestNumber"`
	EventName         string            `json:"eventName"`
	RequestedBy       string            `json:"requestedBy"`
	Namespace         string            `json:"namespace"`
	StateEnvVars      map[string]string `json:"stateEnvVars"`
	CommandEnvVars    map[string]string `json:"commandEnvVars"`
}

func JobToJson

func JobToJson(job Job) JobJson

type OrgService

type OrgService interface {
	GetUserTeams(organisation string, user string) ([]string, error)
}

type PullRequestService

type PullRequestService interface {
	GetChangedFiles(prNumber int) ([]string, error)
	PublishComment(prNumber int, comment string) error
	EditComment(id interface{}, comment string) error
	GetComments(prNumber int) ([]Comment, error)
	// SetStatus set status of specified pull/merge request, status could be: "pending", "failure", "success"
	SetStatus(prNumber int, status string, statusContext string) error
	GetCombinedPullRequestStatus(prNumber int) (string, error)
	MergePullRequest(prNumber int) error
	// IsMergeable is still open and ready to be merged
	IsMergeable(prNumber int) (bool, error)
	// IsMerged merged and closed
	IsMerged(prNumber int) (bool, error)
	// IsClosed closed without merging
	IsClosed(prNumber int) (bool, error)
	GetBranchName(prNumber int) (string, error)
}

type Stage

type Stage struct {
	Steps []Step
}

func ToConfigStage

func ToConfigStage(configStage *configuration.Stage) *Stage

type StageJson

type StageJson struct {
	Steps []StepJson `json:"steps"`
}

type Step

type Step struct {
	Action    string
	Value     string
	ExtraArgs []string
	Shell     string
}

func ToConfigStep

func ToConfigStep(configState configuration.Step) Step

type StepJson

type StepJson struct {
	Action    string   `json:"action"`
	ExtraArgs []string `json:"extraArgs"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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