itamae 1.13.0 → 1.14.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: adefcb08fb8611f035cf3f70d3d76ab4c2b1d012aef3f4489f33c4fb445a88fd
4
- data.tar.gz: d4e7126f52fb0da4906a289025d9c73a2143b90a1297c570b81e3490985cd83e
3
+ metadata.gz: 941bb9ea78dc5e3f6f91c1c6e423d086659eeaee58ffcdb41c66f0b99dc08667
4
+ data.tar.gz: a796304a86594b08468cf5f14c9a326ff22c7fa1987f6e1aedcd64440ff64dc9
5
5
  SHA512:
6
- metadata.gz: 2a5206774cb5c387b79030ed32e9d12c096189a78725294d9516a1abf18199d9ca5d0339b75ae5815d0778f6372b29fef38c3c65b992deea7412729873995578
7
- data.tar.gz: a8c13d073d29418c523a95501bc42c2864c1250def6a13936f744981eba9ddc4eb9b7ae59a7d66ba367c7799331ea0577fb81815ae7fb0fdc7d1b9825f530a05
6
+ metadata.gz: ebe3d6b48795534aecab054b5f46b1a65f139810a5c65f3ad3efa3a42f4a01dbc36a2fbe5473c115a89fec39c7f29a2c49e6341ba7db9498a954970e2e351e2e
7
+ data.tar.gz: 926e1637d9372bc22a17d79af0e2456c142ed6a8e24c4b3e8ccd7c5af0dacd76b155848aec8d4b88fa78e27713c8831c27f8fb298acd6b72eab5008d799e0d85
data/CHANGELOG.md CHANGED
@@ -1,5 +1,28 @@
1
1
  ## Unreleased
