cronicle 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +16 -0
- data/cronicle.gemspec +1 -0
- data/lib/cronicle.rb +1 -0
- data/lib/cronicle/cli.rb +9 -1
- data/lib/cronicle/logger.rb +1 -0
- data/lib/cronicle/version.rb +1 -1
- metadata +15 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 11f5fe77a738b4c7a79a87b1251b64863fcad6ee
|
4
|
+
data.tar.gz: fcc9dab5e28efb956caa314d6fc7c4b1e2453c3d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 72a43d752f2a204e52684c34be85229cb68f71df9c488870e089b2b29ab6f16ed2ff88bc0e9b31ab02062a61a3fc53c130d520c963fe679cb3f6939e1b90f35d
|
7
|
+
data.tar.gz: 981d289443e799428e4cc77f3aa3b6337ea05ae6a7e6bda0827b4327b6beab20d0f491e838137438ea2b6476149fa40142e2c42d08cf9bfd63bab0469ce5c7b4
|
data/README.md
CHANGED
@@ -35,6 +35,7 @@ Options:
|
|
35
35
|
-h, [--hosts=HOSTS] # Hosts definition file
|
36
36
|
-r, [--target-roles=one two three] # Target host role list
|
37
37
|
-p, [--sudo-password=SUDO-PASSWORD] # Sudo password
|
38
|
+
[--ask-pass], [--no-ask-pass] # Ask sudo password
|
38
39
|
[--dry-run], [--no-dry-run] # Do not actually change
|
39
40
|
-c, [--ssh-config=SSH-CONFIG] # OpenSSH configuration file
|
40
41
|
[--connection-timeout=N] # SSH connection timeout
|
@@ -76,6 +77,21 @@ $ ssh your_hostname 'cat /var/lib/cronicle/libexec/ec2-user/my_job'
|
|
76
77
|
puts "hello"
|
77
78
|
```
|
78
79
|
|
80
|
+
## Jobfile example
|
81
|
+
|
82
|
+
```ruby
|
83
|
+
on servers: :your_hostname do
|
84
|
+
job :my_job, user: "ec2-user", schedule: "* * * * *" do
|
85
|
+
puts "hello"
|
86
|
+
end
|
87
|
+
|
88
|
+
job :my_job2, user: "ec2-user", schedule: "* * * * *", content: <<-EOS
|
89
|
+
#!/bin/sh
|
90
|
+
echo hello
|
91
|
+
EOS
|
92
|
+
end
|
93
|
+
```
|
94
|
+
|
79
95
|
## Hosts definition file
|
80
96
|
|
81
97
|
Any of the following formats:
|
data/cronicle.gemspec
CHANGED
@@ -24,6 +24,7 @@ Gem::Specification.new do |spec|
|
|
24
24
|
spec.add_dependency 'colorize'
|
25
25
|
spec.add_dependency 'parallel'
|
26
26
|
spec.add_dependency 'diffy'
|
27
|
+
spec.add_dependency 'highline'
|
27
28
|
spec.add_development_dependency 'bundler'
|
28
29
|
spec.add_development_dependency 'rake'
|
29
30
|
spec.add_development_dependency 'rspec', '>= 3.0.0'
|
data/lib/cronicle.rb
CHANGED
data/lib/cronicle/cli.rb
CHANGED
@@ -5,6 +5,7 @@ class Cronicle::CLI < Thor
|
|
5
5
|
class_option 'hosts', :aliases => '-h', :desc => 'Hosts definition file'
|
6
6
|
class_option 'target-roles', :aliases => '-r', :desc => 'Target host role list', :type => :array
|
7
7
|
class_option 'sudo-password', :aliases => '-p', :desc => 'Sudo password'
|
8
|
+
class_option 'ask-pass', :desc => 'Ask sudo password', :type => :boolean, :default => false
|
8
9
|
class_option 'dry-run', :desc => 'Do not actually change', :type => :boolean, :default => false
|
9
10
|
class_option 'ssh-config', :aliases => '-c', :desc => 'OpenSSH configuration file', :default => nil
|
10
11
|
class_option 'connection-timeout', :desc => 'SSH connection timeout', :type => :numeric, :default => nil
|
@@ -78,13 +79,20 @@ class Cronicle::CLI < Thor
|
|
78
79
|
end
|
79
80
|
|
80
81
|
def client_options
|
81
|
-
{
|
82
|
+
client_opts = {
|
82
83
|
:sudo_password => options['sudo-password'],
|
83
84
|
:concurrency => options['concurrency'],
|
84
85
|
:libexec => options['libexec'],
|
85
86
|
:dry_run => options['dry-run'],
|
86
87
|
:verbose => options['verbose']
|
87
88
|
}
|
89
|
+
|
90
|
+
if options['ask-pass']
|
91
|
+
hl = HighLine.new
|
92
|
+
client_opts[:sudo_password] = hl.ask('Password: ') {|q| q.echo = '*' }
|
93
|
+
end
|
94
|
+
|
95
|
+
client_opts
|
88
96
|
end
|
89
97
|
|
90
98
|
def host_list_options
|
data/lib/cronicle/logger.rb
CHANGED
data/lib/cronicle/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cronicle
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Genki Sugawara
|
@@ -94,6 +94,20 @@ dependencies:
|
|
94
94
|
- - '>='
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: highline
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - '>='
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :runtime
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - '>='
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
97
111
|
- !ruby/object:Gem::Dependency
|
98
112
|
name: bundler
|
99
113
|
requirement: !ruby/object:Gem::Requirement
|