cli
- cli.PORT = 8080
A CLI for developing and deploying an app deeply integrated with this repository’s structure. Written to be python version agnostic.
- cli.build_dev_command(use_cache=True)[source]
Build image for development.
- Parameters:
use_cache (bool, optional) – Use layer cache. Default: False.
- Returns:
Command to build dev image.
- Return type:
str
- cli.build_prod_command(use_cache=False)[source]
Build image for production.
- Parameters:
use_cache (bool, optional) – Use layer cache. Default: False.
- Returns:
Command to build prod image.
- Return type:
str
- cli.destroy_dev_command()[source]
- Returns:
Command to destroy dev container and image.
- Return type:
str
- cli.docker_exec(tty=False)[source]
- Parameters:
tty (bool, optional) – Include –tty flag. Default: False.
- Returns:
Partial command to call ‘docker exec’.
- Return type:
str
- cli.get_illegal_mode_command()[source]
- Returns:
Command to report that the mode given is illegal.
- Return type:
str
- cli.get_info()[source]
Parses command line call.
- Returns:
Mode and arguments.
- Return type:
tuple[str]
- cli.line(text, sep=' ')[source]
Convenience function for formatting a given block of text as series of commands.
- Parameters:
text (text) – Block of text.
sep (str, optional) – Line separator. Default: ‘ ‘.
- Returns:
Formatted command.
- Return type:
str
- cli.main()[source]
Print different commands to stdout depending on mode provided to command.
- Return type:
None
- cli.pull_command(tag='dev-latest')[source]
- Parameters:
tag (str, optional) – Tag prefix. Default: ‘dev-latest’.
- Returns:
Command to pull Docker image from registry.
- Return type:
str
- cli.push_command(mode='dev', suffix='$VERSION')[source]
- Parameters:
mode (str, optional) – Mode. Default: ‘dev’.
suffix (str, optional) – Tag suffix. Default: ‘$VERSION’.
- Returns:
Command to push Docker image to registry.
- Return type:
str
- cli.quickstart_command()[source]
Returns a command which prints the quickstart guide.
- Returns:
quickstart command.
- Return type:
str
- cli.resolve(commands)[source]
Convenience function for creating single commmand from given commands and resolving ‘{…}’ substrings.
- Parameters:
commands (list[str]) – List of commands.
- Returns:
Resolved command.
- Return type:
str
- cli.version_commit_command(args=[])[source]
- Parameters:
args (list[str], optional) – List containing a target branch. Default: [‘master’].
- Returns:
Git tag and commit command.
- Return type:
str
- cli.version_variable()[source]
- Returns:
Command to set version variable from pyproject.toml.
- Return type:
str
- cli.x_tools_command(command, args=[], tty=False)[source]
Runs a x_tools command.
- Parameters:
command (str) – x_tools command
args (list, optional) – List of arguments to be passed to the command. Default: []
tty (bool, optional) – Include docker –tty flag. Default: False.
- Returns:
x_tools command.
- Return type:
str
- cli.zsh_complete_command()[source]
- Returns:
Command to generate and install zsh completions.
- Return type:
str