local_file

package
v0.0.0-...-841f565 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ComputedAttrs

type ComputedAttrs struct {
	Filename             string      `hcl:"filename,attr"`
	Content              string      `hcl:"content,attr"`
	FilePermissions      os.FileMode `hcl:"file_permissions,optional"`
	DirectoryPermissions os.FileMode `hcl:"directory_permissions,optional"`
}

ComputedAttrs used to store the computed attributes of a local_file target

type Target

type Target struct {
	*base.RawTarget `json:"-"`

	Filename             hcl.Expression `hcl:"filename,attr"`
	Content              hcl.Expression `hcl:"content,attr"`
	FilePermissions      hcl.Expression `hcl:"file_permissions,optional"`
	DirectoryPermissions hcl.Expression `hcl:"directory_permissions,optional"`
}

Target an executable target, when built, it creates a file from provided data

func (Target) Artifact

func (t Target) Artifact() string

Artifact returns the absolute path to an artifact

func (Target) Attributes

func (t Target) Attributes() map[string]cty.Value

Attributes returns a combined map of rawTarget.Attributes and typedTarget.Attributes

func (Target) Build

func (t Target) Build() error

Build creates the file from the content in the location specified with the permissions specified

func (Target) CacheEnabled

func (t Target) CacheEnabled()

CacheEnabled overrides the default target caching behavior

func (Target) CheckLocalBuildCache

func (t Target) CheckLocalBuildCache() (bool, error)

CheckLocalBuildCache loads the build cache state and verifies that the hashes match

func (Target) ComputedAttrs

func (t Target) ComputedAttrs() *ComputedAttrs

ComputedAttrs returns a pointer to computed attributes from the state store. If attributes are not in the state store it will create a new pointer and insert it into the state store.

func (Target) CopyArtifact

func (t Target) CopyArtifact() error

CopyArtifact makes a copy of an artifact in a desired location

func (Target) PreBuild

func (t Target) PreBuild() error

PreBuild a lifecycle hook for calculating state before the build

Jump to

Keyboard shortcuts

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