Documentation
¶
Index ¶
- Constants
- func CopyDirectory(src string, dest string) error
- func CopyFile(src string, dest string) error
- func FindFiles(dir, filename string) ([]string, error)
- func ReadTfvars(filename string, val interface{}) error
- func ReplaceStringInFile(filename, old, new string) error
- func WriteTfvars(filename string, val interface{}) error
- type GitRepo
- func (g GitRepo) AddRemote(name, url string) error
- func (g GitRepo) CheckoutBranch(branch string) error
- func (g GitRepo) CommitFiles(msg string) error
- func (g GitRepo) GetCommitSha() (string, error)
- func (g GitRepo) GetCurrentBranch() (string, error)
- func (g GitRepo) HasUpstream(branch, remote string) (bool, error)
- func (g GitRepo) PushBranch(branch, remote string) error
Constants ¶
const ( TerraformTempDir = ".terraform" TerraformLockFile = ".terraform.lock.hcl" )
Variables ¶
This section is empty.
Functions ¶
func CopyDirectory ¶
CopyDirectory copies a directory and the files and directories under it.
func FindFiles ¶
FindFiles find files with the given filename under the directory skipping terraform temp dir.
func ReadTfvars ¶
ReadTfvars reads a valid terraform tfvars file into the provided struct.
func ReplaceStringInFile ¶
ReplaceStringInFile replaces a string in a file with a new value.
func WriteTfvars ¶
WriteTfvars writes a valid terraform tfvars file from the provided struct.
Types ¶
type GitRepo ¶
type GitRepo struct {
// contains filtered or unexported fields
}
func CloneCSR ¶
CloneCSR clones a Google Cloud Source repository and returns a CmdConfig pointing to the repository.
func (GitRepo) CheckoutBranch ¶
CheckoutBranch checkouts a branch. If the branch does not exist it will be created.
func (GitRepo) CommitFiles ¶
CommitFiles commit files it there are pending changes.
func (GitRepo) GetCommitSha ¶
GetCommitSha gets the commit SHA of the last commit of the current branch
func (GitRepo) GetCurrentBranch ¶
GetCurrentBranch gets the current branch in the repository.
func (GitRepo) HasUpstream ¶
HasUpstream check it a branch has an upstream branch configured.
func (GitRepo) PushBranch ¶
PushBranch pushes a branch to 'remote' repository .