chake 0.93 → 0.93.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8e89bfb172b6733b9c8fb9b2d793e3b0470077850d294ec81c56a0bbc55a28b2
4
- data.tar.gz: 59de754c4cb0ef93964711c9057db81da593aabaf95d83ff3ba7796719f3b979
3
+ metadata.gz: 8d0f86aa2668f7ed10209e4c2cbd7f93b8ef91692e6367761de0f513e56792d6
4
+ data.tar.gz: 94cfb76752108b360e87f113e6540eb498d0e0af82ee67ee80f31c92c6afd5d7
5
5
  SHA512:
6
- metadata.gz: fb264a8d9d1781b336c16c84f96bec3ee6cbf858c68804660b98eae5fa747dcb8b155166dd8c91e7c8baf68f77f5a2f8cde59406495c538d7502955cf1b87968
7
- data.tar.gz: 6f12e02d6186521dcb72405f407cc3b5d4e27e7570b31a7b86fdd445c949c9322ce7004c6582cd375bbeaab2c3c07e9631f3d2e99c4a288fb68b14f697a01c55
6
+ metadata.gz: 8cda49eebf38e00bcb0d445f1b0d909f7cad5e9cb62bccda65bd6105aefb7e743f241c376e8e745f3a22f2fd995389dbfd2deed43ea418ceec5318ce4dc200f5
7
+ data.tar.gz: 8db81e5c3a31d0dc6783affa82faf944970ef12b7bbdca3a618aabe3816a15cb6403d389ea6cb118a08cc755299e3876d142b169d15c299d3eb3770f77380e75
data/ChangeLog.md CHANGED
@@ -1,3 +1,13 @@
1
+ # 0.93.2
2
+
3
+ - rake check: don't require sudo if connecting as root
4
+ - Rename method that provides the base rsync command
5
+ - Add task to automated new releases
6
+
7
+ # 0.93.1
8
+
9
+ - Fix NoMethodError in preview task
10
+
1
11
  # 0.93
2
12
 
3
13
  - Chef::ConfigManager: add support for inheritance
data/README.md CHANGED
@@ -124,11 +124,13 @@ To check whether hosts are correctly configured, you can use the `check` task:
124
124
  $ rake check
