forgeazure

package
v0.15.5 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

package forgeazure utilizes types and functionality specific to Azure DevOps to create types and functionality specific to Forge to enable the execution of Azure Devops Tasks.

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 (
	DefaultTaskPath = containerfs.WorkingDir + "/task"
	DefaultMapping  = &Mapping{
		TaskPath: DefaultTaskPath,
	}
)
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
)

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