Documentation ¶
Index ¶
- Constants
- func CheckoutSource(source *Source, secrets map[string]string) (string, error)
- func GetRepoRoot(fullPath string) (string, error)
- func IsLocal(workDir, source string, pathExistsFunc ...func(path string) (bool, error)) (bool, string)
- func Uncompress(src string, dst string) error
- type Gitter
- type Source
Constants ¶
const CredentialsKey = "GIT_CREDENTIALS"
Variables ¶
This section is empty.
Functions ¶
func CheckoutSource ¶
CheckoutSource checks out a git repo (source) into a local temp directory. It will return the source of the local repo an an error if one occured. Secrets can optionally be passed if the repo is private.
func GetRepoRoot ¶
GetRepoRoot determines the repo root from a full path. Returns empty string and no error if not found
func IsLocal ¶
func IsLocal(workDir, source string, pathExistsFunc ...func(path string) (bool, error)) (bool, string)
IsLocal tries returns true and full path of directory if the path is a local one, and false and empty string if not.
func Uncompress ¶
Uncompress is a modified version of: https://gist.github.com/mimoo/25fc9716e0f1353791f5908f94d6e726
Types ¶
type Source ¶
type Source struct { // is it a local folder intended for a local runtime? Local bool // absolute path to service folder in local mode FullPath string // path of folder to repo root // be it local or github repo Folder string // github ref Ref string // for cloning purposes // blank for local Repo string // dir to repo root // blank for non local LocalRepoRoot string }
Source is not just git related @todo move
func ParseSource ¶
ParseSource parses a `micro run/update/kill` source.
func ParseSourceLocal ¶
func ParseSourceLocal(workDir, source string, pathExistsFunc ...func(path string) (bool, error)) (*Source, error)
ParseSourceLocal a version of ParseSource that detects and handles local paths. Workdir should be used only from the CLI @todo better interface for this function. PathExistsFunc exists only for testing purposes, to make the function side effect free.
func (*Source) RuntimeName ¶
Name to be passed to RPC call runtime.Create Update Delete eg: `helloworld/api`, `crufter/myrepo/helloworld/api`, `localfolder`
func (*Source) RuntimeSource ¶
Source to be passed to RPC call runtime.Create Update Delete eg: `helloworld`, `github.com/crufter/myrepo/helloworld`, `/path/to/localrepo/localfolder`