125
125
  ```
126
126
 
127
- That will run the the `sudo true` command on each host. If that pass without
128
- you having to type any passwords, it means that:
127
+ That will run the the `true` command as root on each host (using sudo is
128
+ necessary). If that pass without you having to type any passwords, it means
129
+ that:
129
130
 
130
131
  * you have SSH access to each host; and
131
- * the user you are connecting as has password-less sudo correctly setup.
132
+ * the user you are connecting as is root or has password-less sudo correctly
133
+ setup.
132
134
 
133
135
  ## Applying configuration
134
136
 
data/Rakefile CHANGED
@@ -90,6 +90,33 @@ task :manifest do
90
90
  end
91
91
  end
92
92
 
93
+ desc 'Starts a new release'
94
+ task :new_release do
95
+ last_tag = `git tag | sort -V`.split.last
96
+ last_version = last_tag.sub(/^v/, '')
97
+ v = last_tag.sub(/^v/, '').split('.').map(&:to_i)
98
+ v[-1] += 1
99
+ suggested_version = v.join('.')
100
+ printf "Next version [#{suggested_version}]: "
101
+ version = $stdin.gets.strip
102
+ if version == ''
103
+ version = suggested_version
104
+ end
105
+ mv 'ChangeLog.md', 'ChangeLog.orig'
106
+ sh "(echo '# #{version}' && echo) > ChangeLog.md"
107
+ sh "git log --oneline --no-merges --reverse --format='- %s' #{last_tag}.. >> ChangeLog.md"
108
+ sh '(echo && cat ChangeLog.orig) >> ChangeLog.md && rm -f ChangeLog.orig'
109
+ sh "sed -i -e 's/#{last_version}/#{version}/' lib/chake/version.rb"
110
+ sh 'git diff'
111
+ printf 'Confirm [y/N]? '
112
+ if $stdin.gets.strip.downcase != 'y'
113
+ next
114
+ end
115
+
116
+ sh "git commit -a -m 'New release'"
117
+ sh 'rake release'
118
+ end
119
+
93
120
  desc 'Makes a release'
94
121
  task release: [:check_tag, :check_changelog, :default, 'bundler:release']
95
122
 
@@ -100,7 +127,7 @@ end
100
127
 
101
128
  desc 'Check spelling in the source code'
102
129
  task :codespell do
103
- sh 'codespell', '--skip=.git', '--skip=coverage', '--skip=*.asc', '--skip=*.swp', '--skip=tags', '--skip=*.1', '--skip=pkg'
130
+ sh 'codespell', '--skip=.git', '--skip=coverage', '--skip=*.asc', '--skip=*.swp', '--skip=tags', '--skip=*.1', '--skip=pkg', '--skip=man'
104
131
  end
105
132
 
106
133
  task default: [:test, :style, :codespell]
@@ -21,6 +21,9 @@ module Chake
21
21
  case node.connection
22
22
  when Chake::Connection::Ssh
23
23
  cmd << 'ssh' << "--user=#{node.username}" << "--host=#{node.hostname}"
24
+ if node.username == 'root'
25
+ cmd << '--no-sudo'
26
+ end
24
27
  cmd += ssh_config
25
28
  when Chake::Connection::Local
26
29
  if node.username == 'root'
@@ -9,7 +9,7 @@ module Chake
9
9
  "#{ssh_target}:"
10
10
  end
11
11
 
12
- def rsync
12
+ def rsync_cmd
13
13
  [ssh_prefix, 'rsync', rsync_ssh].flatten.compact
14
14
  end
15
15
 
@@ -14,7 +14,7 @@ module Chake
14
14
  ''
15
15
  end
16
16
 
17
- def rsync
17
+ def rsync_cmd
18
18
  ['rsync']
19
19
  end
20
20
 
data/lib/chake/node.rb CHANGED
@@ -37,7 +37,7 @@ module Chake
37
37
  @connection ||= Chake::Connection.get(@connection_name).new(self)
38
38
  end
39
39
 
40
- def_delegators :connection, :run, :run_as_root, :run_shell, :rsync, :rsync_dest, :scp, :scp_dest, :skip?
40
+ def_delegators :connection, :run, :run_as_root, :run_shell, :rsync_cmd, :rsync_dest, :scp, :scp_dest, :skip?
41
41
 
42
42
  def config_manager
43
43
  @config_manager ||= Chake::ConfigManager.get(self)
data/lib/chake/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Chake
2
- VERSION = '0.93'.freeze
2
+ VERSION = '0.93.2'.freeze
3
3
  end
data/lib/chake.rb CHANGED
@@ -148,7 +148,7 @@ Chake.nodes.each do |node|
148
148
  rsync_excludes << '--exclude' << 'nodes/'
149
149
  rsync_excludes << '--exclude' << 'local-mode-cache/'
150
150
 
151
- rsync = node.rsync + ['-ap'] + ENV.fetch('CHAKE_RSYNC_OPTIONS', '').split
151
+ rsync = node.rsync_cmd + ['-ap'] + ENV.fetch('CHAKE_RSYNC_OPTIONS', '').split
152
152
  rsync_logging = (Rake.application.options.trace && '--verbose') || '--quiet'
153
153
 
154
154
  hash_files = Dir.glob(File.join(Chake.tmpdir, '*.sha1sum'))
@@ -187,7 +187,7 @@ Chake.nodes.each do |node|
187
187
  desc "Preview changes when converging #{hostname}"
188
188
  task "preview:#{hostname}" => converge_dependencies do
189
189
  maybe_decrypt(node) do
190
- node.dry_run
190
+ node.preview
191
191
  end
192
192
  end
193
193
 
@@ -211,7 +211,7 @@ Chake.nodes.each do |node|
211
211
 
212
212
  desc 'checks connectivity and setup on all nodes'
213
213
  task "check:#{hostname}" => [:connect_common, "connect:#{hostname}"] do
214
- node.run('sudo echo OK')
214
+ node.run_as_root('echo OK')
215
215
  end
216
216
 
217
217
  # needs to be overridden in user projects
@@ -284,7 +284,7 @@ desc 'checks connectivity and setup on all nodes'
284
284
  multitask check: (Chake.nodes.map { |node| "check:#{node.hostname}" }) do
285
285
  puts '✓ all hosts OK'
286
286
  puts ' - ssh connection works'
287
- puts ' - password-less sudo works'
287
+ puts ' - password-less sudo (if needed) works'
288
288
  end
289
289
 
290
290
  desc 'runs a Ruby console in the chake environment'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chake
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.93'
4
+ version: 0.93.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Antonio Terceiro