itamae 1.9.8 → 1.9.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 328f99ca3c77bdfb7dd735eaa16c740f42dbf8d8
4
- data.tar.gz: b5c102ee7950c954c7b56bc146ebdfdf89512f16
3
+ metadata.gz: 83dedd045d05da0413cae3765fdb4a0c97f44121
4
+ data.tar.gz: d45bcc5ae690ed0044ccfddc06eadbbc6bfe9690
5
5
  SHA512:
6
- metadata.gz: 81b4df62bf844dba2fba5b76b9126650cdc81666583c112bf6fb0fb14aeeb9dc054b0d920ae7289c2cb4e983219110e42448b4b5fa6a877a0cd904e27df18ff2
7
- data.tar.gz: d9391e3125d6d7257f1819aa7a4afbab53d07573a3d786f894fcb8bbedf01be3a8dc00a7fb37d1276400c9bc3023463976b2d0beda8b09439e0e05ac3dd0228b
6
+ metadata.gz: 872059daf89a6e4a7ae772278b618055cbe03325e67d45bf4dc0e4cfd3e4ccac9ade93f6a20e9789d7bfb997b577c9ec05d819b96197084bb8a55bd61dc99d35
7
+ data.tar.gz: 4e27434ae02d17fb5613dd1693462e8f714ecd759aeef3430f24561de9244629fc5b72af3e79ec3f326544aa1bc38ef5eba591d3c8fc67516bbcc818e833b7e7
@@ -1,3 +1,15 @@
1
+ ## v1.9.9
2
+
3
+ Features
4
+
5
+ - [`itamae ssh` now accepts `--ssh-config` option](https://github.com/itamae-kitchen/itamae/pull/211)
6
+ - [Introduce `--login-shell` option](https://github.com/itamae-kitchen/itamae/pull/217)
7
+ - [`gem_package` resource has `uninstall` action](https://github.com/itamae-kitchen/itamae/pull/216)
8
+
9
+ Bugfixes
10
+
11
+ - [`send_file` fails against docker backend](https://github.com/itamae-kitchen/itamae/pull/215)
12
+
1
13
  ## v1.9.8
2
14
 
3
15
  Bugfixes
data/README.md CHANGED
@@ -90,7 +90,7 @@ $ bundle exec rake spec
90
90
 
91
91
  ## Contributing
92
92
 
93
- If you have a problem, please [create an issue](https://github.com/ryotarai/itamae/issues/new) or a pull request.
93
+ If you have a problem, please [create an issue](https://github.com/itamae-kitchen/itamae/issues/new) or a pull request.
94
94
 
95
95
  1. Fork it
96
96
  2. Create your feature branch (`git checkout -b my-new-feature`)
@@ -9,7 +9,7 @@ Gem::Specification.new do |spec|
9
9
  spec.authors = ["Ryota Arai"]
10
10
  spec.email = ["ryota.arai@gmail.com"]
11
11
  spec.summary = %q{Simple Configuration Management Tool}
12
- spec.homepage = "https://github.com/ryotarai/itamae"
12
+ spec.homepage = "https://github.com/itamae-kitchen/itamae"
13
13
  spec.license = "MIT"
14
14
 
15
15
  spec.files = `git ls-files`.split($/)
@@ -221,6 +221,7 @@ module Itamae
221
221
  disable_sudo: disable_sudo?,
222
222
  ssh_options: ssh_options,
223
223
  shell: @options[:shell],
224
+ login_shell: @options[:login_shell],
224
225
  )
225
226
  end
226
227
 
@@ -230,7 +231,8 @@ module Itamae
230
231
  opts[:host_name] = @options[:host]
231
232
 
232
233
  # from ssh-config
233
- opts.merge!(Net::SSH::Config.for(@options[:host]))
234
+ ssh_config_files = @options[:ssh_config] ? [@options[:ssh_config]] : Net::SSH::Config.default_files
235
+ opts.merge!(Net::SSH::Config.for(@options[:host], ssh_config_files))
234
236
  opts[:user] = @options[:user] || opts[:user] || Etc.getlogin
235
237
  opts[:keys] = [@options[:key]] if @options[:key]
236
238
  opts[:port] = @options[:port] if @options[:port]
@@ -22,6 +22,7 @@ module Itamae
22
22
  option :node_yaml, type: :string, aliases: ['-y']
23
23
  option :dry_run, type: :boolean, aliases: ['-n']
24
24
  option :shell, type: :string, default: "/bin/sh"
25
+ option :login_shell, type: :boolean, default: false
25
26
  option :ohai, type: :boolean, default: false, desc: "This option is DEPRECATED and will be unavailable."
26
27
  option :profile, type: :string, desc: "[EXPERIMENTAL] Save profiling data", banner: "PATH"
27
28
  option :detailed_exitcode, type: :boolean, default: false, desc: "exit code 0 - The run succeeded with no changes or failures, exit code 1 - The run failed, exit code 2 - The run succeeded, and some resources were changed"
@@ -43,6 +44,7 @@ module Itamae
43
44
  option :user, type: :string, aliases: ['-u']
44
45
  option :key, type: :string, aliases: ['-i']
45
46
  option :port, type: :numeric, aliases: ['-p']
47
+ option :ssh_config, type: :string
46
48
  option :vagrant, type: :boolean, default: false
47
49
  option :ask_password, type: :boolean, default: false
48
50
  option :sudo, type: :boolean, default: true
@@ -174,9 +174,16 @@ module Itamae
174
174
 
175
175
  @temppath = ::File.join(runner.tmpdir, Time.now.to_f.to_s)
176
176
 
177
- run_command(["touch", @temppath])
178
- run_specinfra(:change_file_mode, @temppath, '0600')
179
- backend.send_file(src, @temppath)
177
+ if backend.is_a?(Itamae::Backend::Docker)
178
+ run_command(["mkdir", @temppath])
179
+ backend.send_file(src, @temppath)
180
+ @temppath = ::File.join(@temppath, ::File.basename(src))
181
+ else
182
+ run_command(["touch", @temppath])
183
+ run_specinfra(:change_file_mode, @temppath, '0600')
184
+ backend.send_file(src, @temppath)
185
+ end
186
+
180
187
  run_specinfra(:change_file_mode, @temppath, '0600')
181
188
  ensure
182
189
  f.unlink if f
@@ -14,6 +14,8 @@ module Itamae
14
14
  case @current_action
15
15
  when :install
16
16
  attributes.installed = true
17
+ when :uninstall
18
+ attributes.installed = false
17
19
  end
18
20
  end
19
21
 
@@ -43,6 +45,10 @@ module Itamae
43
45
  end
44
46
  end
45
47
 
48
+ def action_uninstall(action_options)
49
+ uninstall! if current.installed
50
+ end
51
+
46
52
  def action_upgrade(action_options)
47
53
  return if current.installed && attributes.version && current.version == attributes.version
48
54
 
@@ -76,6 +82,18 @@ module Itamae
76
82
 
77
83
  run_command(cmd)
78
84
  end
85
+
86
+ def uninstall!
87
+ cmd = [*Array(attributes.gem_binary), 'uninstall', '--ignore-dependencies', '--executables', *Array(attributes.options)]
88
+ if attributes.version
89
+ cmd << '-v' << attributes.version
90
+ else
91
+ cmd << '--all'
92
+ end
93
+ cmd << attributes.package_name
94
+
95
+ run_command(cmd)
96
+ end
79
97
  end
80
98
  end
81
99
  end
@@ -1,3 +1,3 @@
1
1
  module Itamae
2
- VERSION = "1.9.8"
2
+ VERSION = "1.9.9"
3
3
  end
@@ -176,6 +176,14 @@ describe command('gem list') do
176
176
  its(:stdout) { should include('tzinfo (1.2.2, 1.1.0)') }
177
177
  end
178
178
 
179
+ describe command('gem list') do
180
+ its(:stdout) { should include('rake (11.1.0)') }
181
+ end
182
+
183
+ describe command('gem list') do
184
+ its(:stdout) { should_not include('test-unit') }
185
+ end
186
+
179
187
  describe command('ri Bundler') do
180
188
  its(:stderr) { should eq("Nothing known about Bundler\n") }
181
189
  end
@@ -69,6 +69,31 @@ gem_package 'bundler' do
69
69
  options ['--no-ri', '--no-rdoc']
70
70
  end
71
71
 
72
+ gem_package 'rake' do
73
+ version '11.1.0'
74
+ end
75
+
76
+ gem_package 'rake' do
77
+ version '11.2.2'
78
+ end
79
+
80
+ gem_package 'rake' do
81
+ action :uninstall
82
+ version '11.2.2'
83
+ end
84
+
85
+ gem_package 'test-unit' do
86
+ version '3.2.0'
87
+ end
88
+
89
+ gem_package 'test-unit' do
90
+ version '3.1.9'
91
+ end
92
+
93
+ gem_package 'test-unit' do
94
+ action :uninstall
95
+ end
96
+
72
97
  ######
73
98
 
74
99
  execute "echo -n > /tmp/notifies"
@@ -73,6 +73,26 @@ module Itamae
73
73
  let(:options) { {host: host_name} }
74
74
  it { is_expected.to eq( default_option.merge({host_name: host_name}) ) }
75
75
  end
76
+
77
+ context "with ssh_config option" do
78
+ around do |example|
79
+ Tempfile.create("ssh_config") do |temp|
80
+ temp.write(<<EOF)
81
+ Host ex1
82
+ HostName example.com
83
+ User myname
84
+ Port 10022
85
+ EOF
86
+ temp.flush
87
+ @ssh_config = temp.path
88
+ example.run
89
+ end
90
+ end
91
+
92
+ let(:options) { {host: "ex1", ssh_config: @ssh_config} }
93
+
94
+ it { is_expected.to a_hash_including({host_name: "example.com", user: "myname", port: 10022}) }
95
+ end
76
96
  end
77
97
 
78
98
  describe "#disable_sudo?" do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: itamae
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.9.8
4
+ version: 1.9.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryota Arai
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-06-02 00:00:00.000000000 Z
11
+ date: 2016-07-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -293,7 +293,7 @@ files:
293
293
  - spec/unit/lib/itamae/runner_spec.rb
294
294
  - spec/unit/spec_helper.rb
295
295
  - wercker.yml
296
- homepage: https://github.com/ryotarai/itamae
296
+ homepage: https://github.com/itamae-kitchen/itamae
297
297
  licenses:
298
298
  - MIT
299
299
  metadata: {}