-
Notifications
You must be signed in to change notification settings - Fork 0
Home
NOTE: This project is in a very early stage.
A sweetpotato is commonly called a yam in parts of North America, although they are only very distantly related to the other plant widely known as yams1
Sweetpotato is an extensible, nestable, YAML-powered batch processing framework, which looks like an ant-like build tool, but it is a minimal extensible framework, designed to automate tasks in a convenient and easy to maintain way. It is not especially suitable for configuring, linking and compiling software, although it can certainly be extended to do so.
As Martin Fowler might say it, “Sweetpotato is an external Domain Specific Language for Process Automation using an YAML based syntax” 2
I plan to use it to build web sites, integrate web services and distribute information.
The goal of sweetpotato is to create a simple, extensible and readable grammar for automating processes as an alternative to simple shell scripts written in a non domain-specific language.
The grammar is defined as “Tasks” which are discreet operations contained within “Targets.” Each task has a “type” which defines what it actually does, new types can be added to sweetpotato by adding python classes called “Task Adapters.”
Tasks can be nested within each other.
An example is worth a million descriptive paragraphs.
# example sweetpotato build script
sweetpotato:
example:
- echo: this is an example target
- db:
type: sweetpotato
path: build.yaml
read:
root: somedata
target: echomood
do:
- fields:
name: personName
mood: personMood
echomood:
- echo: '{{personName}} is feeling {{personMood}}'
somedata:
- {'name':bob,'mood':happy}
- {'name':ann,'mood':silly}
- {'name':joe,'mood':sleepy}
- {'name':tom,'mood':angry}
- {'name':sue,'mood':mopey}
- {'name':tim,'mood':curious}
- {'name':ken,'mood':amorous}
- {'name':don,'mood':coy}
- {'name':mel,'mood':scared}
the root element of the build file must be “sweetpotato”, which contain a list of targets, the file can include additional data.
The “example” target performs the following process:
- look up some rows in a table
- set the fields as build tokens
- call the “echomood” target for each row in the table
The “echomood” target performs the following process:
- expand a string containing build tokens
- send the output to the default logging destination
A target can be executed from the command line as follows:
sp example
sp is called with the name of the target to execute
sp --help
call —help to see other options
1 from wikipedia
fn2. http://martinfowler.com/articles/rake.htmlf