chake 0.90 → 0.90.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 +4 -4
- data/.manifest +2 -0
- data/.rubocop.yml +3 -0
- data/ChangeLog.md +12 -0
- data/Rakefile +5 -7
- data/chake.gemspec +1 -0
- data/lib/chake/config.rb +3 -2
- data/lib/chake/config_manager/chef.rb +1 -1
- data/lib/chake/connection/ssh.rb +3 -3
- data/lib/chake/connection.rb +2 -1
- data/lib/chake/version.rb +1 -1
- data/lib/chake/yaml.rb +13 -0
- data/lib/chake.rb +5 -8
- data/man/Rakefile +3 -3
- data/spec/integration_tests_spec.rb +48 -0
- metadata +7 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c094249a63d6302e4b53969fcb103595aca7da88a1a1c3c6355d0facc9a55061
|
4
|
+
data.tar.gz: 8ebdd02f879e7f5dfdf083e985a81745e62df3102c5c3c972c89a96e2058873c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 19730aecf31f2f6f2d2564d247e17f7e26cce70673a37430793628e31a20a038e1f1f25bf9a290c5540798143390ae8100a8dcb186eac1355aef02f460735b82
|
7
|
+
data.tar.gz: f595aa58c562160b6944927f9c2ede9a58ee32a9cedcd436895140fe011316d2bcb7755d2449b0a49f78eff2ce4e9f3a0752b6611b9cacd0ffe760fdc4e58c77
|
data/.manifest
CHANGED
@@ -56,6 +56,7 @@ lib/chake/readline.rb
|
|
56
56
|
lib/chake/tmpdir.rb
|
57
57
|
lib/chake/version.rb
|
58
58
|
lib/chake/wipe.rb
|
59
|
+
lib/chake/yaml.rb
|
59
60
|
man/.gitignore
|
60
61
|
man/Rakefile
|
61
62
|
man/readme2man.sed
|
@@ -68,4 +69,5 @@ spec/chake/config_manager/itamae_spec.rb
|
|
68
69
|
spec/chake/config_manager/shell_spec.rb
|
69
70
|
spec/chake/config_manager_spec.rb
|
70
71
|
spec/chake/node_spec.rb
|
72
|
+
spec/integration_tests_spec.rb
|
71
73
|
spec/spec_helper.rb
|
data/.rubocop.yml
CHANGED
data/ChangeLog.md
CHANGED
@@ -1,3 +1,15 @@
|
|
1
|
+
# 0.90.2
|
2
|
+
|
3
|
+
- upload: make sure to reupload on config manager changes
|
4
|
+
- Apply suggestions by rubocop 1.39.0
|
5
|
+
- Chake::Connection: avoid setting constant inside of block
|
6
|
+
- rubocop: keep assignment to `test_files` in the gemspec
|
7
|
+
- gemspec: set `spec.metadata['rubygems_mfa_required']`
|
8
|
+
|
9
|
+
# 0.90.1
|
10
|
+
|
11
|
+
* Fix loading node data under ruby < 3.1
|
12
|
+
|
1
13
|
# 0.90
|
2
14
|
|
3
15
|
* itamae: use --sudo when root for local backend
|
data/Rakefile
CHANGED
@@ -74,12 +74,10 @@ end
|
|
74
74
|
|
75
75
|
desc 'checks if the latest release is properly documented in ChangeLog.md'
|
76
76
|
task :check_changelog do
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
raise
|
82
|
-
end
|
77
|
+
sh 'grep', "^#\\s*#{pkg.version}", 'ChangeLog.md'
|
78
|
+
rescue StandardError
|
79
|
+
puts "Version #{pkg.version} not documented in ChangeLog.md!"
|
80
|
+
raise
|
83
81
|
end
|
84
82
|
|
85
83
|
desc 'Updates manifest file'
|
@@ -87,7 +85,7 @@ task :manifest do
|
|
87
85
|
manifest = File.read('.manifest')
|
88
86
|
git = `git ls-files`
|
89
87
|
if manifest != git
|
90
|
-
File.
|
88
|
+
File.write('.manifest', git)
|
91
89
|
sh 'git commit .manifest -m "Update manifest"'
|
92
90
|
end
|
93
91
|
end
|
data/chake.gemspec
CHANGED
data/lib/chake/config.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'chake/node'
|
2
|
+
require 'chake/yaml'
|
2
3
|
|
3
4
|
module Chake
|
4
5
|
class << self
|
@@ -8,12 +9,12 @@ end
|
|
8
9
|
|
9
10
|
nodes_file = ENV['CHAKE_NODES'] || 'nodes.yaml'
|
10
11
|
nodes_directory = ENV['CHAKE_NODES_D'] || 'nodes.d'
|
11
|
-
nodes = File.exist?(nodes_file) && YAML.load_file(nodes_file
|
12
|
+
nodes = (File.exist?(nodes_file) && Chake::YAML.load_file(nodes_file)) || {}
|
12
13
|
nodes.values.each do |node|
|
13
14
|
node['chake_metadata'] = { 'definition_file' => nodes_file }
|
14
15
|
end
|
15
16
|
Dir.glob(File.join(nodes_directory, '*.yaml')).sort.each do |f|
|
16
|
-
file_nodes = YAML.load_file(f
|
17
|
+
file_nodes = Chake::YAML.load_file(f)
|
17
18
|
file_nodes.values.each do |node|
|
18
19
|
node['chake_metadata'] = { 'definition_file' => f }
|
19
20
|
end
|
data/lib/chake/connection/ssh.rb
CHANGED
@@ -44,7 +44,7 @@ module Chake
|
|
44
44
|
end
|
45
45
|
|
46
46
|
def ssh_config
|
47
|
-
File.exist?(ssh_config_file) && ['-F', ssh_config_file] || []
|
47
|
+
(File.exist?(ssh_config_file) && ['-F', ssh_config_file]) || []
|
48
48
|
end
|
49
49
|
|
50
50
|
def ssh_config_file
|
@@ -60,11 +60,11 @@ module Chake
|
|
60
60
|
end
|
61
61
|
|
62
62
|
def ssh_options
|
63
|
-
node.port && ['-p', node.port.to_s] || []
|
63
|
+
(node.port && ['-p', node.port.to_s]) || []
|
64
64
|
end
|
65
65
|
|
66
66
|
def scp_options
|
67
|
-
node.port && ['-P', node.port.to_s] || []
|
67
|
+
(node.port && ['-P', node.port.to_s]) || []
|
68
68
|
end
|
69
69
|
end
|
70
70
|
end
|
data/lib/chake/connection.rb
CHANGED
data/lib/chake/version.rb
CHANGED
data/lib/chake/yaml.rb
ADDED
data/lib/chake.rb
CHANGED
@@ -59,6 +59,7 @@ def if_files_changed(node, group_name, files)
|
|
59
59
|
return if files.empty?
|
60
60
|
|
61
61
|
hash_io = IO.popen(%w[xargs sha1sum], 'w+')
|
62
|
+
hash_io.puts(File.join(Chake.tmpdir, "#{node}.bootstrap"))
|
62
63
|
files.sort.each { |f| hash_io.puts(f) }
|
63
64
|
hash_io.close_write
|
64
65
|
current_hash = hash_io.read
|
@@ -69,9 +70,7 @@ def if_files_changed(node, group_name, files)
|
|
69
70
|
|
70
71
|
yield if current_hash != hash_on_disk
|
71
72
|
FileUtils.mkdir_p(File.dirname(hash_file))
|
72
|
-
File.
|
73
|
-
f.write(current_hash)
|
74
|
-
end
|
73
|
+
File.write(hash_file, current_hash)
|
75
74
|
end
|
76
75
|
|
77
76
|
def write_json_file(file, data)
|
@@ -111,9 +110,7 @@ Chake.nodes.each do |node|
|
|
111
110
|
if !File.exist?(bootstrap_script) || File.read(bootstrap_script) != bootstrap_code
|
112
111
|
|
113
112
|
# create bootstrap script
|
114
|
-
File.
|
115
|
-
f.write(bootstrap_code)
|
116
|
-
end
|
113
|
+
File.write(bootstrap_script, bootstrap_code)
|
117
114
|
chmod 0o755, bootstrap_script
|
118
115
|
|
119
116
|
# copy bootstrap script over
|
@@ -131,7 +128,7 @@ Chake.nodes.each do |node|
|
|
131
128
|
end
|
132
129
|
|
133
130
|
desc "upload data to #{hostname}"
|
134
|
-
task "upload:#{hostname}" => :upload_common do
|
131
|
+
task "upload:#{hostname}" => ["bootstrap:#{hostname}", :upload_common] do
|
135
132
|
next unless node.needs_upload?
|
136
133
|
|
137
134
|
encrypted = encrypted_for(hostname)
|
@@ -142,7 +139,7 @@ Chake.nodes.each do |node|
|
|
142
139
|
rsync_excludes << '--exclude' << 'local-mode-cache/'
|
143
140
|
|
144
141
|
rsync = node.rsync + ['-avp'] + ENV.fetch('CHAKE_RSYNC_OPTIONS', '').split
|
145
|
-
rsync_logging = Rake.application.options.silent && '--quiet' || '--verbose'
|
142
|
+
rsync_logging = (Rake.application.options.silent && '--quiet') || '--verbose'
|
146
143
|
|
147
144
|
hash_files = Dir.glob(File.join(Chake.tmpdir, '*.sha1sum'))
|
148
145
|
files = Dir.glob('**/*').reject { |f| File.directory?(f) } - encrypted.keys - encrypted.values - hash_files
|
data/man/Rakefile
CHANGED
@@ -21,9 +21,9 @@ MANPAGES.each do |man|
|
|
21
21
|
end
|
22
22
|
|
23
23
|
task install: MANPAGES do
|
24
|
-
prefix = ENV['PREFIX'] || File.exist?('debian/rules') && '/usr' || '/usr/local'
|
25
|
-
man1 = File.join(*[ENV
|
26
|
-
man7 = File.join(*[ENV
|
24
|
+
prefix = ENV['PREFIX'] || (File.exist?('debian/rules') && '/usr') || '/usr/local'
|
25
|
+
man1 = File.join(*[ENV.fetch('DESTDIR', nil), prefix, 'share/man/man1'].compact)
|
26
|
+
man7 = File.join(*[ENV.fetch('DESTDIR', nil), prefix, 'share/man/man7'].compact)
|
27
27
|
target = { '.1' => man1, '.7' => man7 }
|
28
28
|
sh 'install', '-d', '-m', '0755', man1
|
29
29
|
sh 'install', '-d', '-m', '0755', man7
|
@@ -0,0 +1,48 @@
|
|
1
|
+
require 'fileutils'
|
2
|
+
require 'pathname'
|
3
|
+
require 'tmpdir'
|
4
|
+
|
5
|
+
describe 'Chake' do
|
6
|
+
include FileUtils
|
7
|
+
|
8
|
+
def sh(*args)
|
9
|
+
cmd = Shellwords.join(args)
|
10
|
+
lib = [Pathname.new(__FILE__).parent.parent / 'lib', ENV.fetch('RUBYLIB', nil)].compact.join(':')
|
11
|
+
path = [Pathname.new(__FILE__).parent.parent / 'bin', ENV.fetch('PATH', nil)].join(':')
|
12
|
+
env = {
|
13
|
+
'RUBYLIB' => lib,
|
14
|
+
'PATH' => path
|
15
|
+
}
|
16
|
+
unless system(env, *args, out: ['.out', 'w'], err: ['.err', 'w'])
|
17
|
+
out = File.read('.out')
|
18
|
+
err = File.read('.err')
|
19
|
+
raise "Command [#{cmd}] failed with exit status #{$CHILD_STATUS} (PATH = #{path}, RUBYLIB = #{lib}).\nstdout:\n#{out}\nstderr:\n#{err}"
|
20
|
+
end
|
21
|
+
rm_f '.log'
|
22
|
+
end
|
23
|
+
|
24
|
+
def chake(*args)
|
25
|
+
cmd = [Gem.ruby, '-S', 'chake'] + args
|
26
|
+
sh(*cmd)
|
27
|
+
end
|
28
|
+
|
29
|
+
def rake(*args)
|
30
|
+
cmd = [Gem.ruby, '-S', 'rake'] + args
|
31
|
+
sh(*cmd)
|
32
|
+
end
|
33
|
+
|
34
|
+
def project
|
35
|
+
Dir.mktmpdir do |dir|
|
36
|
+
Dir.chdir(dir) do
|
37
|
+
yield dir
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
it 'loads node information' do
|
43
|
+
project do
|
44
|
+
chake 'init'
|
45
|
+
rake 'nodes'
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chake
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 0.90.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Antonio Terceiro
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-03-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -164,6 +164,7 @@ files:
|
|
164
164
|
- lib/chake/tmpdir.rb
|
165
165
|
- lib/chake/version.rb
|
166
166
|
- lib/chake/wipe.rb
|
167
|
+
- lib/chake/yaml.rb
|
167
168
|
- man/.gitignore
|
168
169
|
- man/Rakefile
|
169
170
|
- man/readme2man.sed
|
@@ -176,11 +177,13 @@ files:
|
|
176
177
|
- spec/chake/config_manager/shell_spec.rb
|
177
178
|
- spec/chake/config_manager_spec.rb
|
178
179
|
- spec/chake/node_spec.rb
|
180
|
+
- spec/integration_tests_spec.rb
|
179
181
|
- spec/spec_helper.rb
|
180
182
|
homepage: https://gitlab.com/terceiro/chake
|
181
183
|
licenses:
|
182
184
|
- MIT
|
183
|
-
metadata:
|
185
|
+
metadata:
|
186
|
+
rubygems_mfa_required: 'true'
|
184
187
|
post_install_message:
|
185
188
|
rdoc_options: []
|
186
189
|
require_paths:
|
@@ -210,4 +213,5 @@ test_files:
|
|
210
213
|
- spec/chake/config_manager/shell_spec.rb
|
211
214
|
- spec/chake/config_manager_spec.rb
|
212
215
|
- spec/chake/node_spec.rb
|
216
|
+
- spec/integration_tests_spec.rb
|
213
217
|
- spec/spec_helper.rb
|