pinnacol / linecook Goto Github PK
View Code? Open in Web Editor NEWA shell script generator.
License: Other
A shell script generator.
License: Other
Currently 'linecook run' copies and runs scripts on servers in serial. An option should exist to run in parallel if desired.
+1
When you have the same vm declared twice in a config/ssh file, they will start twice. Duplicates need to be filtered out of each_host/each_vm_name iterators.
[config/ssh]
Host one # [abox]
Port 2220
Host two # [abox]
Port 2220
Leads to duplicates with (for example):
rake start
For example:
[recipe/example.rb]
target.puts "# outdent"
indent do
target.puts "# indent"
heredoc do
target.puts 'abc'
target.puts 'xyz'
end
end
target.puts "# outdent"
Produces:
# outdent
# indent
<< HEREDOC_0
abc
xyz
HEREDOC_0
# outdent
To solve this, perhaps add magic comments to turn on/off indent, a-la
<< HEREDOC_0 # :indent-off:
abc
xyz
HEREDOC_0 # :indent-on:
Then strip out these processing instructions within indent if capture depth is 0 (ie right before the indent is written to the true output).
No trickery - no reason this shouldn't run 1.8.6 - 1.9.2 on major implementations.
The env command should only add the sorted to_yaml patch as needed. Otherwise it interferes with normal to_yaml operation, such as
{:key => 'value'}.to_yaml
Which fails because :key cannot be sorted.
Runlist files provided to 'linecook run' require an EOL, which is confusing.
[packages/bug.yml]
{}
[recipes/bug.rb]
target.puts "echo bug"
[recipes/bug_test.rb]
target.puts "echo bug test"
[runlist]
run
test
If runlist has a newline after 'test':
% linecook build bug
% linecook run bug --runlist runlist
bug
test
If runlist has no newline after 'test':
% linecook run bug --runlist runlist
bug
Sometimes images go missing in VirtualBox. This can interfere with linecook commands. Currently the workaround is to go into 'File' > 'Virtual Media Manager', manually find the missing snapshots (labeled with a red 'Hard Disk' error) and then remove them.
It would be great if there were an automated way to do the same. I've tried several approaches, including editing the xml file that I thought would define the VM (~/VirtualBox VMs/vmname/vmname.vbox) but this didn't work. Instead VirtualBox would regenerate the xml file and changes were lost.
Observe:
% cat config/ssh | grep bbox
% linecook state --names bbox
/Users/chiangs/.rvm/gems/ruby-1.8.6-p399@linecook/gems/linecook-1.1.0/lib/linecook/commands/vbox_command.rb:96:in `include?': can't convert nil into String (TypeError)
The project currently generated by linecook init is not representative of the current system. Specifically the 'abox_test' recipe is cruft. The entire thing could use a cleanup.
Make a recipe the context and have stdout be the target. There will be a trick figuring out when to evaluate -- repl won't work directly, you will need to determine if a statement is complete. Check IRB for how it's done.
linecook console
If provided on the command line then assume a recipe with the same name. If no names, then use each host. Skip if there is no recipe (such that you can have hosts that do not build/run), but allow a flag to fail upon no recipe and/or require a package file... like --strict
Linecook init isn't smart enough to figure out it should generate in the pwd.
mkdir dir
cd dir
linecook init .
already exists: .../dir
Even worse:
linecook init
/Users/Simon/.rvm/gems/ruby-1.8.6-p399@chiangs/gems/linecook-1.1.0/lib/linecook/commands/command.rb:50:in `process': wrong number of arguments (0 for 1) (ArgumentError)
from /Users/Simon/.rvm/gems/ruby-1.8.6-p399@chiangs/gems/linecook-1.1.0/lib/linecook/commands/command.rb:50:in `call'
from /Users/Simon/.rvm/gems/ruby-1.8.6-p399@chiangs/gems/linecook-1.1.0/bin/linecook:60
from /Users/Simon/.rvm/gems/ruby-1.8.6-p399@chiangs/bin/linecook:19:in `load'
from /Users/Simon/.rvm/gems/ruby-1.8.6-p399@chiangs/bin/linecook:19
This would be handy for compositions where the recipe builds other files but not a file itself. Allows a capture pattern to build a set of files without entering misc configs into the package file.
Currently an error like this gets raised when you execute a linecook vm command on a vm without a corresponding entry in config/ssh:
% linecook start bbox
/Users/chiangs/.rvm/gems/ruby-1.8.6-p399@linecook/gems/linecook-1.1.0/lib/linecook/commands/vbox_command.rb:96:in `include?': can't convert nil into String (TypeError)
This command would work if --names is specified as an option. There should be a better error message to identify that fact.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.