raystool 1.2.2 → 1.2.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -211,8 +211,9 @@ module Rays
211
211
  unless liferay_config.nil?
212
212
  host = liferay_config['host']
213
213
  port = liferay_config['port']
214
- deploy = liferay_config['deploy']
215
- data_directory = liferay_config['data']
214
+ liferay_root = liferay_config['root']
215
+ deploy = absolute_path(liferay_root, liferay_config['deploy'])
216
+ data_directory = absolute_path(liferay_root, liferay_config['data'])
216
217
  remote = create_remote_for liferay_config
217
218
  java_home = nil
218
219
  java_bin = nil
@@ -307,9 +308,10 @@ module Rays
307
308
  application_service_config = config['service']
308
309
  host = config['host']
309
310
  port = config['port']
311
+ root = config['root']
310
312
  remote = create_remote_for config
311
313
  unless application_service_config.nil?
312
- path = application_service_config['path']
314
+ path = absolute_path(root, application_service_config['path'])
313
315
  path = "" if path.nil?
314
316
  start_script = File.join(path, application_service_config['start_command'])
315
317
  debug_script = nil
@@ -393,5 +395,11 @@ module Rays
393
395
  true
394
396
  end
395
397
 
398
+ def absolute_path(root, path)
399
+ return "" if path.nil? or path.empty?
400
+ return path if root.nil? or root.strip.empty? or path.start_with? "/"
401
+ "#{root}/#{path}"
402
+ end
403
+
396
404
  end
397
405
  end
@@ -3,13 +3,13 @@ local:
3
3
  host: localhost
4
4
  port: 8080
5
5
  root: /opt/liferay-portal
6
- deploy: deploy
7
- data: data
6
+ deploy: deploy # will be added to the root
7
+ data: data # will be added to the root
8
8
  java:
9
9
  home: /usr/lib/jvm/java-6-sun
10
10
  bin: /usr/bin/java
11
11
  service:
12
- path: tomcat
12
+ path: tomcat # will be added to the root
13
13
  start_command: "JAVA_OPTS=\"$JAVA_OPTS -Dexternal-properties=portal-developer.properties\" && bin/startup.sh"
14
14
  debug_command: bin/catalina.sh jpda start
15
15
  stop_command: bin/shutdown.sh
@@ -307,18 +307,9 @@ class RaysCommand < Clamp::Command
307
307
  #
308
308
  # SYNC
309
309
  #
310
- #subcommand 'sync', 'synchronize local environment with the current one' do
311
- # def execute
312
- # Rays::Controller.instance.sync
313
- # end
314
- #end
315
-
316
- #
317
- # UPDATE
318
- #
319
- subcommand 'update', 'update project configuration to the current version of rays' do
310
+ subcommand 'sync', 'synchronize local environment with the current one' do
320
311
  def execute
321
- Rays::Controller.instance.update
312
+ Rays::Controller.instance.sync
322
313
  end
323
314
  end
324
315
 
@@ -209,19 +209,13 @@ module Rays
209
209
  end
210
210
  end
211
211
 
212
- #def sync
213
- # if 'local'.eql?($rays_config.environment.name)
214
- # $log.warn("Select not local environment to import to local.")
215
- # return
216
- # end
217
- # log_block("synchronize environments") do
218
- # Rays::Service::Sync.new.sync
219
- # end
220
- #end
221
-
222
- def update
223
- log_block('update') do
224
- Rays::Service::Updater.instance.update
212
+ def sync
213
+ if 'local'.eql?($rays_config.environment.name)
214
+ $log.warn("Select not local environment to import to local.")
215
+ return
216
+ end
217
+ log_block("synchronize environments") do
218
+ Rays::Service::Sync.new.sync
225
219
  end
226
220
  end
227
221
 
@@ -46,6 +46,7 @@ module Rays
46
46
  @updaters[Gem::Version.create('1.2.0')] = 'update_1_2_0'
47
47
  @updaters[Gem::Version.create('1.2.1')] = 'update_1_2_1'
48
48
  @updaters[Gem::Version.create('1.2.2')] = 'update_1_2_2'
49
+ @updaters[Gem::Version.create('1.2.3')] = 'update_1_2_3'
49
50
  end
50
51
 
51
52
  def check
@@ -110,6 +111,10 @@ module Rays
110
111
  $log.info "Update info: now you can add skip_mass_deploy: true parameter to .module file to ignore this module for mass deploy"
111
112
  end
112
113
 
114
+ def update_1_2_3
115
+ $log.info "Update info: now you can root option in your environment.yml to get rid of absolute paths for data, deploy and service/path. Create a new project to see an example."
116
+ end
117
+
113
118
  def sync_version version
114
119
  @rays_content.properties['version'] = version.to_s
115
120
  @rays_content.write
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: raystool
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.2
4
+ version: 1.2.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-07-18 00:00:00.000000000 Z
12
+ date: 2012-08-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: clamp
16
- requirement: &72499490 !ruby/object:Gem::Requirement
16
+ requirement: &71272460 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *72499490
24
+ version_requirements: *71272460
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: rsolr
27
- requirement: &72499270 !ruby/object:Gem::Requirement
27
+ requirement: &71272240 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *72499270
35
+ version_requirements: *71272240
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: colorize
38
- requirement: &72499060 !ruby/object:Gem::Requirement
38
+ requirement: &71272030 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '0'
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *72499060
46
+ version_requirements: *71272030
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: net-ssh
49
- requirement: &72498850 !ruby/object:Gem::Requirement
49
+ requirement: &71271820 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: '0'
55
55
  type: :runtime
56
56
  prerelease: false
57
- version_requirements: *72498850
57
+ version_requirements: *71271820
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: highline
60
- requirement: &72498640 !ruby/object:Gem::Requirement
60
+ requirement: &71271610 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ! '>='
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: '0'
66
66
  type: :runtime
67
67
  prerelease: false
68
- version_requirements: *72498640
68
+ version_requirements: *71271610
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: safe_shell
71
- requirement: &72498430 !ruby/object:Gem::Requirement
71
+ requirement: &71271400 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ! '>='
@@ -76,10 +76,10 @@ dependencies:
76
76
  version: '0'
77
77
  type: :runtime
78
78
  prerelease: false
79
- version_requirements: *72498430
79
+ version_requirements: *71271400
80
80
  - !ruby/object:Gem::Dependency
81
81
  name: nokogiri
82
- requirement: &72498220 !ruby/object:Gem::Requirement
82
+ requirement: &71271190 !ruby/object:Gem::Requirement
83
83
  none: false
84
84
  requirements:
85
85
  - - ! '>='
@@ -87,7 +87,7 @@ dependencies:
87
87
  version: '0'
88
88
  type: :runtime
89
89
  prerelease: false
90
- version_requirements: *72498220
90
+ version_requirements: *71271190
91
91
  description: Command line tool to create and manage liferay projects
92
92
  email: dmitri.carpov@gmail.com
93
93
  executables: