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 +4 -4
- data/.travis.yml +5 -0
- data/CHANGELOG.md +39 -1
- data/README.md +1 -2
- data/itamae.gemspec +1 -1
- data/lib/itamae/logger.rb +1 -0
- data/lib/itamae/node.rb +1 -0
- data/lib/itamae/resource/base.rb +1 -0
- data/lib/itamae/resource/file.rb +13 -2
- data/lib/itamae/resource/git.rb +5 -5
- data/lib/itamae/resource/package.rb +3 -1
- data/lib/itamae/version.rb +1 -1
- data/spec/integration/default_spec.rb +1 -1
- data/spec/integration/recipes/default.rb +4 -4
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2213250f28fa9b34d4c8d149add25c33f9955b6dd30dfab4fc7ddd9f4e438e61
|
4
|
+
data.tar.gz: 12b67ddfa15210dfb1ea8d35b5aa02db9e4985f4e141c66d7102628b09b5f914
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4a83817032655a372418a0c2aeef5561e2b669c075b16a0b56f3522d94883396cc535b44cad5d3e2b7c2b8c8c4fdbf400eb95a9efe986b97effaa587cf8d5564
|
7
|
+
data.tar.gz: 96380efa8166f7629035be66884c3526c4c521eaababb5303bf0c520bbb914ebcb8de2e2492bd0ffbc1681d8285d62e011853476565b409486f040422101007a
|
data/.travis.yml
CHANGED
@@ -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:
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,43 @@
|
|
1
1
|
## Unreleased
|
2
|
-
[full changelog](https://github.com/itamae-kitchen/itamae/compare/v1.
|
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.
|
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
|
-
|
data/itamae.gemspec
CHANGED
@@ -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", "~>
|
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
|
data/lib/itamae/logger.rb
CHANGED
data/lib/itamae/node.rb
CHANGED
data/lib/itamae/resource/base.rb
CHANGED
data/lib/itamae/resource/file.rb
CHANGED
@@ -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 =
|
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
|
data/lib/itamae/resource/git.rb
CHANGED
@@ -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-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
run_command_in_repo("git rev-
|
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
|
36
|
+
if current.installed
|
35
37
|
run_specinfra(:remove_package, attributes.name, attributes.options)
|
36
38
|
updated!
|
37
39
|
end
|
data/lib/itamae/version.rb
CHANGED
@@ -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
|
-
|
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
|
-
|
215
|
-
|
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.
|
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-
|
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: '
|
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: '
|
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.
|
332
|
+
rubygems_version: 3.1.4
|
333
333
|
signing_key:
|
334
334
|
specification_version: 4
|
335
335
|
summary: Simple Configuration Management Tool
|