aem-deploy 0.1.21 → 0.1.22
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 +12 -3
- data/lib/aem/deploy/version.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: f252fe3a7e3bc0165af8f1a1e35a114229ab6789
|
4
|
+
data.tar.gz: dde7a85cc96521e70877abb76ef73473f9d8a7c7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ba7394819347e07f2254692f12f3697814dbc397384c3fde0be95278db54c3a91ca25ef6bbdbb2f5a064394dd354f12466d1060565f442fe3c8244fc2dd8ab92
|
7
|
+
data.tar.gz: f536335e2d498f81832e1ba8277477f82413dd5a6043778402947b341d8ac31e1e05ed5bf8f6a17d7c511e92ac1211b444f816dfa1c411e6918201e53b779d5f
|
data/lib/aem/deploy/session.rb
CHANGED
@@ -17,7 +17,8 @@ module Aem::Deploy
|
|
17
17
|
@user = params.fetch(:user)
|
18
18
|
@pass = CGI.escape(params.fetch(:pass))
|
19
19
|
@retry = params.fetch(:retry).to_i unless params[:retry].nil?
|
20
|
-
@protocol = params.fetch(:protocol) unless params[:protocol].nil?
|
20
|
+
@protocol = params.fetch(:protocol) unless params[:protocol].nil?
|
21
|
+
@cert = params.fetch(:cert) unless params[:cert].nil?
|
21
22
|
if @protocol.nil?
|
22
23
|
@protocol = 'http'
|
23
24
|
end
|
@@ -40,7 +41,11 @@ module Aem::Deploy
|
|
40
41
|
# @return [Hash] installation message from crx.
|
41
42
|
# @raise [Error] if server returns anything but success.
|
42
43
|
def upload_package(package_path)
|
43
|
-
|
44
|
+
if @protocol == 'https'
|
45
|
+
upload = RestClient::Request.execute(method: :post, url: "#{@protocol}://#{@user}:#{@pass}@#{@host}/crx/packmgr/service/.json", :ssl_ca_file => @cert, payload: {cmd: 'upload', package: File.new(package_path, 'rb'), force: true} )
|
46
|
+
else
|
47
|
+
upload = RestClient::Request.execute(method: :post, url: "#{@protocol}://#{@user}:#{@pass}@#{@host}/crx/packmgr/service/.json", payload: {cmd: 'upload', package: File.new(package_path, 'rb'), force: true} )
|
48
|
+
end
|
44
49
|
parse_response(upload)
|
45
50
|
@upload_path = URI.encode(JSON.parse(upload)["path"])
|
46
51
|
rescue => error
|
@@ -59,7 +64,11 @@ module Aem::Deploy
|
|
59
64
|
if options[:path]
|
60
65
|
@upload_path = options[:path]
|
61
66
|
end
|
62
|
-
|
67
|
+
if @protocol == 'https'
|
68
|
+
install = RestClient::Request.execute(method: :post, url: "#{@protocol}://#{@user}:#{@pass}@#{@host}/crx/packmgr/service/.json#{@upload_path}", :ssl_ca_file => @cert, payload: {cmd: 'install'} )
|
69
|
+
else
|
70
|
+
install = RestClient::Request.execute(method: :post, url: "#{@protocol}://#{@user}:#{@pass}@#{@host}/crx/packmgr/service/.json#{@upload_path}", payload: {cmd: 'install'} )
|
71
|
+
end
|
63
72
|
parse_response(install)
|
64
73
|
rescue => error
|
65
74
|
{error: error.to_s}.to_json
|
data/lib/aem/deploy/version.rb
CHANGED