redmine-installer 1.0.4 → 1.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +7 -56
- data/lib/redmine-installer.rb +5 -10
- data/lib/redmine-installer/install.rb +4 -9
- data/lib/redmine-installer/locales/en.yml +17 -11
- data/lib/redmine-installer/plugins/base.rb +2 -6
- data/lib/redmine-installer/plugins/redmine_plugin.rb +27 -0
- data/lib/redmine-installer/step.rb +1 -0
- data/lib/redmine-installer/steps/backup.rb +1 -1
- data/lib/redmine-installer/steps/base.rb +20 -1
- data/lib/redmine-installer/steps/env_check.rb +20 -0
- data/lib/redmine-installer/steps/load_package.rb +75 -29
- data/lib/redmine-installer/task.rb +14 -4
- data/lib/redmine-installer/upgrade.rb +2 -1
- data/lib/redmine-installer/utils.rb +9 -1
- data/lib/redmine-installer/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6952796bd301dde3ee7ca67d1c8f56d03b0df632
|
4
|
+
data.tar.gz: 7f70e35b172302737ef4309d31067d08c3d309ef
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fddebfbfe71cc4c9a26283ac5a8242762548130849a1654f330cfda56a7ca1524c95993658fdafadae68807542606519d69f464e68f2ff0279f7780de5a615fd
|
7
|
+
data.tar.gz: 5fa2b8a75e41b6c5cc71bd217c83c7a2f9ab2d7d05506b74e7b43bd01010164c60fc75e4623577d67d03b7677ee9e32ee0978dbd870be6528963747ef459221c
|
data/README.md
CHANGED
@@ -27,11 +27,16 @@ $ gem install redmine-installer
|
|
27
27
|
Simple install and ugrade
|
28
28
|
|
29
29
|
```
|
30
|
+
# From archive
|
30
31
|
$ wget http://www.redmine.org/releases/redmine-2.3.0.zip
|
31
32
|
$ wget http://www.redmine.org/releases/redmine-2.5.0.zip
|
32
33
|
|
33
34
|
$ redmine install redmine-2.3.0.zip
|
34
35
|
$ redmine upgrade redmine-2.5.0.zip
|
36
|
+
|
37
|
+
# From website
|
38
|
+
$ redmine install v2.3.0
|
39
|
+
$ redmine upgrade v2.5.0
|
35
40
|
```
|
36
41
|
|
37
42
|
Set languages
|
@@ -40,20 +45,6 @@ Set languages
|
|
40
45
|
$ redmine --locale cs install redmine-2.3.0.zip
|
41
46
|
```
|
42
47
|
|
43
|
-
Install from git
|
44
|
-
|
45
|
-
```
|
46
|
-
$ redmine install git@github.com:redmine/redmine.git --source git
|
47
|
-
$ redmine upgrade --source git
|
48
|
-
```
|
49
|
-
|
50
|
-
Install from git with specific branch
|
51
|
-
|
52
|
-
```
|
53
|
-
$ redmine install git@github.com:redmine/redmine.git --source git --branch 2.3-stable
|
54
|
-
$ redmine upgrade --source git
|
55
|
-
```
|
56
|
-
|
57
48
|
## Usage
|
58
49
|
|
59
50
|
```
|
@@ -134,7 +125,7 @@ b -> backup
|
|
134
125
|
|
135
126
|
## Install
|
136
127
|
|
137
|
-
Install new redmine instance from archive or
|
128
|
+
Install new redmine instance from archive or website.
|
138
129
|
|
139
130
|
#### Steps:
|
140
131
|
|
@@ -161,40 +152,9 @@ redmine install PATH_TO_PACKAGE
|
|
161
152
|
redmine install PATH_TO_PACKAGE --env environment
|
162
153
|
```
|
163
154
|
|
164
|
-
#### From git
|
165
|
-
|
166
|
-
```
|
167
|
-
redmine install GIT_REPO --source git
|
168
|
-
|
169
|
-
# with specific branch
|
170
|
-
redmine install GIT_REPO --source git --branch GIT_BRANCH --env environment
|
171
|
-
```
|
172
|
-
|
173
|
-
##### Arguments
|
174
|
-
|
175
|
-
<table>
|
176
|
-
<thead>
|
177
|
-
<tr>
|
178
|
-
<th>argument</th>
|
179
|
-
<th>default</th>
|
180
|
-
<th>description</th>
|
181
|
-
</tr>
|
182
|
-
</thead>
|
183
|
-
<tbody>
|
184
|
-
<tr>
|
185
|
-
<td>--branch / -b</td>
|
186
|
-
<td>master</td>
|
187
|
-
<td>
|
188
|
-
git branch
|
189
|
-
</td>
|
190
|
-
</tr>
|
191
|
-
</tbody>
|
192
|
-
</table>
|
193
|
-
|
194
|
-
|
195
155
|
## Upgrade
|
196
156
|
|
197
|
-
Upgrading existing instance of redmine with archive or defined
|
157
|
+
Upgrading existing instance of redmine with archive or defined version. If your redmine contain plugins which are not part of new package - all these plugins will be kept otherwise are replaced with those from package.
|
198
158
|
|
199
159
|
Final step will ask you if you want save steps configuration. If you say _YES_, configuration will be stored as profile so next time you can upgrade redmine faster.
|
200
160
|
|
@@ -227,15 +187,6 @@ redmine upgrade PATH_TO_PACKAGE
|
|
227
187
|
redmine upgrade PATH_TO_PACKAGE --env environment
|
228
188
|
```
|
229
189
|
|
230
|
-
#### From git
|
231
|
-
|
232
|
-
```
|
233
|
-
redmine upgrade --source git
|
234
|
-
|
235
|
-
# with environment
|
236
|
-
redmine upgrade --source git --env environment
|
237
|
-
```
|
238
|
-
|
239
190
|
### Easyproject
|
240
191
|
|
241
192
|
If you are using easyproject plugin and you dont want copy client modifications from old instance use switch `--skip-old-modifications`.
|
data/lib/redmine-installer.rb
CHANGED
@@ -37,16 +37,11 @@ module Redmine
|
|
37
37
|
|
38
38
|
def self.print_logo
|
39
39
|
$stdout.puts <<-PRINT
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
_ _ _ _
|
46
|
-
(_) _ __ ___ | |_ __ _ | || | ___ _ __
|
47
|
-
| || '_ \\ / __|| __|/ _` || || | / _ \\| '__|
|
48
|
-
| || | | |\\__ \\| |_| (_| || || || __/| |
|
49
|
-
|_||_| |_||___/ \\__|\\__,_||_||_| \\___||_|
|
40
|
+
__ _
|
41
|
+
_______ ___/ /_ _ (_)__ ___
|
42
|
+
/ __/ -_) _ / ' \\/ / _ \\/ -_)
|
43
|
+
/_/ \\__/\\_,_/_/_/_/_/_//_/\\__/
|
44
|
+
|
50
45
|
|
51
46
|
#{I18n.translate(:powered_by)}
|
52
47
|
|
@@ -16,24 +16,19 @@
|
|
16
16
|
#
|
17
17
|
# From archive::
|
18
18
|
# Supported archives are .zip and .tar.gz.
|
19
|
-
# =>
|
20
|
-
# # minimal
|
21
|
-
# redmine upgrade PATH_TO_PACKAGE
|
22
|
-
#
|
23
|
-
# # full
|
24
|
-
# redmine upgrade PATH_TO_PACKAGE --env ENV1,ENV2,ENV3
|
25
19
|
#
|
26
|
-
# From git::
|
27
20
|
# # minimal
|
28
|
-
# redmine
|
21
|
+
# redmine install PATH_TO_PACKAGE
|
22
|
+
# redmine install REDMINE_VERSION
|
29
23
|
#
|
30
24
|
# # full
|
31
|
-
# redmine
|
25
|
+
# redmine install PATH_TO_PACKAGE --env ENV1,ENV2,ENV3
|
32
26
|
#
|
33
27
|
module Redmine::Installer
|
34
28
|
class Install < Task
|
35
29
|
|
36
30
|
STEPS = [
|
31
|
+
step::EnvCheck,
|
37
32
|
step::RedmineRoot,
|
38
33
|
step::LoadPackage,
|
39
34
|
step::DatabaseConfig,
|
@@ -1,8 +1,8 @@
|
|
1
|
-
|
2
1
|
en:
|
3
2
|
redmine_installer_summary: 'Easy way how install/upgrade redmine or plugin.'
|
4
3
|
backup: 'Backup'
|
5
4
|
backup_is_stored_at: 'Backup is stored at <bright>%{dir}</bright>'
|
5
|
+
cannot_download_redmine_version: 'Cannot download redmine %{version}'
|
6
6
|
cli_install_desc: 'Install redmine'
|
7
7
|
cli_show_verbose_output: 'Show verbose output'
|
8
8
|
cli_upgrade_desc: 'Upgrade redmine'
|
@@ -32,6 +32,8 @@ en:
|
|
32
32
|
only_database: 'Only database'
|
33
33
|
path_for_redmine_root: 'Path for redmine_root'
|
34
34
|
powered_by: 'Powered by EasyRedmine'
|
35
|
+
redmine_downloading: 'Redmine downloading'
|
36
|
+
redmine_was_installed_to: 'Redmine was installed to %{dir}'
|
35
37
|
restoring_database: '... Restoring database'
|
36
38
|
skip: 'Skip'
|
37
39
|
try_again: 'try again'
|
@@ -40,6 +42,8 @@ en:
|
|
40
42
|
what_web_server_do_you_want: 'What web-server do you want?'
|
41
43
|
yes_t: 'yes'
|
42
44
|
your_profile_can_be_used_as: 'Your profile is saved as #%{id} and can be use with <bright>--profile %{id}</bright>'
|
45
|
+
installer_run_as_root: 'Installer run as root. This can be dangerous. Continue?'
|
46
|
+
terminated_by_user: Terminated by user.
|
43
47
|
|
44
48
|
step:
|
45
49
|
load_package:
|
@@ -63,7 +67,9 @@ en:
|
|
63
67
|
save_profile:
|
64
68
|
title: 'Saving profile'
|
65
69
|
redmine_root:
|
66
|
-
title: '
|
70
|
+
title: 'Getting a redmine root'
|
71
|
+
env_check:
|
72
|
+
title: 'Environment checking'
|
67
73
|
|
68
74
|
plugin:
|
69
75
|
database:
|
@@ -89,17 +95,17 @@ en:
|
|
89
95
|
configuration: |
|
90
96
|
Add:
|
91
97
|
<bright>gem 'thin'</bright>
|
92
|
-
|
98
|
+
|
93
99
|
to <bright>Gemfile.local</bright>
|
94
|
-
|
100
|
+
|
95
101
|
and run: <bright>bundle install</bright>
|
96
|
-
|
102
|
+
|
97
103
|
(More informations can be found at http://code.macournoyer.com/thin)
|
98
104
|
apachepassenger:
|
99
105
|
title: 'Passenger (apache)'
|
100
106
|
configuration: |
|
101
107
|
Add this to apache configuration file.
|
102
|
-
|
108
|
+
|
103
109
|
<bright><VirtualHost *:80>
|
104
110
|
ServerName www.yourhost.com
|
105
111
|
DocumentRoot %{redmine_root}/public
|
@@ -112,29 +118,29 @@ en:
|
|
112
118
|
#Require all granted
|
113
119
|
</Directory>
|
114
120
|
</VirtualHost></bright>
|
115
|
-
|
121
|
+
|
116
122
|
More informations can be found at https://www.phusionpassenger.com/documentation/Users%20guide%20Apache.html
|
117
123
|
nginxpassenger:
|
118
124
|
title: 'Passenger (nginx)'
|
119
125
|
configuration: |
|
120
126
|
Add this to nginx configuration file.
|
121
|
-
|
127
|
+
|
122
128
|
<bright>server {
|
123
129
|
listen 80;
|
124
130
|
server_name www.yourhost.com;
|
125
131
|
root %{redmine_root}/public; # <--- be sure to point to 'public'!
|
126
132
|
passenger_enabled on;
|
127
133
|
}</bright>
|
128
|
-
|
134
|
+
|
129
135
|
More informations can be found at https://www.phusionpassenger.com/documentation/Users%20guide%20Nginx.html
|
130
136
|
puma:
|
131
137
|
title: 'Puma'
|
132
138
|
configuration: |
|
133
139
|
Add:
|
134
140
|
<bright>gem 'puma'</bright>
|
135
|
-
|
141
|
+
|
136
142
|
to <bright>Gemfile.local</bright>
|
137
|
-
|
143
|
+
|
138
144
|
More informations can be found at http://puma.io
|
139
145
|
redmine_plugin:
|
140
146
|
easyproject:
|
@@ -2,7 +2,7 @@ module Redmine::Installer::Plugin
|
|
2
2
|
class Base
|
3
3
|
|
4
4
|
include Redmine::Installer::Utils
|
5
|
-
|
5
|
+
|
6
6
|
# Register children
|
7
7
|
def self.inherited(child)
|
8
8
|
all << child
|
@@ -12,7 +12,7 @@ module Redmine::Installer::Plugin
|
|
12
12
|
unless self.instance_variable_defined?(:@all)
|
13
13
|
self.instance_variable_set(:@all, Array.new)
|
14
14
|
end
|
15
|
-
|
15
|
+
|
16
16
|
self.instance_variable_get(:@all)
|
17
17
|
end
|
18
18
|
|
@@ -20,9 +20,5 @@ module Redmine::Installer::Plugin
|
|
20
20
|
translate("plugin.#{self.superclass.class_name.downcase}.#{self.class_name.downcase}.title")
|
21
21
|
end
|
22
22
|
|
23
|
-
# def self.plugin_name
|
24
|
-
# binding.pry unless @__binding
|
25
|
-
# end
|
26
|
-
|
27
23
|
end
|
28
24
|
end
|
@@ -11,6 +11,9 @@ module Redmine::Installer::Plugin
|
|
11
11
|
records.include?(self.class_name.downcase)
|
12
12
|
end
|
13
13
|
|
14
|
+
def self.final(*)
|
15
|
+
end
|
16
|
+
|
14
17
|
end
|
15
18
|
end
|
16
19
|
|
@@ -52,4 +55,28 @@ class EasyProject < Redmine::Installer::Plugin::RedminePlugin
|
|
52
55
|
|
53
56
|
install(base)
|
54
57
|
end
|
58
|
+
|
59
|
+
def self.final(base)
|
60
|
+
return unless am_i_there?
|
61
|
+
|
62
|
+
say %{
|
63
|
+
<bright>EasyRedmine notes:</bright>
|
64
|
+
You should create a maintenance task to CRON (on Linux) or Scheduled Tasks (on Windows)
|
65
|
+
that will be running every 5-15 minutes. This one task aggregates all required tasks
|
66
|
+
such as mail receiving, alerts evaluation etc. You should set up required parameters via
|
67
|
+
administration -> scheduled tasks.
|
68
|
+
Do not run this task under root, use same user that is used for web server.:
|
69
|
+
|
70
|
+
<bright>bundle exec rake easyproject:scheduler:run_tasks RAILS_ENV=production</bright>
|
71
|
+
|
72
|
+
For example:
|
73
|
+
1. Edit crontab
|
74
|
+
crontab -e
|
75
|
+
|
76
|
+
2. Add:
|
77
|
+
*/15 * * * * cd #{base.redmine_root} && bundle exec rake easyproject:scheduler:run_tasks RAILS_ENV=production
|
78
|
+
|
79
|
+
|
80
|
+
}
|
81
|
+
end
|
55
82
|
end
|
@@ -11,5 +11,6 @@ module Redmine::Installer
|
|
11
11
|
autoload :Backup, 'redmine-installer/steps/backup'
|
12
12
|
autoload :Upgrade, 'redmine-installer/steps/upgrade'
|
13
13
|
autoload :RedmineRoot, 'redmine-installer/steps/redmine_root'
|
14
|
+
autoload :EnvCheck, 'redmine-installer/steps/env_check'
|
14
15
|
end
|
15
16
|
end
|
@@ -1,4 +1,20 @@
|
|
1
1
|
module Redmine::Installer::Step
|
2
|
+
##
|
3
|
+
# Base
|
4
|
+
#
|
5
|
+
# == Steps:
|
6
|
+
# prepare::
|
7
|
+
# used for argument validation
|
8
|
+
#
|
9
|
+
# up::
|
10
|
+
# actions
|
11
|
+
#
|
12
|
+
# final::
|
13
|
+
# for printing informations
|
14
|
+
#
|
15
|
+
# down::
|
16
|
+
# if something went wrong
|
17
|
+
#
|
2
18
|
class Base
|
3
19
|
|
4
20
|
include Redmine::Installer::Utils
|
@@ -29,12 +45,15 @@ module Redmine::Installer::Step
|
|
29
45
|
def print_footer
|
30
46
|
end
|
31
47
|
|
32
|
-
def
|
48
|
+
def prepare
|
33
49
|
end
|
34
50
|
|
35
51
|
def up
|
36
52
|
end
|
37
53
|
|
54
|
+
def final
|
55
|
+
end
|
56
|
+
|
38
57
|
def down
|
39
58
|
end
|
40
59
|
|
@@ -0,0 +1,20 @@
|
|
1
|
+
module Redmine::Installer::Step
|
2
|
+
class EnvCheck < Base
|
3
|
+
|
4
|
+
def prepare
|
5
|
+
# Check if windows
|
6
|
+
# if windows?
|
7
|
+
# confirm(:do_you_want_continue_if_windows, false)
|
8
|
+
# end
|
9
|
+
|
10
|
+
if root? && !confirm(:installer_run_as_root, false)
|
11
|
+
error(:terminated_by_user)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
def up
|
16
|
+
say '<green>... OK</green>', 1
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
20
|
+
end
|
@@ -1,9 +1,11 @@
|
|
1
1
|
require 'rubygems/package'
|
2
2
|
require 'ruby-progressbar'
|
3
3
|
require 'fileutils'
|
4
|
-
require '
|
4
|
+
require 'net/http'
|
5
5
|
require 'tmpdir'
|
6
6
|
require 'zlib'
|
7
|
+
require 'zip'
|
8
|
+
require 'uri'
|
7
9
|
|
8
10
|
module Redmine::Installer::Step
|
9
11
|
class LoadPackage < Base
|
@@ -12,20 +14,49 @@ module Redmine::Installer::Step
|
|
12
14
|
TAR_LONGLINK = '././@LongLink'
|
13
15
|
PROGRESSBAR_FORMAT = '%a [%b>%i] %p%% %t'
|
14
16
|
|
15
|
-
def
|
17
|
+
def prepare
|
16
18
|
case base.options[:source]
|
17
19
|
when 'file'
|
18
|
-
|
20
|
+
|
21
|
+
unless File.exist?(base.package)
|
22
|
+
if base.package =~ /\Av?(\d\.\d\.\d)\Z/
|
23
|
+
download_redmine($1)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
unless File.exist?(base.package)
|
28
|
+
error :file_not_exist, file: base.package
|
29
|
+
end
|
30
|
+
|
31
|
+
@type = File.extname(base.package)
|
32
|
+
unless SUPPORTED_ARCHIVE_FORMATS.include?(@type)
|
33
|
+
error :file_must_have_format, file: base.package, formats: SUPPORTED_ARCHIVE_FORMATS.join(', ')
|
34
|
+
end
|
35
|
+
|
19
36
|
when 'git'
|
20
|
-
|
37
|
+
nil
|
21
38
|
else
|
22
39
|
error :error_unsupported_source, source: base.options[:source]
|
23
40
|
end
|
24
41
|
end
|
25
42
|
|
26
|
-
def
|
27
|
-
|
43
|
+
def up
|
44
|
+
case base.options[:source]
|
45
|
+
when 'file'
|
46
|
+
load_from_archive
|
47
|
+
when 'git'
|
48
|
+
load_from_git
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
def down
|
28
53
|
FileUtils.remove_entry_secure(@tmpdir) if @tmpdir
|
54
|
+
FileUtils.safe_unlink(@tmpfile) if @tmpfile
|
55
|
+
end
|
56
|
+
|
57
|
+
def final
|
58
|
+
down
|
59
|
+
say(t(:redmine_was_installed_to, dir: base.redmine_root), 1)
|
29
60
|
end
|
30
61
|
|
31
62
|
private
|
@@ -33,12 +64,6 @@ module Redmine::Installer::Step
|
|
33
64
|
# =======================================================================
|
34
65
|
# General
|
35
66
|
|
36
|
-
def create_tmp_dir
|
37
|
-
@tmpdir = Dir.mktmpdir
|
38
|
-
rescue
|
39
|
-
FileUtils.remove_entry_secure(@tmpdir)
|
40
|
-
end
|
41
|
-
|
42
67
|
# Move files from temp dir to target. First check
|
43
68
|
# if folder contains redmine or contains
|
44
69
|
# folder which contains redmine :-)
|
@@ -67,16 +92,7 @@ module Redmine::Installer::Step
|
|
67
92
|
# =======================================================================
|
68
93
|
# File
|
69
94
|
|
70
|
-
def
|
71
|
-
unless File.exist?(base.package)
|
72
|
-
error :file_not_exist, file: base.package
|
73
|
-
end
|
74
|
-
|
75
|
-
@type = File.extname(base.package)
|
76
|
-
unless SUPPORTED_ARCHIVE_FORMATS.include?(@type)
|
77
|
-
error :file_must_have_format, file: base.package, formats: SUPPORTED_ARCHIVE_FORMATS.join(', ')
|
78
|
-
end
|
79
|
-
|
95
|
+
def load_from_archive
|
80
96
|
# Make temp directory and extract archive + move it to the redmine_folder
|
81
97
|
extract_to_tmp
|
82
98
|
|
@@ -84,8 +100,38 @@ module Redmine::Installer::Step
|
|
84
100
|
get_tmp_redmine_root
|
85
101
|
end
|
86
102
|
|
103
|
+
def download_redmine(version)
|
104
|
+
@tmpfile = Tempfile.new(['redmine', '.zip'])
|
105
|
+
@tmpfile.binmode
|
106
|
+
|
107
|
+
uri = URI("http://www.redmine.org/releases/redmine-#{version}.zip")
|
108
|
+
|
109
|
+
Net::HTTP.start(uri.host, uri.port) do |http|
|
110
|
+
head = http.request_head(uri)
|
111
|
+
|
112
|
+
unless head.is_a?(Net::HTTPSuccess)
|
113
|
+
error :cannot_download_redmine_version, version: version
|
114
|
+
end
|
115
|
+
|
116
|
+
say(:redmine_downloading, 1)
|
117
|
+
progressbar = ProgressBar.create(format: PROGRESSBAR_FORMAT, total: head['content-length'].to_i)
|
118
|
+
|
119
|
+
http.get(uri) do |data|
|
120
|
+
@tmpfile.write(data)
|
121
|
+
progressbar.progress += data.size
|
122
|
+
end
|
123
|
+
|
124
|
+
progressbar.finish
|
125
|
+
say(nil, 1)
|
126
|
+
end
|
127
|
+
|
128
|
+
@tmpfile.close
|
129
|
+
|
130
|
+
base.package = @tmpfile.path
|
131
|
+
end
|
132
|
+
|
87
133
|
def extract_to_tmp
|
88
|
-
|
134
|
+
@tmpdir = Dir.mktmpdir
|
89
135
|
|
90
136
|
case @type
|
91
137
|
when '.zip'
|
@@ -112,10 +158,10 @@ module Redmine::Installer::Step
|
|
112
158
|
|
113
159
|
# Extract .tar.gz archive
|
114
160
|
# based on http://dracoater.blogspot.cz/2013/10/extracting-files-from-targz-with-ruby.html
|
115
|
-
#
|
116
|
-
# Originally tar did not support paths longer than 100 chars. GNU tar is better and they
|
117
|
-
# implemented support for longer paths, but it was made through a hack called ././@LongLink.
|
118
|
-
# Shortly speaking, if you stumble upon an entry in tar archive which path equals to above
|
161
|
+
#
|
162
|
+
# Originally tar did not support paths longer than 100 chars. GNU tar is better and they
|
163
|
+
# implemented support for longer paths, but it was made through a hack called ././@LongLink.
|
164
|
+
# Shortly speaking, if you stumble upon an entry in tar archive which path equals to above
|
119
165
|
# mentioned ././@LongLink, that means that the following entry path is longer than 100 chars and
|
120
166
|
# is truncated. The full path of the following entry is actually the value of the current entry.
|
121
167
|
#
|
@@ -158,8 +204,8 @@ module Redmine::Installer::Step
|
|
158
204
|
# =======================================================================
|
159
205
|
# Git
|
160
206
|
|
161
|
-
def
|
162
|
-
|
207
|
+
def load_from_git
|
208
|
+
@tmpdir = Dir.mktmpdir
|
163
209
|
|
164
210
|
# Package is remote url to git repository
|
165
211
|
remote = base.package
|
@@ -27,17 +27,27 @@ module Redmine::Installer
|
|
27
27
|
end
|
28
28
|
|
29
29
|
def run
|
30
|
-
@steps.each do |
|
30
|
+
@steps.each do |_, step|
|
31
|
+
step.prepare
|
32
|
+
end
|
33
|
+
|
34
|
+
@steps.each do |_, step|
|
31
35
|
step.print_title
|
32
36
|
step.print_header
|
33
37
|
step.up
|
34
38
|
step.print_footer
|
35
39
|
step.ran = true
|
36
|
-
puts
|
40
|
+
puts
|
41
|
+
end
|
42
|
+
|
43
|
+
@steps.each do |_, step|
|
44
|
+
step.final
|
37
45
|
end
|
38
46
|
|
39
|
-
|
40
|
-
|
47
|
+
Dir.chdir(redmine_root) do
|
48
|
+
Redmine::Installer::Plugin::RedminePlugin.all.each do |plugin|
|
49
|
+
plugin.final(self)
|
50
|
+
end
|
41
51
|
end
|
42
52
|
rescue Redmine::Installer::Error => e
|
43
53
|
# Rescue from error comes from installer
|
@@ -6,7 +6,7 @@
|
|
6
6
|
# plugins will be kept otherwise are replaced with those from package.
|
7
7
|
#
|
8
8
|
# Final step will ask you if you want save steps configuration.
|
9
|
-
# If you say YES, configuration will be stored as profile so next time
|
9
|
+
# If you say YES, configuration will be stored as profile so next time
|
10
10
|
# you can upgrade redmine faster.
|
11
11
|
#
|
12
12
|
# redmine upgrade PACKAGE --profile PROFILE_ID
|
@@ -41,6 +41,7 @@ module Redmine::Installer
|
|
41
41
|
class Upgrade < Task
|
42
42
|
|
43
43
|
STEPS = [
|
44
|
+
step::EnvCheck,
|
44
45
|
step::RedmineRoot,
|
45
46
|
step::LoadPackage,
|
46
47
|
step::Validation,
|
@@ -5,7 +5,7 @@ require 'io/console'
|
|
5
5
|
|
6
6
|
module Redmine::Installer
|
7
7
|
module Utils
|
8
|
-
|
8
|
+
|
9
9
|
def self.included(base)
|
10
10
|
base.send :extend, Methods
|
11
11
|
base.send :include, Methods
|
@@ -69,6 +69,14 @@ module Redmine::Installer
|
|
69
69
|
Dir.glob(File.join('plugins', '*')).select{|record| File.directory?(record)}.any?
|
70
70
|
end
|
71
71
|
|
72
|
+
def windows?
|
73
|
+
RbConfig::CONFIG['host_os'] =~ /mswin|mingw/
|
74
|
+
end
|
75
|
+
|
76
|
+
def root?
|
77
|
+
Process.euid == 0
|
78
|
+
end
|
79
|
+
|
72
80
|
|
73
81
|
# =======================================================================
|
74
82
|
# Input, output
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: redmine-installer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ondřej Moravčík
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-07-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ansi
|
@@ -166,6 +166,7 @@ files:
|
|
166
166
|
- lib/redmine-installer/steps/base.rb
|
167
167
|
- lib/redmine-installer/steps/database_config.rb
|
168
168
|
- lib/redmine-installer/steps/email_config.rb
|
169
|
+
- lib/redmine-installer/steps/env_check.rb
|
169
170
|
- lib/redmine-installer/steps/install.rb
|
170
171
|
- lib/redmine-installer/steps/load_package.rb
|
171
172
|
- lib/redmine-installer/steps/move_redmine.rb
|
@@ -202,7 +203,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
202
203
|
version: '0'
|
203
204
|
requirements: []
|
204
205
|
rubyforge_project:
|
205
|
-
rubygems_version: 2.
|
206
|
+
rubygems_version: 2.4.5
|
206
207
|
signing_key:
|
207
208
|
specification_version: 4
|
208
209
|
summary: Easy way how install/upgrade redmine or plugin.
|