itamae 1.10.7 → 1.11.1

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
  SHA256:
3
- metadata.gz: 14acdfa4894556d3fcf3b3463f869b2e6d67b36897da33d4104d6e0309724117
4
- data.tar.gz: cfb6529c9da828e28bc3f9b33563333e87e6764e2570301fc604f1bb58b553df
3
+ metadata.gz: 2213250f28fa9b34d4c8d149add25c33f9955b6dd30dfab4fc7ddd9f4e438e61
4
+ data.tar.gz: 12b67ddfa15210dfb1ea8d35b5aa02db9e4985f4e141c66d7102628b09b5f914
5
5
  SHA512:
6
- metadata.gz: e72d8fd33859995abfe62bbc74f31af2bce16ea7f410b4c9ddef84b1a142a5c92182cf0845bff4043092e571e546cf7e57171c82f73a0ca6d39200d0908d9829
7
- data.tar.gz: 2cd158d444b8553131c38e5962c674a0a84b3e7f3a13637d1765042bfd896a80767f6bdc53cb467981bd3510e7e165cf19edb713d14b957fc1b4f8ba26210077
6
+ metadata.gz: 4a83817032655a372418a0c2aeef5561e2b669c075b16a0b56f3522d94883396cc535b44cad5d3e2b7c2b8c8c4fdbf400eb95a9efe986b97effaa587cf8d5564
7
+ data.tar.gz: 96380efa8166f7629035be66884c3526c4c521eaababb5303bf0c520bbb914ebcb8de2e2492bd0ffbc1681d8285d62e011853476565b409486f040422101007a
@@ -9,6 +9,7 @@ rvm:
9
9
  - 2.5
10
10
  - 2.6
11
11
  - 2.7
12
+ - 3.0
12
13
  - ruby-head
13
14
  bundler_args: "--jobs=4 --retry=3"
14
15
  cache:
@@ -29,6 +30,10 @@ matrix:
29
30
  include:
30
31
  - rvm: 2.6
31
32
  env: SPEC_RUBYOPT="--jit"
33
+ - rvm: 2.7
34
+ env: SPEC_RUBYOPT="--jit"
35
+ - rvm: 3.0
36
+ env: SPEC_RUBYOPT="--jit"
32
37
  - rvm: ruby-head
33
38
  env: SPEC_RUBYOPT="--jit"
34
39
  branches:
@@ -1,5 +1,43 @@
1
1
  ## Unreleased
