Project

linecook

0.0
No commit activity in last 3 years
No release in over 3 years
There's a lot of open issues
Linecook generates shell scripts using an extensible set of ERB helpers. The shell scripts and associated resources (files, subscripts, etc) make up packages that can be used, for example, to provision servers.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.0
~> 0.9.2
~> 0.9
~> 3.9

Runtime

~> 0.5.0
~> 1.3
 Project Readme
= Linecook

A shell script generator.

== Description

Linecook generates shell scripts using an extensible set of ERB helpers. The
shell scripts and associated resources (files, subscripts, etc) make up
packages that can be used, for example, to provision servers.

Linecook provides a command line tool to manage development servers, generate
scripts, and run scripts on servers. Helpers and recipes can be shared as
gems; the canonical shell helpers are available through
{Linebook}[http://rubygems.org/gems/linebook/].

See the documentation for help to:

* {Setup}[link:files/HowTo/Setup%20Virtual%20Machines.html] and {Control}[link:files/HowTo/Control%20Virtual%20Machines.html] Virtual Machines
* {Generate Scripts}[link:files/HowTo/Generate%20Scripts.html]
* {Run Scripts}[link:files/HowTo/Run%20Scripts.html]

== Usage

Generate a project.

  $ linecook init chalkboard
  $ cd chalkboard

Define default attributes.

  [attributes/chalkboard.rb]
  attrs['chalkboard']['n'] = 3
  attrs['chalkboard']['color'] = 'white'
  attrs['chalkboard']['message'] = 'I will not manually configure my server'

Define a helper.

  [helpers/chalkboard/echo_in_color.erb]
  Echo a string in color.
  (color, str)
    color_codes = Hash[*%W{
      black       0;30   red         0;31
      white       1;37   green       0;32
      light_gray  0;37   blue        0;34
    }]
  --
  echo -e '\033[<%= color_codes[color.to_s] %>m<%= str %>\033[0m'

Use both in a recipe.

  [recipes/chalkboard.rb]
  attributes "chalkboard"
  helpers "chalkboard"
  
  attrs['chalkboard']['n'].times do
    echo_in_color attrs['chalkboard']['color'], attrs['chalkboard']['message']
  end

Define a package to use the recipe; set non-default attributes as needed.

  [packages/chalkboard.yml]
  chalkboard:
    n: 5
    color: blue

Generate the package from the attributes, helpers, and recipe.

  $ linecook build

Check the packages directory to see the resulting script.

  $ cat packages/chalkboard/run
  echo -e '\033[0;34mI will not manually configure my server\033[0m'
  echo -e '\033[0;34mI will not manually configure my server\033[0m'
  echo -e '\033[0;34mI will not manually configure my server\033[0m'
  echo -e '\033[0;34mI will not manually configure my server\033[0m'
  echo -e '\033[0;34mI will not manually configure my server\033[0m'

Now run the package.

  $ linecook run

The package can be run on any server accessible via ssh. See the generated
'config/ssh' file as well as the documentation for {Running Scripts on
Servers}[link:files/HowTo/Run%20Scripts.html].

== Composition

Linecook consists of the following.

  = Components =
  attributes
  helpers
  |-----> recipes -> packages -a-> (scripts) -b-> (servers) <-c- server setup
  files
  templates
  
  = Commands =
  ex: 'linecook build' on the command line
  
  a) env, helper, package, build        # build scripts
  b) run                                # run scripts
  c) start, stop, ssh, snapshot, reset  # server setup/control

Everything to the left of 'scripts' has to do with generating scripts;
everything to the right with running scripts on servers.

== Installation

Linecook is available as a {gem}[http://rubygems.org/gems/linecook].

  $ gem install linecook

== Info 

Developer:: {Simon Chiang}[http://github.com/thinkerbot]
License:: {MIT-Style}[link:files/License_txt.html]