command

package
v0.0.0-...-c8d08d2 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2024 License: Apache-2.0 Imports: 15 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewScript

func NewScript(ctx *pulumi.Context,
	conn *remote.ConnectionArgs,
	localScriptPath string,
	createParam, updateParam, deleteParam *string,
) (*remote.Command, error)

If *Param is nil, the create/update/delete command is not run

func WaitForCloudInit

func WaitForCloudInit(runner *Runner) (*remote.Command, error)

func WaitForSuccessfulConnection

func WaitForSuccessfulConnection(runner *Runner) (*remote.Command, error)

Types

type Args

type Args struct {
	Create                   pulumi.StringInput
	Update                   pulumi.StringInput
	Delete                   pulumi.StringInput
	Triggers                 pulumi.ArrayInput
	Stdin                    pulumi.StringPtrInput
	Environment              pulumi.StringMap
	RequirePasswordFromStdin bool
	Sudo                     bool
}

type FileManager

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

func NewFileManager

func NewFileManager(runner *Runner) *FileManager

func (*FileManager) CopyAbsoluteFolder

func (fm *FileManager) CopyAbsoluteFolder(absoluteFolder string, remoteFolder string, opts ...pulumi.ResourceOption) ([]pulumi.Resource, error)

CopyAbsoluteFolder copies recursively a folder to a remote folder. This function returns the resources that can be used with `pulumi.DependsOn`.

func (*FileManager) CopyFSFolder

func (fm *FileManager) CopyFSFolder(
	folderFS fs.FS,
	folderPath string,
	remoteFolder string,
	opts ...pulumi.ResourceOption,
) ([]pulumi.Resource, error)

CopyFSFolder copies recursively a local folder to a remote folder. You may consider using `CopyRelativeFolder` which has a simpler API.

func (*FileManager) CopyFile

func (fm *FileManager) CopyFile(name string, localPath, remotePath pulumi.StringInput, opts ...pulumi.ResourceOption) (pulumi.Resource, error)

func (*FileManager) CopyInlineFile

func (fm *FileManager) CopyInlineFile(fileContent pulumi.StringInput, remotePath string, opts ...pulumi.ResourceOption) (pulumi.Resource, error)

func (*FileManager) CopyRelativeFile

func (fm *FileManager) CopyRelativeFile(relativePath string, remotePath string, opts ...pulumi.ResourceOption) (pulumi.Resource, error)

CopyRelativeFile copies relative path to a remote path. The relative path is defined in the same way as for `CopyRelativeFolder`. This function returns the resource that can be used with `pulumi.DependsOn`.

func (*FileManager) CopyRelativeFolder

func (fm *FileManager) CopyRelativeFolder(relativeFolder string, remoteFolder string, opts ...pulumi.ResourceOption) ([]pulumi.Resource, error)

CopyRelativeFolder copies recursively a relative folder to a remote folder. The path of the folder is relative to the caller of this function. For example, if this function is called from ~/foo/test.go with remoteFolder="bar" then the full path of the folder will be ~/foo/bar“. This function returns the resources that can be used with `pulumi.DependsOn`.

func (*FileManager) CreateDirectory

func (fm *FileManager) CreateDirectory(remotePath string, useSudo bool, opts ...pulumi.ResourceOption) (*remote.Command, error)

CreateDirectory if it does not exist

func (*FileManager) CreateDirectoryForFile

func (fm *FileManager) CreateDirectoryForFile(remotePath string, useSudo bool, opts ...pulumi.ResourceOption) (*remote.Command, error)

CreateDirectoryForFile if the directory does not exist To avoid pulumi.URN collisions if multiple files use the same directory, use the full filePath as URN and path.Split out the folderPath for creation

func (*FileManager) CreateDirectoryFromPulumiString

func (fm *FileManager) CreateDirectoryFromPulumiString(name string, remotePath pulumi.String, useSudo bool, opts ...pulumi.ResourceOption) (*remote.Command, error)

CreateDirectoryFromPulumiString if it does not exist from directory name as a Pulumi String

func (*FileManager) HomeDirectory

func (fm *FileManager) HomeDirectory(folderName string, opts ...pulumi.ResourceOption) (*remote.Command, string, error)

HomeDirectory creates a directory in home directory, if it does not exist A home directory is a file system directory on a multi-user operating system containing files for a given user of the system. It does not require sudo, using sudo in home directory allows to change default ownership and it is discouraged.

func (*FileManager) IsPathAbsolute

func (fm *FileManager) IsPathAbsolute(path string) bool

func (*FileManager) TempDirectory

func (fm *FileManager) TempDirectory(folderName string, opts ...pulumi.ResourceOption) (*remote.Command, string, error)

TempDirectory creates a temporary directory

type GenericPackageManager

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

func NewGenericPackageManager

func NewGenericPackageManager(
	runner *Runner,
	name string,
	installCmd string,
	updateCmd string,
	env pulumi.StringMap,
) *GenericPackageManager

func (*GenericPackageManager) Ensure

func (m *GenericPackageManager) Ensure(packageRef string, transform Transformer, checkBinary string, opts ...pulumi.ResourceOption) (*remote.Command, error)

type LocalRunner

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

func NewLocalRunner

func NewLocalRunner(e config.Env, args LocalRunnerArgs) *LocalRunner

func (*LocalRunner) Command

func (r *LocalRunner) Command(name string, args *Args, opts ...pulumi.ResourceOption) (*local.Command, error)

type LocalRunnerArgs

type LocalRunnerArgs struct {
	User      string
	OSCommand OSCommand
}

type OSCommand

type OSCommand interface {
	GetTemporaryDirectory() string
	GetHomeDirectory() string

	CreateDirectory(
		runner *Runner,
		resourceName string,
		remotePath pulumi.StringInput,
		useSudo bool,
		opts ...pulumi.ResourceOption) (*remote.Command, error)

	BuildCommandString(
		command pulumi.StringInput,
		env pulumi.StringMap,
		sudo bool,
		passwordFromStdin bool,
		user string) pulumi.StringInput

	IsPathAbsolute(path string) bool

	NewCopyFile(runner *Runner, name string, localPath, remotePath pulumi.StringInput, opts ...pulumi.ResourceOption) (pulumi.Resource, error)
}

OSCommand defines the commands which are OS specifics

func NewUnixOSCommand

func NewUnixOSCommand() OSCommand

func NewWindowsOSCommand

func NewWindowsOSCommand() OSCommand

type ReadyFunc

type ReadyFunc func(*Runner) (*remote.Command, error)

type Runner

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

func NewRunner

func NewRunner(e config.Env, args RunnerArgs) (*Runner, error)

func (*Runner) Command

func (r *Runner) Command(name string, args *Args, opts ...pulumi.ResourceOption) (*remote.Command, error)

func (*Runner) NewCopyFile

func (r *Runner) NewCopyFile(name string, localPath, remotePath pulumi.StringInput, opts ...pulumi.ResourceOption) (pulumi.Resource, error)

type RunnerArgs

type RunnerArgs struct {
	ParentResource pulumi.Resource
	ConnectionName string
	Connection     remote.ConnectionInput
	ReadyFunc      ReadyFunc
	User           string
	OSCommand      OSCommand
}

type Transformer

type Transformer func(name string, args Args) (string, Args)

Transformer is a function that can be used to modify the command name and args. Examples: swapping `args.Delete` with `args.Create`, or adding `args.Triggers`, or editing the name

Jump to

Keyboard shortcuts

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