2
- [full changelog](https://github.com/itamae-kitchen/itamae/compare/v1.10.7...master)
2
+ [full changelog](https://github.com/itamae-kitchen/itamae/compare/v1.11.1...master)
3
+
4
+ ## v1.11.1
5
+ [full changelog](https://github.com/itamae-kitchen/itamae/compare/v1.11.0...v1.11.1)
6
+
7
+ Improvements
8
+
9
+ - [Support Ruby 3.0.0](https://github.com/itamae-kitchen/itamae/pull/326)
10
+ - [file: improve diff output (by @terceiro)](https://github.com/itamae-kitchen/itamae/pull/327)
11
+
12
+ ## v1.11.0
13
+ [full changelog](https://github.com/itamae-kitchen/itamae/compare/v1.10.10...v1.11.0)
14
+
15
+ Improvements
16
+
17
+ - [file: add support for sensitive files (by @terceiro)](https://github.com/itamae-kitchen/itamae/pull/325)
18
+
19
+ ## v1.10.10
20
+ [full changelog](https://github.com/itamae-kitchen/itamae/compare/v1.10.9...v1.10.10)
21
+
22
+ Improvements
23
+
24
+ - [Make output unbuffered](https://github.com/itamae-kitchen/itamae/pull/317)
25
+
26
+ ## v1.10.9
27
+ [full changelog](https://github.com/itamae-kitchen/itamae/compare/v1.10.8...v1.10.9)
28
+
29
+ Improvements
30
+
31
+ - [Fix CRLF problem in windows](https://github.com/itamae-kitchen/itamae/pull/316)
32
+
33
+ ## v1.10.8
34
+ [full changelog](https://github.com/itamae-kitchen/itamae/compare/v1.10.7...v1.10.8)
35
+
36
+ Improvements
37
+
38
+ - [Print "(in action_XXX)" as a debug log](https://github.com/itamae-kitchen/itamae/pull/315)
39
+ - [Reduce `check_package_is_installed` calling when package version is not specified](https://github.com/itamae-kitchen/itamae/pull/314)
40
+ - [Simplify Git resource's get_revision method](https://github.com/itamae-kitchen/itamae/pull/313)
3
41
 
4
42
  ## v1.10.7
5
43
  [full changelog](https://github.com/itamae-kitchen/itamae/compare/v1.10.6...v1.10.7)
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # [![](https://raw.githubusercontent.com/itamae-kitchen/itamae-logos/master/small/FA-Itamae-horizontal-01-180x72.png)](https://github.com/itamae-kitchen/itamae)
2
2
 
3
- [![Gem Version](https://badge.fury.io/rb/itamae.svg)](http://badge.fury.io/rb/itamae) [![Code Climate](https://codeclimate.com/github/ryotarai/itamae/badges/gpa.svg)](https://codeclimate.com/github/ryotarai/itamae) [![Build Status](https://travis-ci.org/itamae-kitchen/itamae.svg?branch=master)](https://travis-ci.org/itamae-kitchen/itamae) [![Slack](https://img.shields.io/badge/slack-join-blue.svg)](https://join.slack.com/t/itamae/shared_invite/enQtNTExNTI3ODM1NTY5LTM5MWJlZTgwODE0YTUwMThiNzZjN2I1MGNlZjE2NjlmNzg5NTNlOTliMDhkNDNmNTQ2ZTgwMzZjNjI5NDJiZGI)
3
+ [![Gem Version](https://badge.fury.io/rb/itamae.svg)](http://badge.fury.io/rb/itamae) [![Code Climate](https://codeclimate.com/github/ryotarai/itamae/badges/gpa.svg)](https://codeclimate.com/github/ryotarai/itamae) [![Build Status](https://travis-ci.com/itamae-kitchen/itamae.svg?branch=master)](https://travis-ci.com/itamae-kitchen/itamae) [![Slack](https://img.shields.io/badge/slack-join-blue.svg)](https://join.slack.com/t/itamae/shared_invite/enQtNTExNTI3ODM1NTY5LTM5MWJlZTgwODE0YTUwMThiNzZjN2I1MGNlZjE2NjlmNzg5NTNlOTliMDhkNDNmNTQ2ZTgwMzZjNjI5NDJiZGI)
4
4
 
5
5
  Simple and lightweight configuration management tool inspired by Chef.
6
6
 
@@ -97,4 +97,3 @@ If you have a problem, please [create an issue](https://github.com/itamae-kitche
97
97
  3. Commit your changes (`git commit -am 'Add some feature'`)
98
98
  4. Push to the branch (`git push origin my-new-feature`)
99
99
  5. Create new Pull Request
100
-
@@ -37,7 +37,7 @@ Gem::Specification.new do |spec|
37
37
  spec.add_development_dependency "rspec", "~> 3.0"
38
38
  spec.add_development_dependency "serverspec", "~> 2.1"
39
39
  spec.add_development_dependency "pry-byebug"
40
- spec.add_development_dependency "docker-api", "~> 1.20"
40
+ spec.add_development_dependency "docker-api", "~> 2"
41
41
  spec.add_development_dependency "fakefs"
42
42
  spec.add_development_dependency "fluent-logger"
43
43
  end
@@ -126,6 +126,7 @@ module Itamae
126
126
  @logger = ::Logger.new($stdout).tap do |l|
127
127
  l.formatter = Itamae::Logger::Formatter.new
128
128
  end.extend(Itamae::Logger::Helper)
129
+ $stdout.sync = true
129
130
 
130
131
  class << self
131
132
  def logger
@@ -1,6 +1,7 @@
1
1
  require 'hashie'
2
2
  require 'json'
3
3
  require 'schash'
4
+ require 'itamae/mash'
4
5
 
5
6
  module Itamae
6
7
  class Node
@@ -195,6 +195,7 @@ module Itamae
195
195
  show_differences
196
196
 
197
197
  method_name = "action_#{action}"
198
+ Itamae.logger.debug "(in #{method_name})"
198
199
  if runner.dry_run?
199
200
  unless respond_to?(method_name)
200
201
  Itamae.logger.error "action #{action.inspect} is unavailable"
@@ -4,6 +4,7 @@ module Itamae
4
4
  define_attribute :action, default: :create
5
5
  define_attribute :path, type: String, default_name: true
6
6
  define_attribute :content, type: String, default: nil
7
+ define_attribute :sensitive, default: false
7
8
  define_attribute :mode, type: String
8
9
  define_attribute :owner, type: String
9
10
  define_attribute :group, type: String
@@ -156,9 +157,14 @@ module Itamae
156
157
  end
157
158
 
158
159
  def show_content_diff
160
+ if attributes.sensitive
161
+ Itamae.logger.info("diff exists, but not displaying sensitive content")
162
+ return
163
+ end
164
+
159
165
  if attributes.modified
160
166
  Itamae.logger.info "diff:"
161
- diff = run_command(["diff", "-u", compare_to, @temppath], error: false)
167
+ diff = run_command(["diff", "-u", "--label=#{attributes.path} (BEFORE)", compare_to, "--label=#{attributes.path} (AFTER)", @temppath], error: false)
162
168
  diff.stdout.each_line do |line|
163
169
  color = if line.start_with?('+')
164
170
  :green
@@ -193,7 +199,12 @@ module Itamae
193
199
  src = if content_file
194
200
  content_file
195
201
  else
196
- f = Tempfile.open('itamae')
202
+ f =
203
+ if Gem.win_platform?
204
+ Tempfile.open('itamae', :mode=>IO::BINARY)
205
+ else
206
+ Tempfile.open('itamae')
207
+ end
197
208
  f.write(attributes.content)
198
209
  f.close
199
210
  f.path
@@ -84,11 +84,11 @@ module Itamae
84
84
  end
85
85
 
86
86
  def get_revision(branch)
87
- result = run_command_in_repo("git rev-list #{shell_escape(branch)}", error: false)
88
- unless result.exit_status == 0
89
- fetch_origin!
90
- end
91
- run_command_in_repo("git rev-list #{shell_escape(branch)}").stdout.lines.first.strip
87
+ result = run_command_in_repo("git rev-parse #{shell_escape(branch)}", error: false)
88
+ return result.stdout.strip if result.exit_status == 0
89
+
90
+ fetch_origin!
91
+ run_command_in_repo("git rev-parse #{shell_escape(branch)}").stdout.strip
92
92
  end
93
93
 
94
94
  def fetch_origin!
@@ -24,6 +24,8 @@ module Itamae
24
24
  end
25
25
 
26
26
  def action_install(action_options)
27
+ return if !attributes.version && current.installed
28
+
27
29
  unless run_specinfra(:check_package_is_installed, attributes.name, attributes.version)
28
30
  run_specinfra(:install_package, attributes.name, attributes.version, attributes.options)
29
31
  updated!
@@ -31,7 +33,7 @@ module Itamae
31
33
  end
32
34
 
33
35
  def action_remove(action_options)
34
- if run_specinfra(:check_package_is_installed, attributes.name, nil)
36
+ if current.installed
35
37
  run_specinfra(:remove_package, attributes.name, attributes.options)
36
38
  updated!
37
39
  end
@@ -1,3 +1,3 @@
1
1
  module Itamae
2
- VERSION = "1.10.7"
2
+ VERSION = "1.11.1"
3
3
  end
@@ -104,7 +104,7 @@ describe file('/tmp/http_request_headers.html') do
104
104
  its(:content) { should match(/"User-Agent":\s*"Itamae"/) }
105
105
  end
106
106
 
107
- describe file('/tmp/http_request_redirect.html') do
107
+ xdescribe file('/tmp/http_request_redirect.html') do
108
108
  it { should be_file }
109
109
  its(:content) { should match(/"from":\s*"itamae"/) }
110
110
  end
@@ -210,10 +210,10 @@ http_request "/tmp/http_request_headers.html" do
210
210
  url "https://httpbin.org/get"
211
211
  end
212
212
 
213
- http_request "/tmp/http_request_redirect.html" do
214
- redirect_limit 1
215
- url "https://httpbin.org/redirect-to?url=https%3A%2F%2Fhttpbin.org%2Fget%3Ffrom%3Ditamae"
216
- end
213
+ # http_request "/tmp/http_request_redirect.html" do
214
+ # redirect_limit 1
215
+ # url "https://httpbin.org/redirect-to?url=https%3A%2F%2Fhttpbin.org%2Fget%3Ffrom%3Ditamae"
216
+ # end
217
217
 
218
218
  link "/tmp-link" do
219
219
  to "/tmp"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: itamae
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.10.7
4
+ version: 1.11.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryota Arai
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2020-04-05 00:00:00.000000000 Z
13
+ date: 2020-12-29 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: thor
@@ -164,14 +164,14 @@ dependencies:
164
164
  requirements:
165
165
  - - "~>"
166
166
  - !ruby/object:Gem::Version
167
- version: '1.20'
167
+ version: '2'
168
168
  type: :development
169
169
  prerelease: false
170
170
  version_requirements: !ruby/object:Gem::Requirement
171
171
  requirements:
172
172
  - - "~>"
173
173
  - !ruby/object:Gem::Version
174
- version: '1.20'
174
+ version: '2'
175
175
  - !ruby/object:Gem::Dependency
176
176
  name: fakefs
177
177
  requirement: !ruby/object:Gem::Requirement
@@ -329,7 +329,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
329
329
  - !ruby/object:Gem::Version
330
330
  version: '0'
331
331
  requirements: []
332
- rubygems_version: 3.0.3
332
+ rubygems_version: 3.1.4
333
333
  signing_key:
334
334
  specification_version: 4
335
335
  summary: Simple Configuration Management Tool