forgeazure

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultNode10ImageReference is the default image to use
	// when a task specifies a "Node10" execution.
	DefaultNode10ImageReference = "docker.io/library/node:10"
	// DefaultNode16ImageReference is the default image to use
	// when a task specifies a "Node16" execution.
	DefaultNode16ImageReference = "docker.io/library/node:16"
	// DefaultNodeImageReference is the default image to use
	// when a task specifies a "Node" execution.
	DefaultNodeImageReference = DefaultNode16ImageReference
)

Variables

View Source
var (
	DefaultRootPath = containerfs.WorkingDir
	DefaultTaskPath = DefaultRootPath + "/task"
)
View Source
var (
	// Node10ImageReference is the image to use
	// when a task specifies a "Node10" execution.
	Node10ImageReference = DefaultNode10ImageReference
	// Node16ImageReference is the image to use
	// when a task specifies a "Node16" execution.
	Node16ImageReference = DefaultNode16ImageReference
	// NodeImageReference is the image to use
	// when a task specifies a "Node" execution.
	NodeImageReference = DefaultNodeImageReference
)
View Source
var DefaultMapping = &Mapping{
	TaskPath: DefaultTaskPath,
}

Functions

func GetImageForExecution

func GetImageForExecution(ctx context.Context, containerRuntime forge.ContainerRuntime, execution Execution) (forge.Image, error)

GetImageForExecution ...

func TaskReferenceToDirectory

func TaskReferenceToDirectory(ref *azuredevops.TaskReference) (string, error)

TaskReferenceToDirectory is a re-export of DefaultMapping.TaskReferenceToDirectory for convenience purposes.

func TaskToContainerConfig

func TaskToContainerConfig(ref *azuredevops.TaskReference, task *azuredevops.Task, execution Execution, inputs map[string]string) (*forge.ContainerConfig, error)

Types

type Execution

type Execution int
const (
	ExecutionNode Execution = iota
	ExecutionNode16
	ExecutionNode10
	ExecutionPowershell
	ExecutionPowershell3
)

func ParseExecution

func ParseExecution(execution string) (Execution, error)

type Mapping

type Mapping struct {
	TaskPath string
}

func (*Mapping) TaskReferenceToDirectory

func (m *Mapping) TaskReferenceToDirectory(ref *azuredevops.TaskReference) (string, error)

TaskReferenceToDirectory takes an *azuredevops.TaskReference and returns the path to the directory where the corresponding task.json can be found on the host machine.

func (*Mapping) TaskToContainerConfig

func (m *Mapping) TaskToContainerConfig(ref *azuredevops.TaskReference, task *azuredevops.Task, execution Execution, inputs map[string]string) (*forge.ContainerConfig, error)

Jump to

Keyboard shortcuts

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