Autodoc¶
Config¶
-
exception
gilt.config.
ParseError
¶ Error raised when a config can’t be loaded properly.
-
gilt.config.
config
(filename)¶ Construct Config object and return a list.
- Parse filename
A string containing the path to YAML file.
- Returns
list
Git¶
-
gilt.git.
clone
(name, repository, destination, debug=False)¶ Clone the specified repository into a temporary directory and return None.
- Parameters
name – A string containing the name of the repository being cloned.
repository – A string containing the repository to clone.
destination – A string containing the directory to clone the repository into.
debug – An optional bool to toggle debug output.
- Returns
None
-
gilt.git.
extract
(repository, destination, version, debug=False)¶ Extract the specified repository/version into the directory and return None.
- Parameters
repository – A string containing the path to the repository to be extracted.
destination – A string containing the directory to clone the repository into. Relative to the directory
gilt
is running in. Must end with a ‘/’.version – A string containing the branch/tag/sha to be exported.
debug – An optional bool to toggle debug output.
- Returns
None
-
gilt.git.
overlay
(repository, files, version, debug=False)¶ Overlay files from repository/version into the directory and return None.
- Parameters
repository – A string containing the path to the repository to be extracted.
files – A list of FileConfig objects.
version – A string containing the branch/tag/sha to be exported.
debug – An optional bool to toggle debug output.
- Returns
None
Util¶
-
gilt.util.
build_sh_cmd
(cmd, cwd=None)¶ Build a sh.Command from a string.
- Parameters
cmd – String with the command to convert.
cwd – Optional path to use as working directory.
- Returns
sh.Command
-
gilt.util.
copy
(src, dst)¶ Handle the copying of a file or directory.
The destination basedir _must_ exist.
- Parameters
src – A string containing the path of the source to copy. If the source ends with a ‘/’, will become a recursive directory copy of source.
dst – A string containing the path to the destination. If the destination ends with a ‘/’, will copy into the target directory.
- Returns
None
-
gilt.util.
print_info
(msg)¶ Print the given message to STDOUT.
-
gilt.util.
print_warn
(msg)¶ Print the given message to STDOUT in YELLOW.
-
gilt.util.
run_command
(cmd, debug=False)¶ Execute the given command and return None.
- Parameters
cmd – A sh.Command object to execute.
debug – An optional bool to toggle debug output.
- Returns
None
-
gilt.util.
saved_cwd
()¶ Context manager to restore previous working directory.