project

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultRegions      []string = []string{"us-east-1"}
	DefaultEnvironments []string = []string{"dev"}

	DefaultFileSet assets.FileSet = assets.FileSet{
		AssetsPath: "templates/prj",
		Set: map[string]map[string][]assets.FileTmpl{
			"aws": {
				"platform": []assets.FileTmpl{},
				"project": []assets.FileTmpl{
					{TmplFile: "prj.yml.tmpl", File: "prj.yml"},
					{TmplFile: "gitignore.tmpl", File: ".gitignore"},
					{TmplFile: "terragrunt.hcl.tmpl", File: "terragrunt.hcl"},
				},
				"environment": []assets.FileTmpl{
					{TmplFile: "env.yml.tmpl", File: "env.yml"},
				},
				"region": []assets.FileTmpl{
					{TmplFile: "region.yml.tmpl", File: "region.yml"},
					{TmplFile: "gitignore_region.tmpl", File: ".gitignore"},
				},
			},
		},
	}
)
View Source
var (
	DefaultIgnoredFiles []string = []string{
		"prj.yml",
		"env.yml",
		"region.yml",
		".git",
	}

	DefaultIgnoredFolders []string = []string{
		".terraform.lock.hcl",
		".terragrunt-cache",
		".history",
	}
)

Functions

func CleanStackFolder

func CleanStackFolder(stackFolder string, ignoreFolders []string) (err error)

func CloneEnv added in v0.0.2

func CloneEnv(basePath string, name string, src string) (err error)

func CopyBlueprintFolders

func CopyBlueprintFolders(workingFolder string, destinyFolder string, ignoreFolders []string, verbose bool) (err error)

func DoInit

func DoInit(prjConfig *ProjectConfig, linkInit bool) (err error)

func GetConfigFiles

func GetConfigFiles(location string, fileName string, ignoreFolders []string) (configFiles []string, err error)

func InitProject

func InitProject(basePath string, linkInit bool) (err error)

func LinkBlueprintFolders

func LinkBlueprintFolders(workingFolder string, destinyFolder string, ignoreFolders []string, verbose bool) (err error)

func SyncBlueprintFolders

func SyncBlueprintFolders(workingFolder string, destinyFolder string, ignoreFolders []string, linkInit bool) error

func ValidateProject

func ValidateProject(prjConfig *ProjectConfig) (isValid bool, err error)

Types

type EnvConfig added in v0.0.2

type EnvConfig struct {
	Environment string   `yaml:"environment"`
	BasePath    string   `yaml:"basePath"`
	Ignore      []string `yaml:"ignore"`
}

func GetEnvConfig added in v0.0.2

func GetEnvConfig(filePath string) (envConfig *EnvConfig, err error)

type ProjectConfig

type ProjectConfig struct {
	Name          string   `yaml:"name"`
	SlugName      string   `yaml:"slugName"`
	BluePrint     string   `yaml:"blueprint"`
	BluePrintPath string   `yaml:"blueprintPath"`
	Stack         string   `yaml:"stack"`
	BasePath      string   `yaml:"basePath"`
	ProjectPath   string   `yaml:"projectPath"`
	Ignore        []string `yaml:"ignore"`
}

func GetProjectConfig

func GetProjectConfig(filePath string) (prjConfig *ProjectConfig, err error)

type ProjectScaffold

type ProjectScaffold struct {
	model.Scaffold
	Platform       string
	PlatformPath   string
	ProjectPath    string
	Stack          string
	Blueprint      string
	Environments   []model.Environment
	Regions        []model.Region
	UseRemoteState bool
	RemoteBucket   string
	RemoteRegion   string
}

func NewProject

func NewProject(
	base *model.Scaffold,
	plaform string,
	stack string,
	blueprint string,
	useRemoteState bool,
	remoteStateBucket string,
	remoteStateRegion string,
	environments []string,
	regions []string) (project *ProjectScaffold, err error)

func (*ProjectScaffold) Init

func (p *ProjectScaffold) Init() (err error)

type RegionConfig

type RegionConfig struct {
	Region   string   `yaml:"region"`
	BasePath string   `yaml:"basePath"`
	Ignore   []string `yaml:"ignore"`
}

func GetRegionConfig

func GetRegionConfig(filePath string) (regConfig *RegionConfig, err error)

Jump to

Keyboard shortcuts

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