deploy

package
v0.26.8 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

deploy contains reusable infrastructure for Bicep deployments.

Package deploy is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeployWithProgress

func DeployWithProgress(ctx context.Context, options Options) (clients.DeploymentResult, error)

DeployWithProgress injects environment and application parameters into the template, displays progress updates while deploying, and logs the deployment results and public endpoints. If an error occurs, an error is returned.

Types

type Entry

type Entry struct {
	// FinalState is an optional token that will replace the spinner with static text.
	FinalState string

	// Format is the format string used to build the output line. It is expected to contain a placeholder
	// for the spinner/final-state token.
	Format string
}

type Impl

type Impl struct {
}

func (*Impl) DeployWithProgress

func (*Impl) DeployWithProgress(ctx context.Context, options Options) (clients.DeploymentResult, error)

DeployWithProgress runs a deployment and displays progress to the user. This is intended to be used from the CLI and thus logs to the console.

type InteractiveListener

type InteractiveListener struct {
	Spinner []string
	// contains filtered or unexported fields
}

func (*InteractiveListener) Run

func (listener *InteractiveListener) Run()

Run() concurrently updates the UI with a spinner and writes output for each resource update received from the progressChan channel.

type Interface

type Interface interface {
	// DeployWithProgress runs a deployment and displays progress to the user. This is intended to be used
	// from the CLI and thus logs to the console.
	DeployWithProgress(ctx context.Context, options Options) (clients.DeploymentResult, error)
}

Interface is the interface for executing Bicep deployments in the CLI.

type MockInterface

type MockInterface struct {
	// contains filtered or unexported fields
}

MockInterface is a mock of Interface interface.

func NewMockInterface

func NewMockInterface(ctrl *gomock.Controller) *MockInterface

NewMockInterface creates a new mock instance.

func (*MockInterface) DeployWithProgress

func (m *MockInterface) DeployWithProgress(arg0 context.Context, arg1 Options) (clients.DeploymentResult, error)

DeployWithProgress mocks base method.

func (*MockInterface) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

type MockInterfaceMockRecorder

type MockInterfaceMockRecorder struct {
	// contains filtered or unexported fields
}

MockInterfaceMockRecorder is the mock recorder for MockInterface.

func (*MockInterfaceMockRecorder) DeployWithProgress

func (mr *MockInterfaceMockRecorder) DeployWithProgress(arg0, arg1 interface{}) *gomock.Call

DeployWithProgress indicates an expected call of DeployWithProgress.

type NoOpListener

type NoOpListener struct {
	// contains filtered or unexported fields
}

func (*NoOpListener) Run

func (listener *NoOpListener) Run()

Run() continuously drains the updates from the progressChan channel without taking any action.

type Options

type Options struct {
	// ConnectionFactory is used to create the deployment client.
	ConnectionFactory connections.Factory

	// Parameters should contain the parameters to set for the deployment.
	Parameters clients.DeploymentParameters

	// Template should contain a parsed ARM-JSON template.
	Template map[string]any

	// Workspace is the workspace to use for deployment.
	Workspace workspaces.Workspace

	// Providers are cloud and radius providers configured on the env for deployment
	Providers *clients.Providers

	// ProgressText is a message displayed on the console when deployment begins.
	ProgressText string

	// CompleteText is a message displayed on the console when deployment completes.
	CompletionText string
}

Options contains options to be used with DeployWithProgress.

type ProgressListener

type ProgressListener interface {
	// Run is called to print progress to the command line. This should be called from
	// a goroutine because it blocks until the progress channel is closed.
	Run()
}

func NewProgressListener

func NewProgressListener(progressChan <-chan clients.ResourceProgress) ProgressListener

NewProgressListener creates a new ProgressListener based on whether the output is a terminal or not, returning an InteractiveListener if it is a terminal and a NoOpListener if it is not.

type PublicEndpoint

type PublicEndpoint struct {
	Resource ucpresources.ID
	Endpoint string
}

func FindPublicEndpoints

func FindPublicEndpoints(ctx context.Context, diag clients.DiagnosticsClient, result clients.DeploymentResult) ([]PublicEndpoint, error)

FindPublicEndpoints iterates through a list of resources and attempts to retrieve a public endpoint for each one, returning a list of public endpoints and an error if one occurs.

Jump to

Keyboard shortcuts

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