You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
67 lines
2.4 KiB
67 lines
2.4 KiB
3 years ago
|
# Python Script Tease
|
||
|
|
||
|
## Overview
|
||
|
|
||
|
Script Tease is a library and command line tool for generating Bash commands programmatically and (especially) using configuration files.
|
||
|
|
||
|
The primary focus (and limit) is to convert plain text instructions (in INI or YAML format) into valid command line statements for a given platform. It does *not* provide support for executing those statements.
|
||
|
|
||
2 years ago
|
!!! warning
|
||
2 years ago
|
YAML support is currently untested.
|
||
2 years ago
|
|
||
3 years ago
|
## Concepts
|
||
|
|
||
|
### Command Generation
|
||
|
|
||
2 years ago
|
Script Tease may be used in three (3) ways:
|
||
3 years ago
|
|
||
|
1. Using the library to programmatically define commands and export them as command line statements.
|
||
2 years ago
|
2. Using the `tease` command to generate commands from a configuration file. See [steps file](topics/steps-file.md).
|
||
2 years ago
|
3. Using the command file format and library to create a custom implementation.
|
||
3 years ago
|
|
||
2 years ago
|
This documentation focuses on the second method, but the [developer docs](./reference) may be used to guide custom implementations for 1 and 3 above.
|
||
3 years ago
|
|
||
|
### Self-Documenting
|
||
|
|
||
|
The format of INI and YAML files is self-documenting. The command comment is this section (INI) or start of a list item (YAML). This ensures that all commands have a basic description of their purpose or intent.
|
||
|
|
||
2 years ago
|
```ini
|
||
|
[install apache]
|
||
|
install: apache2
|
||
3 years ago
|
|
||
2 years ago
|
```
|
||
3 years ago
|
|
||
2 years ago
|
```yaml
|
||
|
- install apache
|
||
|
install: apache2
|
||
3 years ago
|
|
||
2 years ago
|
```
|
||
3 years ago
|
|
||
2 years ago
|
### Representing Commands
|
||
3 years ago
|
|
||
2 years ago
|
All commands are represented by simple, Python functions. These functions are responsible for accepting the arguments provided (usually by a command loader) and converting them into a common `Command` instance. This instance is then capable of generating a finished statement that may be used on the command line.
|
||
3 years ago
|
|
||
2 years ago
|
#### Profiles
|
||
3 years ago
|
|
||
2 years ago
|
Profiles contain command functions that are specific to an operating system. Not all operating systems support the same commands.
|
||
3 years ago
|
|
||
2 years ago
|
!!! note
|
||
2 years ago
|
At present, the only defined operating system profiles are for Cent OS and Ubuntu.
|
||
3 years ago
|
|
||
2 years ago
|
Profiles import and appropriate all other available commands.
|
||
3 years ago
|
|
||
|
## Terms and Definitions
|
||
|
|
||
|
command
|
||
2 years ago
|
: When used in Script Tease documentation, this is a command instance which contains the properties and parameters for assembling a command line statement.
|
||
|
|
||
|
profile
|
||
|
: A collection of commands that work for a specific operating system profile.
|
||
3 years ago
|
|
||
|
statement
|
||
2 years ago
|
: A specific statement (string) to be executed. A *statement* is generated from a *command*.
|
||
3 years ago
|
|
||
|
## License
|
||
|
|
||
|
Python Script Tease is released under the BSD 3 clause license.
|