Documentation
¶
Overview ¶
Package azdevops parses Azure DevOps pipeline YAML files and converts them to workflow.Workflow so the existing runner can execute them.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var AzureImageMap = map[string]string{
"ubuntu-latest": "ghcr.io/catthehacker/ubuntu:act-latest",
"ubuntu-22.04": "ghcr.io/catthehacker/ubuntu:act-22.04",
"ubuntu-20.04": "ghcr.io/catthehacker/ubuntu:act-20.04",
"ubuntu-18.04": "ghcr.io/catthehacker/ubuntu:act-18.04",
"windows-latest": "ghcr.io/catthehacker/ubuntu:act-latest",
"windows-2022": "ghcr.io/catthehacker/ubuntu:act-latest",
"windows-2019": "ghcr.io/catthehacker/ubuntu:act-latest",
"macos-latest": "ghcr.io/catthehacker/ubuntu:act-latest",
"macos-13": "ghcr.io/catthehacker/ubuntu:act-latest",
"macos-12": "ghcr.io/catthehacker/ubuntu:act-latest",
}
AzureImageMap maps Azure DevOps vmImage labels to Docker images.
Functions ¶
func DiscoverPipelines ¶
DiscoverPipelines finds azure-pipelines.yml / azure-pipelines.yaml in dir.
func IsPipelineFile ¶
IsPipelineFile returns true if path looks like an Azure DevOps pipeline file.
Types ¶
type Job ¶
type Job struct {
Job string `yaml:"job"`
DisplayName string `yaml:"displayName"`
Pool *Pool `yaml:"pool"`
DependsOn StringOrSlice `yaml:"dependsOn"`
Variables VariablesField `yaml:"variables"`
Steps []Step `yaml:"steps"`
Condition string `yaml:"condition"`
TimeoutInMinutes int `yaml:"timeoutInMinutes"`
}
Job represents an Azure DevOps job.
type Pipeline ¶
type Pipeline struct {
Name string `yaml:"name"`
Trigger interface{} `yaml:"trigger"`
Pool *Pool `yaml:"pool"`
Variables VariablesField `yaml:"variables"`
Jobs []Job `yaml:"jobs"`
Stages []Stage `yaml:"stages"`
Steps []Step `yaml:"steps"` // top-level steps (no explicit job)
}
Pipeline represents a parsed azure-pipelines.yml file.
type Stage ¶
type Stage struct {
Stage string `yaml:"stage"`
DisplayName string `yaml:"displayName"`
DependsOn StringOrSlice `yaml:"dependsOn"`
Jobs []Job `yaml:"jobs"`
}
Stage represents an Azure DevOps stage.
type Step ¶
type Step struct {
Script string `yaml:"script"`
Bash string `yaml:"bash"`
PowerShell string `yaml:"powershell"`
Task string `yaml:"task"`
Checkout string `yaml:"checkout"`
DisplayName string `yaml:"displayName"`
Name string `yaml:"name"`
Env map[string]string `yaml:"env"`
Inputs map[string]string `yaml:"inputs"`
Condition string `yaml:"condition"`
WorkingDirectory string `yaml:"workingDirectory"`
ContinueOnError bool `yaml:"continueOnError"`
TimeoutInMinutes int `yaml:"timeoutInMinutes"`
}
Step represents a single Azure DevOps step.
type StringOrSlice ¶
type StringOrSlice []string
StringOrSlice handles YAML fields that can be a string or []string.
func (*StringOrSlice) UnmarshalYAML ¶
func (s *StringOrSlice) UnmarshalYAML(node *yaml.Node) error
type VariablesField ¶
VariablesField handles Azure DevOps variables as a map or a list of {name, value} objects.
func (*VariablesField) UnmarshalYAML ¶
func (v *VariablesField) UnmarshalYAML(node *yaml.Node) error