Documentation ¶
Index ¶
- func GetBlocks(fullString string) []curlyBlock
- type Model
- type ModelAgent
- type ModelEnvironmentEntry
- type ModelEnvironmentEntryValue
- type ModelPipelineEntry
- type ModelPostEntry
- type ModelStage
- type ModelStageEntry
- type ModelStep
- type ModelStepArg
- type ModelStepNamedArg
- type ModelWhen
- type UnsupportedModelBlock
- type Value
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Model ¶
type Model struct {
Pipeline []*ModelPipelineEntry `"pipeline" "{" { @@ } "}"`
}
Model is the base for the entire pipeline model
func ParseJenkinsfile ¶
ParseJenkinsfile takes a Jenkinsfile and returns the resulting model
func ParseJenkinsfileInDirectory ¶
ParseJenkinsfileInDirectory looks for a Jenkinsfile in a directory and parses it
type ModelAgent ¶
type ModelAgent struct {
Label string `"label" @String`
}
ModelAgent represents the agent block in Declarative
func (*ModelAgent) ToString ¶
func (m *ModelAgent) ToString() string
ToString converts the model to a rough string form
type ModelEnvironmentEntry ¶
type ModelEnvironmentEntry struct { Key string `@Ident` Value *ModelEnvironmentEntryValue `"=" @@` }
ModelEnvironmentEntry represents a `foo = bar` (or `foo = credentials("bar")` in the environment block
func (*ModelEnvironmentEntry) ToJXEnv ¶
func (m *ModelEnvironmentEntry) ToJXEnv() []corev1.EnvVar
ToJXEnv converts to jenkins-x.yml friendly environment variables
type ModelEnvironmentEntryValue ¶
type ModelEnvironmentEntryValue struct { StringValue *string ` @(String|Char)` Credential *string `| "credentials" "(" @(String|Char) ")"` }
ModelEnvironmentEntryValue represents either a string or a credentials step's value
func (*ModelEnvironmentEntryValue) ToString ¶
func (m *ModelEnvironmentEntryValue) ToString() string
ToString converts the model to a rough string form
type ModelPipelineEntry ¶
type ModelPipelineEntry struct { Agent *ModelAgent `"agent" "{" @@ "}"` Environment []*ModelEnvironmentEntry `| "environment" "{" { @@ } "}"` Stages []*ModelStage `| "stages" "{" { @@ } "}"` Post []*ModelPostEntry `| "post" "{" { @@ } "}"` Unsupported []*UnsupportedModelBlock `| @@` }
ModelPipelineEntry represents the directives that can be contained within the pipeline block
type ModelPostEntry ¶
ModelPostEntry represents a post condition and its steps
type ModelStage ¶
type ModelStage struct { Name string `"stage" "(" @String ")"` Entries []*ModelStageEntry `"{" { @@ } "}"` }
ModelStage represents a stage in a Jenkinsfile
type ModelStageEntry ¶
type ModelStageEntry struct { Agent *ModelAgent ` "agent" "{" @@ "}"` Environment []*ModelEnvironmentEntry `| "environment" "{" { @@ } "}"` Steps []*ModelStep `| "steps" "{" { @@ } "}"` Post []*ModelPostEntry `| "post" "{" { @@ } "}"` When *ModelWhen `| "when" "{" @@ "}"` Unsupported []*UnsupportedModelBlock `| @@` }
ModelStageEntry represents the various directives contained within a stage
type ModelStep ¶
type ModelStep struct { Name string `@Ident` Args []*ModelStepArg `"("? @@? { "," @@ } ")"?` NestedSteps []*ModelStep `("{" { @@ } "}")*` }
ModelStep represents either a normal step or a script block
type ModelStepArg ¶
type ModelStepArg struct { Unnamed *Value ` @@` Named *ModelStepNamedArg `| @@` }
ModelStepArg represents an argument to a step
func (*ModelStepArg) ToString ¶
func (m *ModelStepArg) ToString() string
ToString converts the model to a rough string form
type ModelStepNamedArg ¶
func (*ModelStepNamedArg) ToString ¶
func (m *ModelStepNamedArg) ToString() string
ToString converts the model to a rough string form
type ModelWhen ¶
type ModelWhen struct { Branch string `"branch" @String` Unsupported []*UnsupportedModelBlock `| @@` }
ModelWhen represents a when block - only branch is supported currently
type UnsupportedModelBlock ¶
UnsupportedModelBlock represents a field that is unsupported and will cause an error.
func (*UnsupportedModelBlock) ToString ¶
func (m *UnsupportedModelBlock) ToString() string
ToString converts the model to a rough string form