Documentation
¶
Index ¶
- Constants
- type Layout
- func (td Layout) CleanStaleSessions(ctx context.Context, logger slog.Logger, fs afero.Fs, now time.Time) error
- func (td Layout) Cleanup(ctx context.Context, logger slog.Logger, fs afero.Fs)
- func (td Layout) ExtractArchive(ctx context.Context, logger slog.Logger, fs afero.Fs, cfg *proto.Config) error
- func (td Layout) ModulesDirectory() string
- func (td Layout) ModulesFilePath() string
- func (td Layout) PlanFilePath() string
- func (td Layout) ReadmeFilePath() string
- func (td Layout) SelectWorkspace(fs afero.Fs) error
- func (td Layout) StateFilePath() string
- func (td Layout) StateSessionDirectory() string
- func (td Layout) TerraformLockFile() string
- func (td Layout) TerraformMetadataDir() string
- func (td Layout) WorkDirectory() string
- func (td Layout) WorkspaceEnvironmentFilePath() string
Constants ¶
const (
// ReadmeFile is the location we look for to extract documentation from template versions.
ReadmeFile = "README.md"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Layout ¶
type Layout struct {
// contains filtered or unexported fields
}
func EphemeralSessionDir ¶
EphemeralSessionDir returns the directory name with mandatory prefix. These directories are created for each provisioning session and are meant to be ephemeral.
func (Layout) CleanStaleSessions ¶
func (td Layout) CleanStaleSessions(ctx context.Context, logger slog.Logger, fs afero.Fs, now time.Time) error
CleanStaleSessions assumes this Layout is the latest active template version. Assuming that, any other template version directories found alongside it are considered inactive and can be removed. Inactive template versions should use ephemeral TerraformDirectories.
func (Layout) ExtractArchive ¶
func (Layout) ModulesDirectory ¶
func (Layout) ModulesFilePath ¶
func (Layout) PlanFilePath ¶
func (Layout) ReadmeFilePath ¶
func (Layout) SelectWorkspace ¶
SelectWorkspace writes the terraform workspace environment file, which acts as `terraform workspace select <name>`. It is quicker than using the cli command. More importantly this code can be written without changing the executor behavior, which is nice encapsulation for this experiment.
func (Layout) StateFilePath ¶
func (Layout) StateSessionDirectory ¶
StateSessionDirectory follows the same directory structure as Terraform workspaces. All build specific state is stored within this directory.
These files should be cleaned up on exit. In the case of a failure, they will not collide with other builds since each build uses a unique session ID.