redmine-installer 1.0.2 → 1.0.3

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
  SHA1:
3
- metadata.gz: c6b1dc78262bd3d0e88d765b62bac3ff5c6cd31b
4
- data.tar.gz: 4281ff021662f3f92e320dbcc150132161592a8d
3
+ metadata.gz: 1cbbf5830bfd93d5c77dc0a7800c86a1b5a18d02
4
+ data.tar.gz: b1eae7e8eba3dbd5b4087a31a4401c295532f886
5
5
  SHA512:
6
- metadata.gz: 9120fb096383789fdced6385f500308b3f773a33c2a35eb5e1361391085317321cec5405f7a094cb29f9c51a3c8366f0ebda282c830e69a177c9514630581bce
7
- data.tar.gz: a75f19c13818acc90aaaea573f622c8e79ad08a21e70b809c34058972fb66fffce3070a7354cd864a53ff6b3b3fda1582e45f1bfbec49061bfdb5faa400d4bcf
6
+ metadata.gz: a95f8f3bee4ebe2382286580db9dab236c2b41fe6f923989984db5e9f79dab8ea6525d00f389aa48e5cbb32853e200bc770176bce0550346269352acf004f958
7
+ data.tar.gz: 67e5b24065eb29494644ca2c0d4a070933c4ad2def7c2a50993524fa17ae3d13566a1daa2e11909c7be615ef7b06c5a85c17608f65e67665bb326cbbc85262e7
data/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # Redmine::Installer
2
2
 
3
+ Easy way how to install/upgrade Redmine or plugin
4
+
3
5
  ## Installation
4
6
 
5
7
  Add this line to your application's Gemfile:
@@ -20,13 +22,51 @@ Or install it yourself as:
20
22
  $ gem install redmine-installer
21
23
  ```
22
24
 
25
+ ## Examples
26
+
27
+ Simple install and ugrade
28
+
29
+ ```
30
+ $ wget http://www.redmine.org/releases/redmine-2.3.0.zip
31
+ $ wget http://www.redmine.org/releases/redmine-2.5.0.zip
32
+
33
+ $ redmine install redmine-2.3.0.zip
34
+ $ redmine upgrade redmine-2.5.0.zip
35
+ ```
36
+
37
+ Set languages
38
+
39
+ ```
40
+ $ redmine --locale cs install redmine-2.3.0.zip
41
+ ```
42
+
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
+
23
57
  ## Usage
24
58
 
25
59
  ```
26
- redmine GLOBAL_ARGUMENTS ACTION ARGUMENTS
60
+ redmine GLOBAL_FLAGS ACTION ARGUMENTS FLAGS
27
61
  ```
28
62
 
29
- #### Global arguments
63
+ See help for more details
64
+
65
+ ```
66
+ redmine help
67
+ ```
68
+
69
+ #### Global flags
30
70
 
31
71
  <table>
32
72
  <thead>
@@ -45,7 +85,7 @@ redmine GLOBAL_ARGUMENTS ACTION ARGUMENTS
45
85
  <tr>
46
86
  <td>--locale / -l</td>
47
87
  <td>en</td>
48
- <td>languages for application</td>
88
+ <td>language for application</td>
49
89
  </tr>
50
90
  </tbody>
51
91
  </table>
@@ -57,9 +97,7 @@ Some commands have defined shortcut for quicker access. Fox example:
57
97
 
58
98
  ```
59
99
  redmine install package
60
-
61
100
  # is equal as
62
-
63
101
  redmine i package
64
102
  ```
65
103
 
@@ -71,7 +109,7 @@ u -> upgrade
71
109
  b -> backup
72
110
  ```
73
111
 
74
- #### Common arguments
112
+ #### Common flags for all command
75
113
 
76
114
  <table>
77
115
  <thead>
@@ -86,46 +124,50 @@ b -> backup
86
124
  <td>--environment / --env / -e</td>
87
125
  <td>production</td>
88
126
  <td>
89
- environment for redmine
127
+ environment for redmine<br>
128
+ you can set more environment like: <br>
129
+ &nbsp;&nbsp;&nbsp;<i>--env env1,env2,env3</i>
90
130
  </td>
91
131
  </tr>
92
132
  </tbody>
93
133
  </table>
94
134
 
95
- ### Instalation
135
+ ## Install
96
136
 
97
- You can instal redmine package from archive or git.
137
+ Install new redmine instance from archive or git.
98
138
 
99
139
  #### Steps:
100
140
 
101
- - *1. Redmine root* - where should be new redmine located
102
- - *2. Load package* - extract package
103
- - *3. Database configuration* - you can choose type of DB which you want to use
104
- - *4. Email sending configuration* - email sending configuration
105
- - *5. Install* - install commands are executed
106
- - *6. Moving redmine* - redmine is moved from temporarily folder to given redmine_root
107
- - *7. Webserve configuration* - generating webserver configuration
141
+ - **1. Redmine root** - insert _path_ where redmine will be installed
142
+ - _path_ must point to the folder
143
+ - target folder must be writable
144
+ - **2. Load package** - loading package to temporary folder
145
+ - **3. Database configuration** - you can choose type of DB which you want to use
146
+ - currently: MySQL or PostgreSQL
147
+ - you can also skip this step and run migration manually
148
+ - **4. Email sending configuration** - you can set email configuration
149
+ - **5. Install** - install commands are executed
150
+ - **6. Moving redmine** - redmine is moved from temporarily folder to given _redmine\_root_
151
+ - **7. Webserve configuration** - you can generate setting from selected webserver
108
152
 
109
153
  #### From archive
110
154
 
111
155
  Supported archives are **.zip** and **.tar.gz**.
112
156
 
113
157
  ```
114
- # minimal
115
158
  redmine install PATH_TO_PACKAGE
116
159
 
117
- # full
118
- redmine install PATH_TO_PACKAGE --env ENV1,ENV2,ENV3
160
+ # with environment
161
+ redmine install PATH_TO_PACKAGE --env environment
119
162
  ```
120
163
 
121
164
  #### From git
122
165
 
123
166
  ```
124
- # minimal
125
167
  redmine install GIT_REPO --source git
126
168
 
127
- # full
128
- redmine install GIT_REPO --source git --branch GIT_BRANCH --env ENV1,ENV2,ENV3
169
+ # with specific branch
170
+ redmine install GIT_REPO --source git --branch GIT_BRANCH --env environment
129
171
  ```
130
172
 
131
173
  ##### Arguments
@@ -133,7 +175,7 @@ redmine install GIT_REPO --source git --branch GIT_BRANCH --env ENV1,ENV2,ENV3
133
175
  <table>
134
176
  <thead>
135
177
  <tr>
136
- <th>argumnest</th>
178
+ <th>argument</th>
137
179
  <th>default</th>
138
180
  <th>description</th>
139
181
  </tr>
@@ -143,18 +185,18 @@ redmine install GIT_REPO --source git --branch GIT_BRANCH --env ENV1,ENV2,ENV3
143
185
  <td>--branch / -b</td>
144
186
  <td>master</td>
145
187
  <td>
146
- branch of git defined by GIT_REPO
188
+ git branch
147
189
  </td>
148
190
  </tr>
149
191
  </tbody>
150
192
  </table>
151
193
 
152
194
 
153
- ### Upgrade
195
+ ## Upgrade
154
196
 
155
- You can upgrade current redmine by archive or currently defined git repository. 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.
197
+ Upgrading existing instance of redmine with archive or defined git repository. 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.
156
198
 
157
- 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.
199
+ 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.
158
200
 
159
201
  ```
160
202
  redmine upgrade PACKAGE --profile PROFILE_ID
@@ -164,37 +206,38 @@ Profiles are stored on *HOME_FOLDER/.redmine-installer-profiles.yml*.
164
206
 
165
207
  #### Steps:
166
208
 
167
- - *1. Redmine root* - where should be new redmine located
168
- - *2. Load package* - extract package
169
- - *3. Validation* - current redmine should be valid
170
- - *4. Backup* - backup current redmine (see backup section)
171
- - *5. Upgrading* - install commands are executed
172
- - *6. Moving redmine* - redmine is moved from temporarily folder to given redmine_root
173
- - *7. Profile saving* - generating profile (see profile section)
209
+ - **1. Redmine root** - where is redmine located
210
+ - **2. Load package** - loading package to temporary folder
211
+ - **3. Validation** - validation of current redmine
212
+ - **4. Backup** - backup current instance
213
+ - **full backup**: complete _redmine\_root_ with database
214
+ - **backup** (default): only configuration file with database
215
+ - **database**: only database
216
+ - **5. Upgrading** - upgrade commands are executed
217
+ - **6. Moving redmine** - current redmine is upgraded by new files
218
+ - **7. Profile saving** - generating profile (see profile section)
174
219
 
175
220
 
176
221
  #### From archive
177
222
 
178
223
  ```
179
- # minimal
180
224
  redmine upgrade PATH_TO_PACKAGE
181
225
 
182
- # full
183
- redmine upgrade PATH_TO_PACKAGE --env ENV1,ENV2,ENV3
226
+ # with environment
227
+ redmine upgrade PATH_TO_PACKAGE --env environment
184
228
  ```
185
229
 
186
230
  #### From git
187
231
 
188
232
  ```
189
- # minimal
190
233
  redmine upgrade --source git
191
234
 
192
- # full
193
- redmine upgrade --source git --env ENV1,ENV2,ENV3
235
+ # with environment
236
+ redmine upgrade --source git --env environment
194
237
  ```
195
238
 
196
239
 
197
- ### Backup
240
+ ## Backup
198
241
 
199
242
  ```
200
243
  redmine backup
@@ -202,10 +245,13 @@ redmine backup
202
245
 
203
246
  #### Steps:
204
247
 
205
- - *1. Redmine root* - where should be new redmine located
206
- - *2. Validation* - current redmine should be valid
207
- - *3. Backup* - backup current redmine (see backup section)
208
- - *4. Profile saving* - generating profile (see profile section)
248
+ - **1. Redmine root** - where is redmine located
249
+ - **2. Validation** - validation of current redmine
250
+ - **3. Backup** - backup current instance
251
+ - **full backup**: complete _redmine\_root_ with database
252
+ - **backup** (default): only configuration file with database
253
+ - **database**: only database
254
+ - **4. Profile saving** - generating profile (see profile section)
209
255
 
210
256
  You can choose one of 3 types.
211
257
 
@@ -239,35 +285,5 @@ You can choose one of 3 types.
239
285
  </tbody>
240
286
  </table>
241
287
 
242
- ## Examples
243
-
244
- Simple install and ugrade
245
-
246
- ```
247
- $ wget http://www.redmine.org/releases/redmine-2.3.0.zip
248
- $ wget http://www.redmine.org/releases/redmine-2.5.0.zip
249
-
250
- $ redmine install redmine-2.3.0.zip
251
- $ redmine upgrade redmine-2.5.0.zip
252
- ```
253
-
254
- Set languages
255
-
256
- ```
257
- $ redmine --locale cs install redmine-2.3.0.zip
258
- ```
259
288
 
260
- Install from git
261
-
262
- ```
263
- $ redmine install git@github.com:redmine/redmine.git --source git
264
- $ redmine upgrade --source git
265
- ```
266
-
267
- Install from git with specific branch
268
-
269
- ```
270
- $ redmine install git@github.com:redmine/redmine.git --source git --branch 2.3-stable
271
- $ redmine upgrade --source git
272
- ```
273
-
289
+
@@ -5,4 +5,5 @@ $LOAD_PATH.unshift(lib) if File.directory?(lib) && !$LOAD_PATH.include?(lib)
5
5
 
6
6
  require 'redmine-installer'
7
7
 
8
+ Redmine::Installer.print_logo
8
9
  Redmine::Installer::CLI.start(ARGV)
@@ -68,4 +68,3 @@ require 'redmine-installer/backup'
68
68
 
69
69
  # Default configurations
70
70
  Redmine::Installer.set_i18n
71
- Redmine::Installer.print_logo
@@ -49,7 +49,7 @@ module Redmine::Installer
49
49
  if confirm(:do_you_want_repeat_command, false)
50
50
  return run(*_args)
51
51
  else
52
- raise Redmine::Installer::Error, I18n.translate(:command_exit_with_error, command: command)
52
+ error(:command_exit_with_error, command: command)
53
53
  end
54
54
  end
55
55
 
@@ -9,7 +9,7 @@ cs:
9
9
  cli_flag_source: 'Jaký typ je balíček'
10
10
  cli_flag_branch: 'Jiná větev gitu'
11
11
  cli_flag_environment: 'Prostředí redminu'
12
- command_exit_with_error: 'Příkaz: <bright>%{command}</bright> skončil s chybou'
12
+ command_exit_with_error: 'Příkaz skončil s chybou: <bright>%{command}</bright>'
13
13
  dir_not_exist_and_cannot_be_created: 'Složka %{dir} neexistuje a nemůže být vytvořena'
14
14
  dir_is_not_writeable: 'Složka <bright>%{dir}</bright> není zapisovatelná'
15
15
  do_you_want_repeat_command: 'Chcete opakovat příkaz?'
@@ -31,6 +31,7 @@ cs:
31
31
  only_database: 'Pouze databáze'
32
32
  path_for_redmine_root: 'Cesta pro redmine_root'
33
33
  powered_by: 'Powered by EasyRedmine'
34
+ restoring_database: '... Obnova database'
34
35
  skip: 'Přeskočit'
35
36
  try_again: 'zkusit znova'
36
37
  what_dir_for_backups: 'Jaká složka pro zálohu?'
@@ -10,7 +10,7 @@ en:
10
10
  cli_flag_source: 'What type is package argument'
11
11
  cli_flag_branch: 'Different branch for git'
12
12
  cli_flag_environment: 'Environment for redmine'
13
- command_exit_with_error: 'Command: <bright>%{command}</bright> exit with an error'
13
+ command_exit_with_error: 'Command exit with an error: <bright>%{command}</bright>'
14
14
  dir_not_exist_and_cannot_be_created: 'Dir %{dir} does not exist and can not be created'
15
15
  dir_is_not_writeable: 'Dir <bright>%{dir}</bright> is not writeable'
16
16
  do_you_want_repeat_command: 'Do you want repeat this command?'
@@ -32,6 +32,7 @@ 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
+ restoring_database: '... Restoring database'
35
36
  skip: 'Skip'
36
37
  try_again: 'try again'
37
38
  what_dir_for_backups: 'What dir for backups?'
@@ -35,7 +35,9 @@ module Redmine::Installer::Plugin
35
35
  end
36
36
 
37
37
  def self.restore_all(redmine_root, backup_dir)
38
- load_all(redmine_root).each do |klass|
38
+ databases = load_all(redmine_root)
39
+ databases.uniq! {|d| d.params['database'].value}
40
+ databases.each do |klass|
39
41
  klass.restore(backup_dir)
40
42
  end
41
43
  end
@@ -102,6 +104,7 @@ module Redmine::Installer::Plugin
102
104
  # More enviroments can use the same database
103
105
  return unless File.exist?(file)
104
106
 
107
+ Kernel.system(command_for_empty)
105
108
  Kernel.system(command_for_restore(file))
106
109
  end
107
110
 
@@ -128,6 +131,10 @@ module Redmine::Installer::Plugin
128
131
  "-h #{params['host'].value} -P #{get('port')} -u #{get('username')} -p#{get('password')} #{get('database')}"
129
132
  end
130
133
 
134
+ def command_for_empty
135
+ "mysql #{command_args} -e 'drop database #{get('database')}; create database #{get('database')};'"
136
+ end
137
+
131
138
  def command_for_backup(file)
132
139
  "mysqldump --add-drop-database #{command_args} > #{file}"
133
140
  end
@@ -155,6 +162,11 @@ module Redmine::Installer::Plugin
155
162
  %{PGPASSWORD="#{get('password')}" #{comm} -i -h #{get('host')} -p #{get('port')} -U #{get('username')} -Fc -f #{file} #{get('database')}}
156
163
  end
157
164
 
165
+ def command_for_empty
166
+ # %{PGPASSWORD="#{get('password')}" psql -i -h #{get('host')} -p #{get('port')} -U #{get('username')} -c 'drop database #{get('database')}; create database #{get('database')};'}
167
+ ''
168
+ end
169
+
158
170
  def command_for_backup(file)
159
171
  command('pg_dump', file)
160
172
  end
@@ -8,7 +8,7 @@ module Redmine::Installer::Plugin
8
8
  def initialize
9
9
  @params = Redmine::Installer::ConfigParams.new
10
10
  @params.add('user_name')
11
- @params.add('password')
11
+ @params.add('password').hide(true)
12
12
  end
13
13
 
14
14
  def build
@@ -26,7 +26,10 @@ module Redmine::Installer::Step
26
26
  end
27
27
 
28
28
  def down
29
- database_restore if @database_backed_up
29
+ if @database_backed_up
30
+ say(:restoring_database)
31
+ database_restore
32
+ end
30
33
  end
31
34
 
32
35
  def final_step
@@ -1,5 +1,5 @@
1
1
  module Redmine
2
2
  module Installer
3
- VERSION = '1.0.2'
3
+ VERSION = '1.0.3'
4
4
  end
5
5
  end
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.2
4
+ version: 1.0.3
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: 2014-11-20 00:00:00.000000000 Z
11
+ date: 2014-11-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ansi