deploy

package
v2.5.0-pre Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2023 License: AGPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultServiceUnit

func DefaultServiceUnit(ctx context.Context, serviceManager *ServiceManager) error

DefaultServiceUnit will write the default "bootstrapper.service" unit file.

func EnableAutoLogin added in v2.2.0

func EnableAutoLogin(ctx context.Context, fs afero.Fs, serviceManager serviceManager) error

EnableAutoLogin installs a systemd unit override that allows passwordless root login on the serial console.

Types

type Download

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

Download downloads a bootstrapper from a given debugd instance.

func New

func New(log *logger.Logger, dialer NetDialer, serviceManager serviceManager,
	writer streamToFileWriter, info infoSetter,
) *Download

New creates a new Download.

func (*Download) DownloadDeployment

func (d *Download) DownloadDeployment(ctx context.Context, ip string) error

DownloadDeployment will open a new grpc connection to another instance, attempting to download a bootstrapper from that instance.

func (*Download) DownloadInfo added in v2.3.0

func (d *Download) DownloadInfo(ctx context.Context, ip string) error

DownloadInfo will try to download the info from another instance.

type NetDialer

type NetDialer interface {
	DialContext(ctx context.Context, network, address string) (net.Conn, error)
}

NetDialer can open a net.Conn.

type ServiceManager

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

ServiceManager receives ServiceManagerRequests and units via channels and performs the requests / creates the unit files.

func NewServiceManager

func NewServiceManager(log *logger.Logger) *ServiceManager

NewServiceManager creates a new ServiceManager.

func (*ServiceManager) SystemdAction

func (s *ServiceManager) SystemdAction(ctx context.Context, request ServiceManagerRequest) error

SystemdAction will perform a systemd action on a service unit (start, stop, restart, reload).

func (*ServiceManager) WriteSystemdUnitFile

func (s *ServiceManager) WriteSystemdUnitFile(ctx context.Context, unit SystemdUnit) error

WriteSystemdUnitFile will write a systemd unit to disk.

type ServiceManagerRequest

type ServiceManagerRequest struct {
	Unit   string
	Action SystemdAction
}

ServiceManagerRequest describes a requested ServiceManagerAction to be performed on a specified service unit.

type SystemdAction

type SystemdAction uint32

SystemdAction encodes the available actions.

const (
	// Unknown is the default SystemdAction and does nothing.
	Unknown SystemdAction = iota
	// Start a systemd service.
	Start
	// Stop a systemd service.
	Stop
	// Restart a systemd service.
	Restart
	// Reload a systemd service.
	Reload
)

func (SystemdAction) String

func (i SystemdAction) String() string

type SystemdUnit

type SystemdUnit struct {
	Name     string `yaml:"name"`
	Contents string `yaml:"contents"`
}

SystemdUnit describes a systemd service file including the unit name and contents.

Jump to

Keyboard shortcuts

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