shipit-engine 0.42.1 → 0.43.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 +4 -4
- data/app/models/shipit/deploy_spec/bundler_discovery.rb +23 -7
- data/lib/shipit/commands.rb +1 -1
- data/lib/shipit/version.rb +1 -1
- data/lib/shipit.rb +6 -1
- data/test/dummy/config/environments/development.rb +3 -0
- data/test/dummy/config/environments/production.rb +3 -0
- data/test/dummy/config/environments/test.rb +3 -0
- data/test/dummy/db/seeds.rb +1 -1
- data/test/models/deploy_spec_test.rb +13 -12
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 4668d1d19acaaf623140622b9ba8af706517fdebd604ac771febe732633d7628
|
|
4
|
+
data.tar.gz: fc00a1faaffe66d8f995d3fae986425ccfe9fd617065008efde11c6139eb37ac
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b323de68a8865b1d69e1063982996aaf35335efb947a5a819c975fd52d5b31f019c3bff18b472df503e6c7d0c77cca80a54eaa50c01619b598360b9e678a87f0
|
|
7
|
+
data.tar.gz: 63dc20636c196f4f2ed05511f8bdd4540ed074c55bfa3997c6397a0408adc64a55992959d171cde55b57be4835263d932f08be6b2747c945314561e0f4efaac3
|
|
@@ -26,9 +26,18 @@ module Shipit
|
|
|
26
26
|
end
|
|
27
27
|
|
|
28
28
|
def bundle_install
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
install_command = %(bundle install --jobs 4 --retry 2)
|
|
30
|
+
[
|
|
31
|
+
remove_ruby_version_from_gemfile,
|
|
32
|
+
(bundle_config_frozen if frozen_mode?),
|
|
33
|
+
bundle_config_path,
|
|
34
|
+
(bundle_without_groups unless bundler_without.empty?),
|
|
35
|
+
install_command
|
|
36
|
+
].compact
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
def bundle_config_path
|
|
40
|
+
"bundle config set --local path #{bundle_path}"
|
|
32
41
|
end
|
|
33
42
|
|
|
34
43
|
def remove_ruby_version_from_gemfile
|
|
@@ -41,11 +50,18 @@ module Shipit
|
|
|
41
50
|
end
|
|
42
51
|
end
|
|
43
52
|
|
|
44
|
-
def
|
|
45
|
-
|
|
46
|
-
|
|
53
|
+
def bundle_config_frozen
|
|
54
|
+
'bundle config set --local frozen true'
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
def bundle_without_groups
|
|
58
|
+
"bundle config set without '#{bundler_without.join(':')}'"
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
def frozen_mode?
|
|
62
|
+
return false unless gemfile_lock_exists?
|
|
47
63
|
|
|
48
|
-
'
|
|
64
|
+
config('dependencies', 'bundler', 'frozen') != false
|
|
49
65
|
end
|
|
50
66
|
|
|
51
67
|
def bundler_without
|
data/lib/shipit/commands.rb
CHANGED
data/lib/shipit/version.rb
CHANGED
data/lib/shipit.rb
CHANGED
|
@@ -71,7 +71,8 @@ module Shipit
|
|
|
71
71
|
:internal_hook_receivers,
|
|
72
72
|
:preferred_org_emails,
|
|
73
73
|
:task_execution_strategy,
|
|
74
|
-
:task_logger
|
|
74
|
+
:task_logger,
|
|
75
|
+
:use_git_askpass
|
|
75
76
|
)
|
|
76
77
|
|
|
77
78
|
def task_execution_strategy
|
|
@@ -297,6 +298,10 @@ module Shipit
|
|
|
297
298
|
@task_logger ||= Logger.new(nil)
|
|
298
299
|
end
|
|
299
300
|
|
|
301
|
+
def use_git_askpass?
|
|
302
|
+
@use_git_askpass.nil? ? true : @use_git_askpass
|
|
303
|
+
end
|
|
304
|
+
|
|
300
305
|
protected
|
|
301
306
|
|
|
302
307
|
def revision_file
|
|
@@ -48,6 +48,9 @@ Rails.application.configure do
|
|
|
48
48
|
# Raises helpful error messages.
|
|
49
49
|
config.assets.raise_runtime_errors = true
|
|
50
50
|
|
|
51
|
+
# Disable git askpass in development
|
|
52
|
+
Shipit.use_git_askpass = false
|
|
53
|
+
|
|
51
54
|
# Raises error for missing translations
|
|
52
55
|
# config.action_view.raise_on_missing_translations = true
|
|
53
56
|
if Rails.application.config_for(:database)&.dig('adapter') == 'sqlite3'
|
|
@@ -32,6 +32,9 @@ Rails.application.configure do
|
|
|
32
32
|
# Print deprecation notices to the stderr.
|
|
33
33
|
config.active_support.deprecation = :stderr
|
|
34
34
|
|
|
35
|
+
# Disable git askpass in test
|
|
36
|
+
Shipit.use_git_askpass = false
|
|
37
|
+
|
|
35
38
|
# Raises error for missing translations
|
|
36
39
|
# config.action_view.raise_on_missing_translations = true
|
|
37
40
|
|
data/test/dummy/db/seeds.rb
CHANGED
|
@@ -53,7 +53,7 @@ module Shipit
|
|
|
53
53
|
]
|
|
54
54
|
},
|
|
55
55
|
"override": [
|
|
56
|
-
"bundle
|
|
56
|
+
"bundle config set path /tmp/bundler && (bundle check || bundle config set without 'default:production:development:test:staging:benchmark:debug' || bundle install --frozen --retry=2)"
|
|
57
57
|
]
|
|
58
58
|
},
|
|
59
59
|
"fetch": [
|
|
@@ -67,13 +67,15 @@ module Shipit
|
|
|
67
67
|
@spec.stubs(:gemfile_lock_exists?).returns(true)
|
|
68
68
|
command = %(
|
|
69
69
|
bundle install
|
|
70
|
-
--frozen
|
|
71
70
|
--jobs 4
|
|
72
|
-
--path #{DeploySpec.bundle_path}
|
|
73
71
|
--retry 2
|
|
74
|
-
--without=default:production:development:test:staging:benchmark:debug
|
|
75
72
|
).gsub(/\s+/, ' ').strip
|
|
73
|
+
config_command = "bundle config set --local path #{@spec.bundle_path}"
|
|
74
|
+
without_command = "bundle config set without 'default:production:development:test:staging:benchmark:debug'"
|
|
75
|
+
|
|
76
76
|
assert_equal command, @spec.bundle_install.last
|
|
77
|
+
assert @spec.bundle_install.include?(config_command)
|
|
78
|
+
assert @spec.bundle_install.include?(without_command)
|
|
77
79
|
end
|
|
78
80
|
|
|
79
81
|
test '#bundle_install use `dependencies.bundler.without` if present to build the --without argument' do
|
|
@@ -81,31 +83,30 @@ module Shipit
|
|
|
81
83
|
@spec.stubs(:load_config).returns('dependencies' => { 'bundler' => { 'without' => %w[some custom groups] } })
|
|
82
84
|
command = %(
|
|
83
85
|
bundle install
|
|
84
|
-
--frozen
|
|
85
86
|
--jobs 4
|
|
86
|
-
--path #{DeploySpec.bundle_path}
|
|
87
87
|
--retry 2
|
|
88
|
-
--without=some:custom:groups
|
|
89
88
|
).gsub(/\s+/, ' ').strip
|
|
90
89
|
assert_equal command, @spec.bundle_install.last
|
|
90
|
+
without_command = "bundle config set without 'some:custom:groups'"
|
|
91
|
+
assert @spec.bundle_install.include?(without_command)
|
|
91
92
|
end
|
|
92
93
|
|
|
93
|
-
test '#bundle_install
|
|
94
|
+
test '#bundle_install configures frozen mode if Gemfile.lock is present' do
|
|
94
95
|
@spec.stubs(:load_config).returns('dependencies' => { 'bundler' => { 'without' => %w[some custom groups] } })
|
|
95
96
|
@spec.stubs(:gemfile_lock_exists?).returns(true)
|
|
96
|
-
assert @spec.bundle_install.
|
|
97
|
+
assert @spec.bundle_install.include?('bundle config set --local frozen true')
|
|
97
98
|
end
|
|
98
99
|
|
|
99
|
-
test '#bundle_install does not
|
|
100
|
+
test '#bundle_install does not configure frozen mode if Gemfile.lock is not present' do
|
|
100
101
|
@spec.stubs(:load_config).returns('dependencies' => { 'bundler' => { 'without' => %w[some custom groups] } })
|
|
101
102
|
@spec.stubs(:gemfile_lock_exists?).returns(false)
|
|
102
|
-
refute @spec.bundle_install.
|
|
103
|
+
refute @spec.bundle_install.include?('bundle config set --local frozen true')
|
|
103
104
|
end
|
|
104
105
|
|
|
105
|
-
test '#bundle_install does not
|
|
106
|
+
test '#bundle_install does not configure frozen mode if overridden in shipit.yml' do
|
|
106
107
|
@spec.stubs(:load_config).returns('dependencies' => { 'bundler' => { 'frozen' => false } })
|
|
107
108
|
@spec.stubs(:gemfile_lock_exists?).returns(true)
|
|
108
|
-
refute @spec.bundle_install.
|
|
109
|
+
refute @spec.bundle_install.include?('bundle config set --local frozen true')
|
|
109
110
|
end
|
|
110
111
|
|
|
111
112
|
test "#provisioning_handler returns `provision.handler` if present" do
|