itamae 1.14.1 → 1.14.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 941bb9ea78dc5e3f6f91c1c6e423d086659eeaee58ffcdb41c66f0b99dc08667
4
- data.tar.gz: a796304a86594b08468cf5f14c9a326ff22c7fa1987f6e1aedcd64440ff64dc9
3
+ metadata.gz: a4e4d3ac8c4c594f8721621e3ac992482d8f89a4391525e7f40ae7bbf6c492d1
4
+ data.tar.gz: fdb3b1e0f358f66453c9097a1f3bc8577eb606f76522059885dbde4b938d92d8
5
5
  SHA512:
6
- metadata.gz: ebe3d6b48795534aecab054b5f46b1a65f139810a5c65f3ad3efa3a42f4a01dbc36a2fbe5473c115a89fec39c7f29a2c49e6341ba7db9498a954970e2e351e2e
7
- data.tar.gz: 926e1637d9372bc22a17d79af0e2456c142ed6a8e24c4b3e8ccd7c5af0dacd76b155848aec8d4b88fa78e27713c8831c27f8fb298acd6b72eab5008d799e0d85
6
+ metadata.gz: 4e47d72e5095bf93a0e11f2ac0686bb787693de09b84672be240a41addb09d7b2a56b205a10f3738fd8b2d64d0d75a6ea431861aef5e27c1eb147d40c444ca37
7
+ data.tar.gz: c03a588ab12d43ce1921b96e8d8581d9296f847ac127a0af956b6fba5edbc085a8eab53ff8876e93b4303854ecb60d34186b7dd49d68e1bac002d06eea0b7843
@@ -0,0 +1,8 @@
1
+ # c.f. https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
2
+ version: 2
3
+
4
+ updates:
5
+ - package-ecosystem: github-actions
6
+ directory: /
7
+ schedule:
8
+ interval: monthly
@@ -0,0 +1,41 @@
1
+ name: Publish gem to rubygems.org
2
+
3
+ on:
4
+ workflow_dispatch:
5
+
6
+ jobs:
7
+ release:
8
+ if: github.repository == 'itamae-kitchen/itamae'
9
+ runs-on: ubuntu-latest
10
+
11
+ environment:
12
+ name: rubygems.org
13
+ url: https://rubygems.org/gems/itamae
14
+
15
+ permissions:
16
+ contents: write
17
+ id-token: write
18
+
19
+ steps:
20
+ - name: Harden Runner
21
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
22
+ with:
23
+ egress-policy: audit
24
+
25
+ - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
26
+
27
+ - name: Set up Ruby
28
+ uses: ruby/setup-ruby@eaecf785f6a34567a6d97f686bbb7bccc1ac1e5c # v1.237.0
29
+ with:
30
+ bundler-cache: true
31
+ ruby-version: ruby
32
+
33
+ - name: Publish to RubyGems
34
+ uses: rubygems/release-gem@a25424ba2ba8b387abc8ef40807c2c85b96cbe32 # v1.1.1
35
+
36
+ - name: Create GitHub release
37
+ run: |
38
+ tag_name="$(git describe --tags --abbrev=0)"
39
+ gh release create "${tag_name}" --verify-tag --generate-notes
40
+ env:
41
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -13,9 +13,7 @@ on:
13
13
  - cron: "0 0 * * 5" # JST 9:00 (Fri)
14
14
 
15
15
  jobs:
16
- unit:
17
- runs-on: ubuntu-latest
18
-
16
+ test_main:
19
17
  strategy:
20
18
  fail-fast: false
21
19
 
@@ -28,6 +26,9 @@ jobs:
28
26
  - "2.7"
29
27
  - "3.0"
30
28
  - "3.1"
29
+ - "3.2"
30
+ - "3.3"
31
+ - "3.4"
31
32
  rubyopt:
32
33
  - ""
33
34
  - "--jit"
@@ -53,183 +54,34 @@ jobs:
53
54
  rubyopt: "--yjit"
54
55
  - ruby: "3.0"
55
56
  rubyopt: "--yjit"
