redmine-installer 2.3.2 → 2.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/redmine-installer/cli.rb +2 -2
- data/lib/redmine-installer/redmine.rb +12 -1
- data/lib/redmine-installer/version.rb +3 -1
- data/lib/redmine-installer.rb +1 -1
- data/redmine-installer.gemspec +8 -6
- data/spec/installer_process.rb +18 -18
- data/spec/lib/backup_restore_spec.rb +1 -1
- data/spec/lib/install_spec.rb +7 -7
- data/spec/lib/upgrade_spec.rb +9 -8
- data/spec/packages_helper.rb +4 -0
- data/spec/spec_helper.rb +2 -2
- metadata +52 -24
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0605dd69a69945ad4065c6164ff8fe5b05c33f6e9b9a3d7b75feeef331691419
|
4
|
+
data.tar.gz: c1291030bdfbc4c29cd43f84befbb3a886bbdfe224ae24d8bd995f0190e4a79f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 82a79260f974fba17dd2db7d972c5d9acb48614873226beb8a8479e058238eb7325982719c6739ebc221aefc38251dde0e3936ec0ba3fd997c1ae78c84e3de47
|
7
|
+
data.tar.gz: 4176792027d34272b2c365c797d112ddeb0b9c6438b3bcbdf3524ccbae6416bfbd03e7e279088173b8c2d425ef6b91c7a219696a029419b506a79f43c27fe1ab
|
data/CHANGELOG.md
CHANGED
@@ -48,7 +48,7 @@ module RedmineInstaller
|
|
48
48
|
c.action do |args, options|
|
49
49
|
options.default(enable_user_root: false)
|
50
50
|
|
51
|
-
RedmineInstaller::Install.new(args[0], args[1], options.__hash__).run
|
51
|
+
RedmineInstaller::Install.new(args[0], args[1], **options.__hash__).run
|
52
52
|
end
|
53
53
|
end
|
54
54
|
alias_command :i, :install
|
@@ -77,7 +77,7 @@ module RedmineInstaller
|
|
77
77
|
c.action do |args, options|
|
78
78
|
options.default(enable_user_root: false, copy_files_with_symlink: false)
|
79
79
|
|
80
|
-
RedmineInstaller::Upgrade.new(args[0], args[1], options.__hash__).run
|
80
|
+
RedmineInstaller::Upgrade.new(args[0], args[1], **options.__hash__).run
|
81
81
|
end
|
82
82
|
end
|
83
83
|
alias_command :u, :upgrade
|
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'find'
|
2
|
+
require 'io/console'
|
2
3
|
|
3
4
|
module RedmineInstaller
|
4
5
|
class Redmine < TaskModule
|
@@ -279,7 +280,17 @@ module RedmineInstaller
|
|
279
280
|
next if entry == '.' || entry == '..'
|
280
281
|
next if entry == FILES_DIR && task.options.copy_files_with_symlink
|
281
282
|
|
282
|
-
|
283
|
+
begin
|
284
|
+
FileUtils.remove_entry_secure(entry)
|
285
|
+
rescue
|
286
|
+
if task.options.copy_files_with_symlink
|
287
|
+
print_title('Cannot automatically empty ' + root + '. Please manually empty this directory (except for ' + root + '/' + FILES_DIR + ') and then hit any key to continue...')
|
288
|
+
else
|
289
|
+
print_title('Cannot automatically empty ' + root + '. Please manually empty this directory and then hit any key to continue...')
|
290
|
+
end
|
291
|
+
STDIN.getch
|
292
|
+
break
|
293
|
+
end
|
283
294
|
end
|
284
295
|
end
|
285
296
|
|
data/lib/redmine-installer.rb
CHANGED
data/redmine-installer.gemspec
CHANGED
@@ -16,22 +16,24 @@ Gem::Specification.new do |spec|
|
|
16
16
|
spec.license = 'MIT'
|
17
17
|
|
18
18
|
files = `git ls-files -z`.split("\x0")
|
19
|
-
files.delete_if {|f| f.start_with?('spec/packages/') }
|
19
|
+
files.delete_if { |f| f.start_with?('spec/packages/') }
|
20
20
|
|
21
21
|
spec.files = files
|
22
22
|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
23
23
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
24
24
|
spec.require_paths = ['lib']
|
25
25
|
|
26
|
-
spec.required_ruby_version = '
|
26
|
+
spec.required_ruby_version = '3.1.2'
|
27
27
|
|
28
|
+
spec.add_runtime_dependency 'bundler', '>= 1.16'
|
28
29
|
spec.add_runtime_dependency 'commander'
|
30
|
+
spec.add_runtime_dependency 'pastel', '~> 0.8.0'
|
29
31
|
spec.add_runtime_dependency 'rubyzip'
|
30
|
-
spec.add_runtime_dependency '
|
31
|
-
spec.add_runtime_dependency '
|
32
|
-
spec.add_runtime_dependency 'tty-prompt', '~> 0.16.1'
|
32
|
+
spec.add_runtime_dependency 'tty-progressbar', '~> 0.18.2'
|
33
|
+
spec.add_runtime_dependency 'tty-prompt', '~> 0.23.1'
|
33
34
|
spec.add_runtime_dependency 'tty-spinner', '~> 0.8.0'
|
34
|
-
spec.add_runtime_dependency 'tty-progressbar', '~> 0.15.0'
|
35
35
|
|
36
|
+
spec.add_development_dependency 'childprocess', '~> 4.1.0'
|
36
37
|
spec.add_development_dependency 'rake'
|
38
|
+
spec.add_development_dependency 'rspec', '~> 3.11.0'
|
37
39
|
end
|
data/spec/installer_process.rb
CHANGED
@@ -39,7 +39,7 @@ class InstallerProcess
|
|
39
39
|
end
|
40
40
|
|
41
41
|
def run
|
42
|
-
Bundler.
|
42
|
+
Bundler.with_unbundled_env {
|
43
43
|
start
|
44
44
|
yield
|
45
45
|
}
|
@@ -67,28 +67,28 @@ class InstallerProcess
|
|
67
67
|
# @process.io.stdin.write_nonblock(text + "\n")
|
68
68
|
end
|
69
69
|
|
70
|
-
def get(
|
71
|
-
@last_get_return = _get(
|
70
|
+
def get(text, **args)
|
71
|
+
@last_get_return = _get(text, **args)
|
72
72
|
end
|
73
73
|
|
74
74
|
private
|
75
75
|
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
end
|
76
|
+
# max_wait in s
|
77
|
+
def _get(text, max_wait: 10)
|
78
|
+
wait_to = Time.now + max_wait
|
79
|
+
while Time.now < wait_to
|
80
|
+
@buffer << @stdout.read
|
81
|
+
index = @buffer.rindex(text)
|
82
|
+
|
83
|
+
if index
|
84
|
+
break
|
85
|
+
# return @buffer.slice!(0, index+text.size)
|
86
|
+
else
|
87
|
+
sleep 0.5
|
89
88
|
end
|
90
|
-
|
91
|
-
@buffer
|
92
89
|
end
|
93
90
|
|
91
|
+
@buffer
|
92
|
+
end
|
93
|
+
|
94
94
|
end
|
@@ -57,7 +57,7 @@ RSpec.describe 'RedmineInstaller backup / restore', order: :defined do
|
|
57
57
|
FileUtils.cp(dump, DATABASE_DUMP)
|
58
58
|
end
|
59
59
|
|
60
|
-
it 'restore', command: 'install', args: [
|
60
|
+
it 'restore', command: 'install', args: [package_v503, '--database-dump', DATABASE_DUMP] do
|
61
61
|
expected_output('Path to redmine root:')
|
62
62
|
write(@redmine_root)
|
63
63
|
|
data/spec/lib/install_spec.rb
CHANGED
@@ -55,28 +55,28 @@ RSpec.describe RedmineInstaller::Install, command: 'install' do
|
|
55
55
|
write(@redmine_root)
|
56
56
|
|
57
57
|
expected_output('Path to package:')
|
58
|
-
write(
|
58
|
+
write(package_v503)
|
59
59
|
|
60
60
|
expected_output('Extracting redmine package')
|
61
61
|
|
62
62
|
expected_successful_configuration(email: true)
|
63
63
|
expected_successful_installation
|
64
64
|
|
65
|
-
expected_redmine_version('
|
65
|
+
expected_redmine_version('5.0.3')
|
66
66
|
expected_email_configuration
|
67
67
|
end
|
68
68
|
|
69
|
-
it 'download redmine', args: ['
|
69
|
+
it 'download redmine', args: ['v5.0.3'] do
|
70
70
|
expected_output('Path to redmine root:')
|
71
71
|
write(@redmine_root)
|
72
72
|
|
73
|
-
expected_output_in('Downloading
|
73
|
+
expected_output_in('Downloading https://www.redmine.org/releases/redmine-5.0.3.zip', 30)
|
74
74
|
expected_output('Extracting redmine package')
|
75
75
|
|
76
76
|
expected_successful_configuration
|
77
77
|
expected_successful_installation
|
78
78
|
|
79
|
-
expected_redmine_version('
|
79
|
+
expected_redmine_version('5.0.3')
|
80
80
|
end
|
81
81
|
|
82
82
|
it 'installing something else', args: [package_someting_else] do
|
@@ -85,7 +85,7 @@ RSpec.describe RedmineInstaller::Install, command: 'install' do
|
|
85
85
|
expected_output('is not valid')
|
86
86
|
end
|
87
87
|
|
88
|
-
it 'bad database settings', args: [
|
88
|
+
it 'bad database settings', args: [package_v503] do
|
89
89
|
write(@redmine_root)
|
90
90
|
|
91
91
|
expected_output('Creating database configuration')
|
@@ -129,7 +129,7 @@ RSpec.describe RedmineInstaller::Install, command: 'install' do
|
|
129
129
|
expected_output('--> Database migrating')
|
130
130
|
expected_output_in('Redmine was installed', 60)
|
131
131
|
|
132
|
-
expected_redmine_version('
|
132
|
+
expected_redmine_version('5.0.3')
|
133
133
|
end
|
134
134
|
|
135
135
|
it 'high installer version', args: [package_high_installer_version] do
|
data/spec/lib/upgrade_spec.rb
CHANGED
@@ -26,7 +26,7 @@ RSpec.describe RedmineInstaller::Upgrade, :install_first, command: 'upgrade' do
|
|
26
26
|
write(@redmine_root)
|
27
27
|
|
28
28
|
expected_output('Path to package:')
|
29
|
-
write(
|
29
|
+
write(package_v503)
|
30
30
|
|
31
31
|
expected_output('Extracting redmine package')
|
32
32
|
expected_output('Data backup')
|
@@ -44,7 +44,7 @@ RSpec.describe RedmineInstaller::Upgrade, :install_first, command: 'upgrade' do
|
|
44
44
|
|
45
45
|
expected_successful_upgrade
|
46
46
|
|
47
|
-
expected_redmine_version('
|
47
|
+
expected_redmine_version('5.0.3')
|
48
48
|
|
49
49
|
expect(File.exist?(test_test_file)).to be_falsey
|
50
50
|
|
@@ -66,7 +66,7 @@ RSpec.describe RedmineInstaller::Upgrade, :install_first, command: 'upgrade' do
|
|
66
66
|
write(@redmine_root)
|
67
67
|
|
68
68
|
wait_for_stdin_buffer
|
69
|
-
write(
|
69
|
+
write(package_v503)
|
70
70
|
|
71
71
|
wait_for_stdin_buffer
|
72
72
|
|
@@ -80,7 +80,7 @@ RSpec.describe RedmineInstaller::Upgrade, :install_first, command: 'upgrade' do
|
|
80
80
|
|
81
81
|
expected_successful_upgrade
|
82
82
|
|
83
|
-
expected_redmine_version('
|
83
|
+
expected_redmine_version('5.0.3')
|
84
84
|
|
85
85
|
expect(File.exist?(test_test_file)).to be_truthy
|
86
86
|
end
|
@@ -94,7 +94,7 @@ RSpec.describe RedmineInstaller::Upgrade, :install_first, command: 'upgrade' do
|
|
94
94
|
write(@redmine_root)
|
95
95
|
|
96
96
|
wait_for_stdin_buffer
|
97
|
-
write(
|
97
|
+
write(package_v503)
|
98
98
|
|
99
99
|
wait_for_stdin_buffer
|
100
100
|
|
@@ -108,13 +108,14 @@ RSpec.describe RedmineInstaller::Upgrade, :install_first, command: 'upgrade' do
|
|
108
108
|
|
109
109
|
expected_successful_upgrade
|
110
110
|
|
111
|
-
expected_redmine_version('
|
111
|
+
expected_redmine_version('5.0.3')
|
112
112
|
|
113
113
|
# Not bullet-prof but at least check if files are still there
|
114
114
|
expect(Dir.glob(File.join(files_dir, '*.txt')).sort).to eq(files.sort)
|
115
115
|
end
|
116
116
|
|
117
117
|
it 'upgrade rys and modify bundle/index' do
|
118
|
+
skip 'old version not supporting Ruby >3'
|
118
119
|
wait_for_stdin_buffer
|
119
120
|
write(@redmine_root)
|
120
121
|
|
@@ -171,7 +172,7 @@ RSpec.describe RedmineInstaller::Upgrade, :install_first, command: 'upgrade' do
|
|
171
172
|
write(@redmine_root)
|
172
173
|
|
173
174
|
wait_for_stdin_buffer
|
174
|
-
write(
|
175
|
+
write(package_v503)
|
175
176
|
|
176
177
|
go_down
|
177
178
|
go_down
|
@@ -183,7 +184,7 @@ RSpec.describe RedmineInstaller::Upgrade, :install_first, command: 'upgrade' do
|
|
183
184
|
|
184
185
|
write(answer)
|
185
186
|
expected_successful_upgrade
|
186
|
-
expected_redmine_version('
|
187
|
+
expected_redmine_version('5.0.3')
|
187
188
|
|
188
189
|
expect(Dir.exist?(plugin_dir)).to be(result)
|
189
190
|
end
|
data/spec/packages_helper.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
@@ -30,12 +30,12 @@ RSpec.configure do |config|
|
|
30
30
|
|
31
31
|
config.before(:all, :install_first) do
|
32
32
|
@redmine_root = @origin_redmine = Dir.mktmpdir('redmine_root')
|
33
|
-
@process = InstallerProcess.new('install',
|
33
|
+
@process = InstallerProcess.new('install', package_v503, @origin_redmine)
|
34
34
|
@process.run do
|
35
35
|
expected_successful_configuration
|
36
36
|
expected_successful_installation
|
37
37
|
|
38
|
-
expected_redmine_version('
|
38
|
+
expected_redmine_version('5.0.3')
|
39
39
|
end
|
40
40
|
@backup_dir = Dir.mktmpdir('backup_dir')
|
41
41
|
end
|
metadata
CHANGED
@@ -1,31 +1,31 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: redmine-installer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ondřej Moravčík
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-12-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: bundler
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '1.16'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '1.16'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: commander
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - ">="
|
@@ -39,47 +39,61 @@ dependencies:
|
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
42
|
+
name: pastel
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 0.8.0
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 0.8.0
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rubyzip
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|
44
58
|
requirements:
|
45
59
|
- - ">="
|
46
60
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
61
|
+
version: '0'
|
48
62
|
type: :runtime
|
49
63
|
prerelease: false
|
50
64
|
version_requirements: !ruby/object:Gem::Requirement
|
51
65
|
requirements:
|
52
66
|
- - ">="
|
53
67
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
68
|
+
version: '0'
|
55
69
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
70
|
+
name: tty-progressbar
|
57
71
|
requirement: !ruby/object:Gem::Requirement
|
58
72
|
requirements:
|
59
73
|
- - "~>"
|
60
74
|
- !ruby/object:Gem::Version
|
61
|
-
version: 0.
|
75
|
+
version: 0.18.2
|
62
76
|
type: :runtime
|
63
77
|
prerelease: false
|
64
78
|
version_requirements: !ruby/object:Gem::Requirement
|
65
79
|
requirements:
|
66
80
|
- - "~>"
|
67
81
|
- !ruby/object:Gem::Version
|
68
|
-
version: 0.
|
82
|
+
version: 0.18.2
|
69
83
|
- !ruby/object:Gem::Dependency
|
70
84
|
name: tty-prompt
|
71
85
|
requirement: !ruby/object:Gem::Requirement
|
72
86
|
requirements:
|
73
87
|
- - "~>"
|
74
88
|
- !ruby/object:Gem::Version
|
75
|
-
version: 0.
|
89
|
+
version: 0.23.1
|
76
90
|
type: :runtime
|
77
91
|
prerelease: false
|
78
92
|
version_requirements: !ruby/object:Gem::Requirement
|
79
93
|
requirements:
|
80
94
|
- - "~>"
|
81
95
|
- !ruby/object:Gem::Version
|
82
|
-
version: 0.
|
96
|
+
version: 0.23.1
|
83
97
|
- !ruby/object:Gem::Dependency
|
84
98
|
name: tty-spinner
|
85
99
|
requirement: !ruby/object:Gem::Requirement
|
@@ -95,19 +109,19 @@ dependencies:
|
|
95
109
|
- !ruby/object:Gem::Version
|
96
110
|
version: 0.8.0
|
97
111
|
- !ruby/object:Gem::Dependency
|
98
|
-
name:
|
112
|
+
name: childprocess
|
99
113
|
requirement: !ruby/object:Gem::Requirement
|
100
114
|
requirements:
|
101
115
|
- - "~>"
|
102
116
|
- !ruby/object:Gem::Version
|
103
|
-
version:
|
104
|
-
type: :
|
117
|
+
version: 4.1.0
|
118
|
+
type: :development
|
105
119
|
prerelease: false
|
106
120
|
version_requirements: !ruby/object:Gem::Requirement
|
107
121
|
requirements:
|
108
122
|
- - "~>"
|
109
123
|
- !ruby/object:Gem::Version
|
110
|
-
version:
|
124
|
+
version: 4.1.0
|
111
125
|
- !ruby/object:Gem::Dependency
|
112
126
|
name: rake
|
113
127
|
requirement: !ruby/object:Gem::Requirement
|
@@ -122,6 +136,20 @@ dependencies:
|
|
122
136
|
- - ">="
|
123
137
|
- !ruby/object:Gem::Version
|
124
138
|
version: '0'
|
139
|
+
- !ruby/object:Gem::Dependency
|
140
|
+
name: rspec
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - "~>"
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: 3.11.0
|
146
|
+
type: :development
|
147
|
+
prerelease: false
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - "~>"
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: 3.11.0
|
125
153
|
description: ''
|
126
154
|
email:
|
127
155
|
- moravcik.ondrej@gmail.com
|
@@ -176,23 +204,23 @@ homepage: https://github.com/easyredmine/redmine-installer
|
|
176
204
|
licenses:
|
177
205
|
- MIT
|
178
206
|
metadata: {}
|
179
|
-
post_install_message:
|
207
|
+
post_install_message:
|
180
208
|
rdoc_options: []
|
181
209
|
require_paths:
|
182
210
|
- lib
|
183
211
|
required_ruby_version: !ruby/object:Gem::Requirement
|
184
212
|
requirements:
|
185
|
-
- -
|
213
|
+
- - '='
|
186
214
|
- !ruby/object:Gem::Version
|
187
|
-
version:
|
215
|
+
version: 3.1.2
|
188
216
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
189
217
|
requirements:
|
190
218
|
- - ">="
|
191
219
|
- !ruby/object:Gem::Version
|
192
220
|
version: '0'
|
193
221
|
requirements: []
|
194
|
-
rubygems_version: 3.
|
195
|
-
signing_key:
|
222
|
+
rubygems_version: 3.3.22
|
223
|
+
signing_key:
|
196
224
|
specification_version: 4
|
197
225
|
summary: Easy way how install/upgrade Redmine, EasyRedmine or EasyProject.
|
198
226
|
test_files:
|