File Format
Instruction files are YAML files consisting of a list of transformations. To learn more about the YAML file format, visit yaml.org.
Transformations
Each transformation is a YAML dictionary with a type key corresponding to one of the options below.
meta
The first entry. Contains information about the instruction file.
dir(recommended) string - Directory of the codebase for the instruction file. Used as the base directory for commands and file operations. If this path is relative, the Library's base is used as the base for this path. If omitted or blank, defaults to the Library's base if part of the Library of the current default directory. Recommended for files in the Library.
run
Run a command.
cmdstring - The command to run.cwd(optional) string - The current working directory to run the command in. Defaults to themetatransformation'sdir.env(optional) string: string map - Mapping of environment variables to set.
create
Create a file with content.
filestring - The file to create.textstring - Text to create the file with.
replace
Find and replace text in a file.
filestring - The file to replace text in.findstring - The text to find. Interpreted as normal text unlessregexistrue.replacestring - The text to replace. Ifregexistrue, substitutions (eg.$1,$2, etc.) are supported.regex(optional) boolean - Interpretfindas a regular expression. Default isfalse.
prepend
Find and replace text in a file.
filestring - The file to prepend text to.textstring - Text to prepend the file with.
append
Append text to the end of a file.
filestring - The file to append to text.textstring - Text to append the file with.
rename
Rename a file or directory.
fromstring - The old file path.tostring - The new file path.
copy
Copy a file. To copy a directory, use scp.
fromstring - The path of the original file.tostring - The path of the copy to create.
delete
Delete a file or directory.
filestring - The file or directory to delete.recursive(optional) boolean - Delete items recursively iffileis a directory. Default isfalse.
deploy
Deploy a file or directory to a production environment via secure copy.
fromstring - The local directory/file to copy from.tostring - The production directory/file to copy to as anscppath.clear(optional) boolean - Clear the contents oftobefore copying files fromfrom. Files infromare copied to the sever beforehand so the copy intotois a local copy. Can only be used with directories.