2
- [full changelog](https://github.com/itamae-kitchen/itamae/compare/v1.13.0...master)
2
+ [full changelog](https://github.com/itamae-kitchen/itamae/compare/v1.14.1...master)
3
+
4
+ ## v1.14.1
5
+ [full changelog](https://github.com/itamae-kitchen/itamae/compare/v1.14.0...v1.14.1)
6
+
7
+ Bugfixes
8
+
9
+ - [Add Itamae::Runner recipe_files argument data type validation (by @dvinciguerra)](https://github.com/itamae-kitchen/itamae/pull/356)
10
+
11
+
12
+ ## v1.14.0
13
+ [full changelog](https://github.com/itamae-kitchen/itamae/compare/v1.13.1...v1.14.0)
14
+
15
+ Bugfixes
16
+
17
+ - [Execute local_ruby_block code inside of chdir-ed block if cwd presented](https://github.com/itamae-kitchen/itamae/pull/355)
18
+
19
+
20
+ ## v1.13.1
21
+ [full changelog](https://github.com/itamae-kitchen/itamae/compare/v1.13.0...v1.13.1)
22
+
23
+ Improvements
24
+
25
+ - [Made MFA mandatory for gem releases](https://github.com/itamae-kitchen/itamae/pull/354)
3
26
 
4
27
  ## v1.13.0
5
28
  [full changelog](https://github.com/itamae-kitchen/itamae/compare/v1.12.6...v1.13.0)
data/README.md CHANGED
@@ -33,7 +33,7 @@ service 'nginx' do
33
33
  end
34
34
  ```
35
35
 
36
- And then excute `itamae` command to apply a recipe to a local machine.
36
+ And then execute `itamae` command to apply a recipe to a local machine.
37
37
 
38
38
  ```
39
39
  $ itamae local recipe.rb
data/itamae.gemspec CHANGED
@@ -16,6 +16,7 @@ Gem::Specification.new do |spec|
16
16
  spec.metadata["homepage_uri"] = spec.homepage
17
17
  spec.metadata["source_code_uri"] = "https://github.com/itamae-kitchen/itamae"
18
18
  spec.metadata["changelog_uri"] = "https://github.com/itamae-kitchen/itamae/blob/master/CHANGELOG.md"
19
+ spec.metadata["rubygems_mfa_required"] = "true"
19
20
  else
20
21
  raise "RubyGems 2.0 or newer is required to protect against " \
21
22
  "public gem pushes."
@@ -5,7 +5,13 @@ module Itamae
5
5
  define_attribute :block, type: Proc
6
6
 
7
7
  def action_run(options)
8
- attributes.block.call
8
+ if attributes[:cwd]
9
+ Dir.chdir(attributes[:cwd]) do
10
+ attributes.block.call
11
+ end
12
+ else
13
+ attributes.block.call
14
+ end
9
15
  end
10
16
  end
11
17
  end
data/lib/itamae/runner.rb CHANGED
@@ -5,6 +5,10 @@ module Itamae
5
5
  class Runner
6
6
  class << self
7
7
  def run(recipe_files, backend_type, options)
8
+ unless recipe_files.is_a? Array
9
+ raise ArgumentError, 'recipe_files must be an Array'
10
+ end
11
+
8
12
  Itamae.logger.info "Starting Itamae... #{options[:dry_run] ? '(dry-run)' : ''}"
9
13
 
10
14
  backend = Backend.create(backend_type, options)
@@ -1,3 +1,3 @@
1
1
  module Itamae
2
- VERSION = "1.13.0"
2
+ VERSION = "1.14.1"
3
3
  end
@@ -527,6 +527,15 @@ local_ruby_block 'execute run_command' do
527
527
  end
528
528
  end
529
529
 
530
+ local_ruby_block "pwd with cwd attribute" do
531
+ cwd "/tmp"
532
+ block do
533
+ unless `pwd`.chomp == "/tmp"
534
+ raise "working directory mismatched"
535
+ end
536
+ end
537
+ end
538
+
530
539
  execute "touch /tmp/subscribed_from_parent" do
531
540
  action :nothing
532
541
  subscribes :run, 'execute[subscribed from parent]'
@@ -27,6 +27,14 @@ module Itamae
27
27
  end
28
28
  described_class.run(recipes, :local, {})
29
29
  end
30
+
31
+ it "raises error for invalid recipes argument type" do
32
+ [nil, "recipe.rb"].each do |recipe|
33
+ expect do
34
+ described_class.run(recipe, :local, {})
35
+ end.to raise_error(ArgumentError, 'recipe_files must be an Array')
36
+ end
37
+ end
30
38
  end
31
39
 
32
40
  describe "#initialize" do
metadata CHANGED
@@ -1,16 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: itamae
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.13.0
4
+ version: 1.14.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryota Arai
8
8
  - Yusuke Nakamura
9
9
  - sue445
10
- autorequire:
10
+ autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2022-05-24 00:00:00.000000000 Z
13
+ date: 2022-07-10 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: thor
@@ -200,7 +200,7 @@ dependencies:
200
200
  - - ">="
201
201
  - !ruby/object:Gem::Version
202
202
  version: '0'
203
- description:
203
+ description:
204
204
  email:
205
205
  - ryota.arai@gmail.com
206
206
  - yusuke1994525@gmail.com
@@ -316,7 +316,8 @@ metadata:
316
316
  homepage_uri: https://itamae.kitchen/
317
317
  source_code_uri: https://github.com/itamae-kitchen/itamae
318
318
  changelog_uri: https://github.com/itamae-kitchen/itamae/blob/master/CHANGELOG.md
319
- post_install_message:
319
+ rubygems_mfa_required: 'true'
320
+ post_install_message:
320
321
  rdoc_options: []
321
322
  require_paths:
322
323
  - lib
@@ -331,8 +332,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
331
332
  - !ruby/object:Gem::Version
332
333
  version: '0'
333
334
  requirements: []
334
- rubygems_version: 3.2.22
335
- signing_key:
335
+ rubygems_version: 3.2.3
336
+ signing_key:
336
337
  specification_version: 4
337
338
  summary: Simple Configuration Management Tool
338
339
  test_files: