tele 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. data/README +1 -1
  2. data/bin/tele +5 -3
  3. data/tele.gemspec +10 -2
  4. data/test/tele.rb +6 -0
  5. metadata +3 -3
data/README CHANGED
@@ -89,7 +89,7 @@ USAGE
89
89
  $ mkdir -p .tele/recipes/redis
90
90
 
91
91
  # Create status.sh script.
92
- $ cat "which redis-server" > ./tele/recipes/redis/status.sh
92
+ $ echo "which redis-server" > ./tele/recipes/redis/status.sh
93
93
 
94
94
  # Create install.sh script (ommited).
95
95
 
data/bin/tele CHANGED
@@ -3,12 +3,14 @@
3
3
  help = File.expand_path(File.join("..", "README"), File.dirname(__FILE__))
4
4
 
5
5
  if ARGV.empty?
6
- exec "less #{help}"
6
+ exec "${PAGER:-less} #{help}"
7
7
  end
8
8
 
9
9
  require "clap"
10
10
  require "json"
11
11
 
12
+ trap(:INT) { puts; exit 1 }
13
+
12
14
  def recipes_for(assigned_roles)
13
15
  [].tap do |recipes|
14
16
  assigned_roles.each do |name|
@@ -26,7 +28,7 @@ def path(*parts)
26
28
  end
27
29
 
28
30
  def ssh(server, script)
29
- %x{ssh -T -F #{path("ssh_config")} #{server} < #{script}}
31
+ %x{bash -c "ssh -T -F #{path("ssh_config")} #{server} < #{script} > >(logger -t 'tele/#{server}') 2>&1"}
30
32
  $?.exitstatus
31
33
  end
32
34
 
@@ -86,7 +88,7 @@ ENV["TELE_HOME"] ||= File.join(Dir.pwd, ".tele")
86
88
 
87
89
  commands = Clap.run ARGV,
88
90
  "-h" => lambda {
89
- exec "less #{help}"
91
+ exec "${PAGER:-less} #{help}"
90
92
  },
91
93
  "-d" => lambda { |path|
92
94
  ENV["TELE_HOME"] = File.join(Dir.pwd, path)
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "tele"
3
- s.version = "0.0.1"
3
+ s.version = "0.0.2"
4
4
  s.summary = "Provisioning at a distance"
5
5
  s.description = "Tele is a small provisioning framework that allows you to run bash scripts on remote servers over SSH."
6
6
  s.authors = ["Damian Janowski", "Michel Martens"]
@@ -11,5 +11,13 @@ Gem::Specification.new do |s|
11
11
 
12
12
  s.add_dependency("clap")
13
13
 
14
- s.files = ["LICENSE", "README", "Rakefile", "bin/tele", "templates/.tele/layout.json", "templates/.tele/ssh_config", "tele.gemspec", "test/tele.rb"]
14
+ s.files = Dir[
15
+ "LICENSE",
16
+ "README*",
17
+ "Rakefile",
18
+ "bin/*",
19
+ "templates/.tele/**/*",
20
+ "*.gemspec",
21
+ "test/*.*"
22
+ ]
15
23
  end
@@ -88,3 +88,9 @@ test "`tele init`" do
88
88
  assert status.exitstatus == 0
89
89
  end
90
90
  end
91
+
92
+ test "Logging to syslog" do
93
+ out, err = tele("status", "-d", "test/.tele.simple")
94
+
95
+ assert `tail -n 20 /var/log/syslog /var/log/system.log 2>/dev/null`["Can't find Cassandra"]
96
+ end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: tele
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.1
5
+ version: 0.0.2
6
6
  platform: ruby
7
7
  authors:
8
8
  - Damian Janowski
@@ -11,7 +11,7 @@ autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
13
 
14
- date: 2011-02-15 00:00:00 -03:00
14
+ date: 2011-04-07 00:00:00 -03:00
15
15
  default_executable:
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
@@ -68,7 +68,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
68
68
  requirements: []
69
69
 
70
70
  rubyforge_project:
71
- rubygems_version: 1.5.2
71
+ rubygems_version: 1.6.2
72
72
  signing_key:
73
73
  specification_version: 3
74
74
  summary: Provisioning at a distance