aem-deploy 0.1.9 → 0.1.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/aem/deploy/session.rb +20 -5
- data/lib/aem/deploy/version.rb +1 -1
- data/lib/aem-deploy.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e69f766f28e7f545c57730fefad25e50b7d27e48
|
4
|
+
data.tar.gz: 3588a996f8532eaa83ed276a3e56fb7370ba36d4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 23417b2a3ac428555e769bf2eed83df8d184aede33fb520fc435fac121854cf233d848b023afd95beafd04ccf3b3a5e6eb3218bb9054e38ec7993e1241c5fc61
|
7
|
+
data.tar.gz: ae975479436180413de50309d7b4d295a12855ff887773c2dc0b5a01458d6024073fc72353ae5be19fbc7e2e6c080b0b65018627a8649c4aeb5530d479839684
|
data/lib/aem/deploy/session.rb
CHANGED
@@ -9,6 +9,9 @@ module Aem::Deploy
|
|
9
9
|
class Session
|
10
10
|
attr_reader :host, :user, :pass, :retry, :upload_path
|
11
11
|
|
12
|
+
# Initialize the object
|
13
|
+
# @param [Hash] including :host, :user and :pass REQUIRED, optional :retry [Integer] which will retry failures x times.
|
14
|
+
# @raise [Error] if :host, :user and :pass are not passed on initialize
|
12
15
|
def initialize(params)
|
13
16
|
if [:host, :user, :pass].all? {|k| params.key?(k)}
|
14
17
|
@host = params.fetch(:host)
|
@@ -20,13 +23,18 @@ module Aem::Deploy
|
|
20
23
|
end
|
21
24
|
end
|
22
25
|
|
23
|
-
#
|
26
|
+
# See Upload and Install methods for individual descriptions
|
27
|
+
# @param [String] path to the package for upload and installation.
|
28
|
+
# @return [Hash] installation message from crx
|
24
29
|
def easy_install(package_path)
|
25
30
|
upload_package(package_path)
|
26
31
|
install_package
|
27
32
|
end
|
28
33
|
|
29
|
-
#
|
34
|
+
# Uploads Package to CRX
|
35
|
+
# @param [String] path to the package for upload and installation.
|
36
|
+
# @return [Hash] installation message from crx.
|
37
|
+
# @raise [Error] if server returns anything but success.
|
30
38
|
def upload_package(package_path)
|
31
39
|
upload = RestClient.post("http://#{@user}:#{@pass}@#{@host}/crx/packmgr/service/.json", :cmd => 'upload', :package => File.new(package_path, 'rb'), :force => true, :timeout => 300)
|
32
40
|
parse_response(upload)
|
@@ -39,7 +47,10 @@ module Aem::Deploy
|
|
39
47
|
end
|
40
48
|
end
|
41
49
|
|
42
|
-
#
|
50
|
+
# Installs Package to CRX
|
51
|
+
# @param [Hash] Optionally install packages already on CRX uses :path key in options hash, if you know the path to the package on crx.
|
52
|
+
# @return [Hash] installation message from crx.
|
53
|
+
# @raise [Error] if server returns anything but success.
|
43
54
|
def install_package(options = {})
|
44
55
|
if options[:path]
|
45
56
|
@upload_path = options[:path]
|
@@ -54,7 +65,9 @@ module Aem::Deploy
|
|
54
65
|
end
|
55
66
|
end
|
56
67
|
|
57
|
-
# Recompiles JSPs
|
68
|
+
# Recompiles JSPs
|
69
|
+
# @return [String] Recompile complete
|
70
|
+
# @raise [Error] if server returns anything but success.
|
58
71
|
def recompile_jsps
|
59
72
|
begin
|
60
73
|
RestClient.post "http://#{@user}:#{@pass}@#{@host}/system/console/slingjsp", :cmd => 'recompile', :timeout => 120
|
@@ -69,7 +82,9 @@ module Aem::Deploy
|
|
69
82
|
end
|
70
83
|
end
|
71
84
|
|
72
|
-
#
|
85
|
+
# Parses message output from CRX
|
86
|
+
# @return [String] Recompile complete
|
87
|
+
# @raise [Error] if server returns anything but success.
|
73
88
|
def parse_response(message)
|
74
89
|
if JSON.parse(message)['success'] == true
|
75
90
|
return " #{message}"
|
data/lib/aem/deploy/version.rb
CHANGED
data/lib/aem-deploy.rb
CHANGED