56
- env:
57
- RUBYOPT: ${{ matrix.rubyopt }}
58
-
59
- steps:
60
- - uses: actions/checkout@v2
61
-
62
- - uses: ruby/setup-ruby@v1
63
- with:
64
- ruby-version: ${{ matrix.ruby }}
65
- bundler-cache: true
66
-
67
- - run: bundle update
68
-
69
- - run: bundle exec rake spec:unit
70
-
71
- - name: Slack Notification (not success)
72
- uses: lazy-actions/slatify@master
73
- if: "! success()"
74
- continue-on-error: true
75
- with:
76
- job_name: ${{ format('*unit* ({0},{1})', matrix.ruby, matrix.rubyopt) }}
77
- type: ${{ job.status }}
78
- icon_emoji: ":octocat:"
79
- url: ${{ secrets.SLACK_WEBHOOK }}
80
- token: ${{ secrets.GITHUB_TOKEN }}
81
-
82
- integration-docker:
83
- runs-on: ubuntu-latest
84
-
85
- strategy:
86
- fail-fast: false
87
-
88
- matrix:
89
- ruby:
90
- - "2.3"
91
- - "2.4"
92
- - "2.5"
93
- - "2.6"
94
- - "2.7"
95
- - "3.0"
96
- - "3.1"
97
- rubyopt:
98
- - ""
99
- - "--jit"
100
- - "--yjit"
101
- image:
102
- - ubuntu:trusty
103
- exclude:
104
- # --jit is available since MRI 2.6
105
- - ruby: "2.3"
106
- rubyopt: "--jit"
107
- - ruby: "2.4"
108
- rubyopt: "--jit"
109
- - ruby: "2.5"
110
- rubyopt: "--jit"
111
- # --yjit is available since MRI 3.1
112
- - ruby: "2.3"
113
- rubyopt: "--yjit"
114
- - ruby: "2.4"
115
- rubyopt: "--yjit"
116
- - ruby: "2.5"
117
- rubyopt: "--yjit"
118
- - ruby: "2.6"
119
- rubyopt: "--yjit"
120
- - ruby: "2.7"
121
- rubyopt: "--yjit"
122
- - ruby: "3.0"
123
- rubyopt: "--yjit"
124
-
125
- env:
126
- RUBYOPT: ${{ matrix.rubyopt }}
127
- TEST_IMAGE: ${{ matrix.image }}
128
-
129
- steps:
130
- - uses: actions/checkout@v2
131
-
132
- - uses: ruby/setup-ruby@v1
133
- with:
134
- ruby-version: ${{ matrix.ruby }}
135
- bundler-cache: true
136
57
 
137
- - run: bundle update
138
-
139
- - run: bundle exec rake spec:integration:docker:boot
140
-
141
- - run: bundle exec rake spec:integration:docker:provision
142
- env:
143
- # FIXME: avoid error for "Command `chmod 777 /tmp/itamae_tmp` failed. (exit status: 1)"
144
- ITAMAE_TMP_DIR: /var/tmp/itamae_tmp
145
-
146
- - run: bundle exec rake spec:integration:docker:serverspec
147
- - run: bundle exec rake spec:integration:docker:clean_docker_container
148
-
149
- - name: Slack Notification (not success)
150
- uses: lazy-actions/slatify@master
151
- if: "! success()"
152
- continue-on-error: true
153
- with:
154
- job_name: ${{ format('*integration-docker* ({0},{1},{2})', matrix.ruby, matrix.rubyopt, matrix.image) }}
155
- type: ${{ job.status }}
156
- icon_emoji: ":octocat:"
157
- url: ${{ secrets.SLACK_WEBHOOK }}
158
- token: ${{ secrets.GITHUB_TOKEN }}
159
-
160
- integration-local:
161
- runs-on: ubuntu-latest
162
-
163
- strategy:
164
- fail-fast: false
165
-
166
- matrix:
167
- ruby:
168
- - "2.3"
169
- - "2.4"
170
- - "2.5"
171
- - "2.6"
172
- - "2.7"
173
- - "3.0"
174
- - "3.1"
175
- rubyopt:
176
- - ""
177
- - "--jit"
178
- - "--yjit"
179
- exclude:
180
- # --jit is available since MRI 2.6
181
- - ruby: "2.3"
182
- rubyopt: "--jit"
183
- - ruby: "2.4"
184
- rubyopt: "--jit"
185
- - ruby: "2.5"
186
- rubyopt: "--jit"
187
- # --yjit is available since MRI 3.1
188
- - ruby: "2.3"
189
- rubyopt: "--yjit"
190
- - ruby: "2.4"
191
- rubyopt: "--yjit"
192
- - ruby: "2.5"
193
- rubyopt: "--yjit"
194
- - ruby: "2.6"
58
+ # --jit is same to --yjit since MRI 3.2 (don't test both `--jit` and `--yjit`)
59
+ - ruby: "3.2"
195
60
  rubyopt: "--yjit"
196
- - ruby: "2.7"
61
+ - ruby: "3.3"
197
62
  rubyopt: "--yjit"
198
- - ruby: "3.0"
63
+ - ruby: "3.4"
199
64
  rubyopt: "--yjit"
200
65
 
201
- env:
202
- RUBYOPT: ${{ matrix.rubyopt }}
203
-
204
- steps:
205
- - uses: actions/checkout@v2
206
-
207
- - uses: ruby/setup-ruby@v1
208
- with:
209
- ruby-version: ${{ matrix.ruby }}
210
- bundler-cache: true
211
-
212
- - run: bundle update
213
-
214
- - run: bundle exec rake spec:integration:local:main
215
- - run: bundle exec rake spec:integration:local:ordinary_user
66
+ uses: ./.github/workflows/test_main.yml
67
+ with:
68
+ ruby: ${{ matrix.ruby }}
69
+ rubyopt: ${{ matrix.rubyopt }}
216
70
 
217
- - name: Slack Notification (not success)
218
- uses: lazy-actions/slatify@master
219
- if: "! success()"
220
- continue-on-error: true
221
- with:
222
- job_name: ${{ format('*integration-local* ({0},{1})', matrix.ruby, matrix.rubyopt) }}
223
- type: ${{ job.status }}
224
- icon_emoji: ":octocat:"
225
- url: ${{ secrets.SLACK_WEBHOOK }}
226
- token: ${{ secrets.GITHUB_TOKEN }}
71
+ # This repository uses matrix to run 50+ builds in a pipeline.
72
+ # This results in simultaneous requests being sent to httpbin.org,
73
+ # similar to a DDoS attack, often causing 500 errors and test failures.
74
+ #
75
+ # e.g. https://github.com/itamae-kitchen/itamae/actions/runs/17045210601/job/48319099479?pr=379
76
+ #
77
+ # Therefore, I suppressed simultaneous requests to httpbin.org.
78
+ skip_http_request_test: ${{ (matrix.ruby == '2.3' && matrix.rubyopt == '') && 'false' || 'true' }}
79
+ secrets:
80
+ SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
227
81
 
228
82
  notify:
229
83
  needs:
230
- - unit
231
- - integration-docker
232
- - integration-local
84
+ - test_main
233
85
 
234
86
  runs-on: ubuntu-latest
235
87
 
@@ -0,0 +1,142 @@
1
+ name: test_main
2
+
3
+ on:
4
+ workflow_call:
5
+ inputs:
6
+ ruby:
7
+ required: true
8
+ type: string
9
+ rubyopt:
10
+ required: false
11
+ type: string
12
+ default: ""
13
+ skip_http_request_test:
14
+ required: true
15
+ type: string
16
+ secrets:
17
+ SLACK_WEBHOOK:
18
+ required: true
19
+
20
+ jobs:
21
+ unit:
22
+ runs-on: ubuntu-latest
23
+
24
+ steps:
25
+ - uses: actions/checkout@v6
26
+
27
+ - uses: ruby/setup-ruby@v1
28
+ with:
29
+ ruby-version: ${{ inputs.ruby }}
30
+ bundler-cache: true
31
+ bundler: default
32
+
33
+ - run: bundle update
34
+
35
+ - run: bundle exec rake spec:unit
36
+ env:
37
+ RUBYOPT: ${{ inputs.rubyopt }}
38
+
39
+ - name: Slack Notification (not success)
40
+ uses: lazy-actions/slatify@master
41
+ if: "! success()"
42
+ continue-on-error: true
43
+ with:
44
+ job_name: ${{ format('*unit* ({0},{1})', inputs.ruby, inputs.rubyopt) }}
45
+ type: ${{ job.status }}
46
+ icon_emoji: ":octocat:"
47
+ url: ${{ secrets.SLACK_WEBHOOK }}
48
+ token: ${{ secrets.GITHUB_TOKEN }}
49
+
50
+ integration-docker:
51
+ runs-on: ubuntu-latest
52
+
53
+ strategy:
54
+ fail-fast: false
55
+
56
+ matrix:
57
+ image:
58
+ - ubuntu:trusty
59
+
60
+ env:
61
+ TEST_IMAGE: ${{ matrix.image }}
62
+ SKIP_HTTP_REQUEST_TEST: ${{ inputs.skip_http_request_test }}
63
+
64
+ steps:
65
+ - uses: actions/checkout@v6
66
+
67
+ - uses: ruby/setup-ruby@v1
68
+ with:
69
+ ruby-version: ${{ inputs.ruby }}
70
+ bundler-cache: true
71
+ bundler: default
72
+
73
+ - run: bundle update
74
+
75
+ - run: bundle exec rake spec:integration:docker:boot
76
+ env:
77
+ RUBYOPT: ${{ inputs.rubyopt }}
78
+
79
+ - run: bundle exec rake spec:integration:docker:provision
80
+ env:
81
+ RUBYOPT: ${{ inputs.rubyopt }}
82
+
83
+ # FIXME: avoid error for "Command `chmod 777 /tmp/itamae_tmp` failed. (exit status: 1)"
84
+ ITAMAE_TMP_DIR: /var/tmp/itamae_tmp
85
+
86
+ - run: bundle exec rake spec:integration:docker:serverspec
87
+ env:
88
+ RUBYOPT: ${{ inputs.rubyopt }}
89
+
90
+ - run: bundle exec rake spec:integration:docker:clean_docker_container
91
+ env:
92
+ RUBYOPT: ${{ inputs.rubyopt }}
93
+
94
+ - name: Slack Notification (not success)
95
+ uses: lazy-actions/slatify@master
96
+ if: "! success()"
97
+ continue-on-error: true
98
+ with:
99
+ job_name: ${{ format('*integration-docker* ({0},{1},{2})', inputs.ruby, inputs.rubyopt, matrix.image) }}
100
+ type: ${{ job.status }}
101
+ icon_emoji: ":octocat:"
102
+ url: ${{ secrets.SLACK_WEBHOOK }}
103
+ token: ${{ secrets.GITHUB_TOKEN }}
104
+
105
+ integration-local:
106
+ runs-on: ubuntu-latest
107
+
108
+ # NOTE: When ruby is 2.5, tests run on buster. But buster is already EOL and didn't work apt-get
109
+ if: ${{ inputs.ruby >= '2.6' }}
110
+
111
+ env:
112
+ SKIP_HTTP_REQUEST_TEST: ${{ inputs.skip_http_request_test }}
113
+
114
+ steps:
115
+ - uses: actions/checkout@v6
116
+
117
+ - uses: ruby/setup-ruby@v1
118
+ with:
119
+ ruby-version: ${{ inputs.ruby }}
120
+ bundler-cache: true
121
+ bundler: default
122
+
123
+ - run: bundle update
124
+
125
+ - run: bundle exec rake spec:integration:local:main
126
+ env:
127
+ RUBYOPT: ${{ inputs.rubyopt }}
128
+
129
+ - run: bundle exec rake spec:integration:local:ordinary_user
130
+ env:
131
+ RUBYOPT: ${{ inputs.rubyopt }}
132
+
133
+ - name: Slack Notification (not success)
134
+ uses: lazy-actions/slatify@master
135
+ if: "! success()"
136
+ continue-on-error: true
137
+ with:
138
+ job_name: ${{ format('*integration-local* ({0},{1})', inputs.ruby, inputs.rubyopt) }}
139
+ type: ${{ job.status }}
140
+ icon_emoji: ":octocat:"
141
+ url: ${{ secrets.SLACK_WEBHOOK }}
142
+ token: ${{ secrets.GITHUB_TOKEN }}
data/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  ## Unreleased
2
- [full changelog](https://github.com/itamae-kitchen/itamae/compare/v1.14.1...master)
2
+ [full changelog](https://github.com/itamae-kitchen/itamae/compare/v1.14.2...master)
3
+
4
+ ## v1.14.2
5
+ [full changelog](https://github.com/itamae-kitchen/itamae/compare/v1.14.1...v1.14.2)
6
+
7
+ Bugfixes
8
+
9
+ - [Add workaround for `Gem::Package::TarWriter#add_file`](https://github.com/itamae-kitchen/itamae/pull/378)
3
10
 
4
11
  ## v1.14.1
5
12
  [full changelog](https://github.com/itamae-kitchen/itamae/compare/v1.14.0...v1.14.1)
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://github.com/itamae-kitchen/itamae/workflows/test/badge.svg?branch=master)](https://github.com/itamae-kitchen/itamae/actions?query=workflow%3Atest) [![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) [![Maintainability](https://api.codeclimate.com/v1/badges/1de79e271cff2a43091f/maintainability)](https://codeclimate.com/github/itamae-kitchen/itamae/maintainability) [![test](https://github.com/itamae-kitchen/itamae/actions/workflows/test.yml/badge.svg)](https://github.com/itamae-kitchen/itamae/actions/workflows/test.yml) [![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
 
data/Rakefile CHANGED
@@ -29,7 +29,7 @@ namespace :spec do
29
29
  namespace :docker do
30
30
  desc "Run docker"
31
31
  task :boot do
32
- sh "docker run --privileged -d --name #{container_name} #{TEST_IMAGE} /sbin/init"
32
+ sh "docker run --env SKIP_HTTP_REQUEST_TEST --privileged -d --name #{container_name} #{TEST_IMAGE} /sbin/init"
33
33
  end
34
34
 
35
35
  desc "Run itamae"
@@ -214,7 +214,19 @@ module Itamae
214
214
 
215
215
  if backend.is_a?(Itamae::Backend::Docker)
216
216
  run_command(["mkdir", @temppath])
217
+
218
+ # NOTE: From rubygems v3.6.7, Gem::Package::TarWriter#add_file uses SOURCE_DATE_EPOCH env var to set file mtime.
219
+ # This is a workaround for Docker backend where Gem::Package::TarWriter#add_file used in Docker backend.
220
+ # See also:
221
+ # * https://github.com/ruby/rubygems/pull/8673
222
+ # * https://github.com/itamae-kitchen/itamae/issues/377
223
+ # * https://github.com/itamae-kitchen/itamae/pull/378
224
+ current_source_date_epoch_env = ENV["SOURCE_DATE_EPOCH"]
225
+ ENV["SOURCE_DATE_EPOCH"] = Time.now.to_i.to_s unless current_source_date_epoch_env
217
226
  backend.send_file(src, @temppath, user: attributes.user)
227
+ ENV["SOURCE_DATE_EPOCH"] = current_source_date_epoch_env
228
+ # end of NOTE
229
+
218
230
  @temppath = ::File.join(@temppath, ::File.basename(src))
219
231
  else
220
232
  run_command(["touch", @temppath])
@@ -1,3 +1,3 @@
1
1
  module Itamae
2
- VERSION = "1.14.1"
2
+ VERSION = "1.14.2"
3
3
  end
@@ -11,7 +11,7 @@ describe file('/tmp/included_recipe') do
11
11
  it { should be_file }
12
12
  end
13
13
 
14
- describe package('dstat') do
14
+ describe package('jq') do
15
15
  it { should be_installed }
16
16
  end
17
17
 
@@ -77,34 +77,34 @@ describe file('/tmp/never_exist2') do
77
77
  it { should_not be_file }
78
78
  end
79
79
 
80
- describe file('/tmp/http_request.html') do
80
+ describe file('/tmp/http_request.html'), unless: ENV["SKIP_HTTP_REQUEST_TEST"] == "true" do
81
81
  it { should be_file }
82
82
  its(:content) { should match(/"from":\s*"itamae"/) }
83
83
  end
84
84
 
85
- describe file('/tmp/http_request_delete.html') do
85
+ describe file('/tmp/http_request_delete.html'), unless: ENV["SKIP_HTTP_REQUEST_TEST"] == "true" do
86
86
  it { should be_file }
87
87
  its(:content) { should match(/"from":\s*"itamae"/) }
88
88
  end
89
89
 
90
- describe file('/tmp/http_request_post.html') do
90
+ describe file('/tmp/http_request_post.html'), unless: ENV["SKIP_HTTP_REQUEST_TEST"] == "true" do
91
91
  it { should be_file }
92
92
  its(:content) { should match(/"from":\s*"itamae"/) }
93
93
  its(:content) { should match(/"love":\s*"sushi"/) }
94
94
  end
95
95
 
96
- describe file('/tmp/http_request_put.html') do
96
+ describe file('/tmp/http_request_put.html'), unless: ENV["SKIP_HTTP_REQUEST_TEST"] == "true" do
97
97
  it { should be_file }
98
98
  its(:content) { should match(/"from":\s*"itamae"/) }
99
99
  its(:content) { should match(/"love":\s*"sushi"/) }
100
100
  end
101
101
 
102
- describe file('/tmp/http_request_headers.html') do
102
+ describe file('/tmp/http_request_headers.html'), unless: ENV["SKIP_HTTP_REQUEST_TEST"] == "true" do
103
103
  it { should be_file }
104
104
  its(:content) { should match(/"User-Agent":\s*"Itamae"/) }
105
105
  end
106
106
 
107
- xdescribe file('/tmp/http_request_redirect.html') do
107
+ xdescribe file('/tmp/http_request_redirect.html'), unless: ENV["SKIP_HTTP_REQUEST_TEST"] == "true" do
108
108
  it { should be_file }
109
109
  its(:content) { should match(/"from":\s*"itamae"/) }
110
110
  end
@@ -274,10 +274,12 @@ end
274
274
 
275
275
  describe file('/tmp/file_edit_with_content_change_updates_timestamp') do
276
276
  its(:mtime) { should be > DateTime.iso8601("2016-05-02T01:23:45Z") }
277
+ its(:content) { should eq "Hello, Itamae\n" }
277
278
  end
278
279
 
279
280
  describe file('/tmp/file_edit_without_content_change_keeping_timestamp') do
280
281
  its(:mtime) { should eq(DateTime.iso8601("2016-05-02T12:34:56Z")) }
282
+ its(:content) { should eq "" }
281
283
  end
282
284
 
283
285
  describe file('/home/itamae2') do
@@ -306,10 +308,12 @@ end
306
308
 
307
309
  describe file('/tmp/file_with_content_change_updates_timestamp') do
308
310
  its(:mtime) { should be > DateTime.iso8601("2016-05-01T01:23:45Z") }
311
+ its(:content) { should eq "Hello, world" }
309
312
  end
310
313
 
311
314
  describe file('/tmp/file_without_content_change_keeping_timestamp') do
312
315
  its(:mtime) { should eq(DateTime.iso8601("2016-05-01T12:34:56Z")) }
316
+ its(:content) { should eq "Hello, world\n" }
313
317
  end
314
318
 
315
319
  describe file('/tmp/subscribed_from_parent') do
@@ -84,14 +84,14 @@ end
84
84
 
85
85
  ###
86
86
 
87
- describe file('/tmp/http_request.html') do
87
+ describe file('/tmp/http_request.html'), unless: ENV["SKIP_HTTP_REQUEST_TEST"] == "true" do
88
88
  it { should be_file }
89
89
  it { should be_owned_by "ordinary_san" }
90
90
  it { should be_grouped_into "ordinary_san" }
91
91
  its(:content) { should match(/"from":\s*"itamae"/) }
92
92
  end
93
93
 
94
- describe file('/tmp/http_request_root.html') do
94
+ describe file('/tmp/http_request_root.html'), unless: ENV["SKIP_HTTP_REQUEST_TEST"] == "true" do
95
95
  it { should be_file }
96
96
  it { should be_owned_by "root" }
97
97
  it { should be_grouped_into "root" }
@@ -99,7 +99,7 @@ describe file('/tmp/http_request_root.html') do
99
99
  end
100
100
 
101
101
  %w[/tmp/http_request_another_ordinary.html /tmp/http_request_another_ordinary_with_root.html].each do |path|
102
- describe file(path) do
102
+ describe file(path), unless: ENV["SKIP_HTTP_REQUEST_TEST"] == "true" do
103
103
  it { should be_file }
104
104
  it { should be_owned_by "itamae" }
105
105
  it { should be_grouped_into "itamae" }
@@ -41,7 +41,7 @@ end
41
41
 
42
42
  ######
43
43
 
44
- package 'dstat' do
44
+ package 'jq' do
45
45
  action :install
46
46
  end
47
47
 
@@ -55,35 +55,43 @@ package "ruby"
55
55
 
56
56
  gem_package 'tzinfo' do
57
57
  version '1.1.0'
58
+ cwd '/tmp'
58
59
  end
59
60
 
60
61
  gem_package 'tzinfo' do
61
62
  version '1.2.2'
63
+ cwd '/tmp'
62
64
  end
63
65
 
64
66
  gem_package 'rake' do
65
67
  version '11.1.0'
68
+ cwd '/tmp'
66
69
  end
67
70
 
68
71
  gem_package 'rake' do
69
72
  version '11.2.2'
73
+ cwd '/tmp'
70
74
  end
71
75
 
72
76
  gem_package 'rake' do
73
77
  action :uninstall
74
78
  version '11.2.2'
79
+ cwd '/tmp'
75
80
  end
76
81
 
77
82
  gem_package 'test-unit' do
78
83
  version '2.5.5'
84
+ cwd '/tmp'
79
85
  end
80
86
 
81
87
  gem_package 'test-unit' do
82
88
  version '2.4.9'
89
+ cwd '/tmp'
83
90
  end
84
91
 
85
92
  gem_package 'test-unit' do
86
93
  action :uninstall
94
+ cwd '/tmp'
87
95
  end
88
96
 
89
97
  ######
@@ -184,36 +192,38 @@ end
184
192
 
185
193
  ######
186
194
 
187
- http_request "/tmp/http_request.html" do
188
- url "https://httpbin.org/get?from=itamae"
189
- end
195
+ unless ENV["SKIP_HTTP_REQUEST_TEST"] == "true"
196
+ http_request "/tmp/http_request.html" do
197
+ url "https://httpbin.org/get?from=itamae"
198
+ end
190
199
 
191
- http_request "/tmp/http_request_delete.html" do
192
- action :delete
193
- url "https://httpbin.org/delete?from=itamae"
194
- end
200
+ http_request "/tmp/http_request_delete.html" do
201
+ action :delete
202
+ url "https://httpbin.org/delete?from=itamae"
203
+ end
195
204
 
196
- http_request "/tmp/http_request_post.html" do
197
- action :post
198
- message "love=sushi"
199
- url "https://httpbin.org/post?from=itamae"
200
- end
205
+ http_request "/tmp/http_request_post.html" do
206
+ action :post
207
+ message "love=sushi"
208
+ url "https://httpbin.org/post?from=itamae"
209
+ end
201
210
 
202
- http_request "/tmp/http_request_put.html" do
203
- action :put
204
- message "love=sushi"
205
- url "https://httpbin.org/put?from=itamae"
206
- end
211
+ http_request "/tmp/http_request_put.html" do
212
+ action :put
213
+ message "love=sushi"
214
+ url "https://httpbin.org/put?from=itamae"
215
+ end
207
216
 
208
- http_request "/tmp/http_request_headers.html" do
209
- headers "User-Agent" => "Itamae"
210
- url "https://httpbin.org/get"
211
- end
217
+ http_request "/tmp/http_request_headers.html" do
218
+ headers "User-Agent" => "Itamae"
219
+ url "https://httpbin.org/get"
220
+ end
212
221
 
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
222
+ # http_request "/tmp/http_request_redirect.html" do
223
+ # redirect_limit 1
224
+ # url "https://httpbin.org/redirect-to?url=https%3A%2F%2Fhttpbin.org%2Fget%3Ffrom%3Ditamae"
225
+ # end
226
+ end
217
227
 
218
228
  link "/tmp-link" do
219
229
  to "/tmp"
@@ -7,6 +7,7 @@ end
7
7
  gem_package 'ast' do
8
8
  version '2.0.0'
9
9
  options ['--no-ri', '--no-rdoc']
10
+ cwd '/tmp'
10
11
  end
11
12
 
12
13
  ######
@@ -5,6 +5,7 @@ package 'sl'
5
5
  gem_package 'ast' do
6
6
  version '2.0.0'
7
7
  options ['--no-document']
8
+ cwd '/tmp'
8
9
  end
9
10
 
10
11
  ######
@@ -83,27 +83,29 @@ end
83
83
 
84
84
  ###
85
85
 
86
- http_request "/tmp/http_request.html" do
87
- url "https://httpbin.org/get?from=itamae"
88
- end
89
-
90
- http_request "/tmp/http_request_root.html" do
91
- user 'root'
92
- owner 'root'
93
- group 'root'
94
- url "https://httpbin.org/get?from=itamae"
95
- end
96
-
97
- http_request "/tmp/http_request_another_ordinary.html" do
98
- user 'itamae'
99
- owner 'itamae'
100
- group 'itamae'
101
- url "https://httpbin.org/get?from=itamae"
102
- end
103
-
104
- http_request "/tmp/http_request_another_ordinary_with_root.html" do
105
- user 'root'
106
- owner 'itamae'
107
- group 'itamae'
108
- url "https://httpbin.org/get?from=itamae"
86
+ unless ENV["SKIP_HTTP_REQUEST_TEST"] == "true"
87
+ http_request "/tmp/http_request.html" do
88
+ url "https://httpbin.org/get?from=itamae"
89
+ end
90
+
91
+ http_request "/tmp/http_request_root.html" do
92
+ user 'root'
93
+ owner 'root'
94
+ group 'root'
95
+ url "https://httpbin.org/get?from=itamae"
96
+ end
97
+
98
+ http_request "/tmp/http_request_another_ordinary.html" do
99
+ user 'itamae'
100
+ owner 'itamae'
101
+ group 'itamae'
102
+ url "https://httpbin.org/get?from=itamae"
103
+ end
104
+
105
+ http_request "/tmp/http_request_another_ordinary_with_root.html" do
106
+ user 'root'
107
+ owner 'itamae'
108
+ group 'itamae'
109
+ url "https://httpbin.org/get?from=itamae"
110
+ end
109
111
  end
@@ -78,11 +78,14 @@ class IntegrationLocalSpecRunner
78
78
 
79
79
  def docker_run
80
80
  mount_dir = Pathname(__dir__).join('../').to_s
81
- sh 'docker', 'run', '--privileged', '-d', '--name', CONTAINER_NAME, '-v', "#{mount_dir}:/itamae", "ruby:#{@ruby_version}", 'sleep', '1d'
81
+ sh 'docker', 'run', '--env', 'SKIP_HTTP_REQUEST_TEST', '--privileged', '-d', '--name', CONTAINER_NAME, '-v', "#{mount_dir}:/itamae", "ruby:#{@ruby_version}", 'sleep', '1d'
82
82
  end
83
83
 
84
84
  def prepare
85
- docker_exec 'gem', 'install', 'bundler'
85
+ # Install the same version of bundler into the Docker container as is installed locally
86
+ current_bundler_version = /([0-9.]+)/.match(`bundle -v`).captures[0]
87
+ docker_exec 'gem', 'install', 'bundler', '-v', current_bundler_version
88
+
86
89
  docker_exec 'bundle', 'install', options: %w[--workdir /itamae]
87
90
  docker_exec 'apt-get', 'update', '-y'
88
91
  docker_exec 'apt-get', 'install', 'locales', 'sudo', '-y'
@@ -112,6 +115,6 @@ class IntegrationLocalSpecRunner
112
115
  end
113
116
 
114
117
  def docker_exec(*cmd, options: [])
115
- sh 'docker', 'exec', '--env', 'LANG=en_US.utf8', *options, CONTAINER_NAME, *cmd
118
+ sh 'docker', 'exec', '--env', 'LANG=en_US.utf8', '--env', 'SKIP_HTTP_REQUEST_TEST', *options, CONTAINER_NAME, *cmd
116
119
  end
117
120
  end
metadata CHANGED
@@ -1,16 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: itamae
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.14.1
4
+ version: 1.14.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryota Arai
8
8
  - Yusuke Nakamura
9
9
  - sue445
10
- autorequire:
11
10
  bindir: bin
12
11
  cert_chain: []
13
- date: 2022-07-10 00:00:00.000000000 Z
12
+ date: 1980-01-02 00:00:00.000000000 Z
14
13
  dependencies:
15
14
  - !ruby/object:Gem::Dependency
16
15
  name: thor
@@ -200,7 +199,6 @@ dependencies:
200
199
  - - ">="
201
200
  - !ruby/object:Gem::Version
202
201
  version: '0'
203
- description:
204
202
  email:
205
203
  - ryota.arai@gmail.com
206
204
  - yusuke1994525@gmail.com
@@ -210,7 +208,10 @@ executables:
210
208
  extensions: []
211
209
  extra_rdoc_files: []
212
210
  files:
211
+ - ".github/dependabot.yml"
212
+ - ".github/workflows/release.yml"
213
213
  - ".github/workflows/test.yml"
214
+ - ".github/workflows/test_main.yml"
214
215
  - ".gitignore"
215
216
  - ".rspec"
216
217
  - CHANGELOG.md
@@ -317,7 +318,6 @@ metadata:
317
318
  source_code_uri: https://github.com/itamae-kitchen/itamae
318
319
  changelog_uri: https://github.com/itamae-kitchen/itamae/blob/master/CHANGELOG.md
319
320
  rubygems_mfa_required: 'true'
320
- post_install_message:
321
321
  rdoc_options: []
322
322
  require_paths:
323
323
  - lib
@@ -332,8 +332,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
332
332
  - !ruby/object:Gem::Version
333
333
  version: '0'
334
334
  requirements: []
335
- rubygems_version: 3.2.3
336
- signing_key:
335
+ rubygems_version: 3.6.7
337
336
  specification_version: 4
338
337
  summary: Simple Configuration Management Tool
339
338
  test_files: