aem-deploy 0.1.21 → 0.1.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 00d161e698505cb816894d1a1adfe245c8ce7af6
4
- data.tar.gz: 08385dc3f0a63deebe4ef05a46b13624d1d7aaa4
3
+ metadata.gz: f252fe3a7e3bc0165af8f1a1e35a114229ab6789
4
+ data.tar.gz: dde7a85cc96521e70877abb76ef73473f9d8a7c7
5
5
  SHA512:
6
- metadata.gz: 230a32ad5623530da82a0ee682a337aa8c3dfbd401fe02611f60f430b451f971e2a59085ae7fc98a7c99687dc01062cdb84d3b1cae5df081755e7cee888ee9d7
7
- data.tar.gz: 6262461678e1f881241a4fcd7c4fde6a7d707f945f8e36b376f9be223f443c4473f36caecd34fa28c01388b53d3aa793cfdf0b27bcdb7814a01d43479223c01d
6
+ metadata.gz: ba7394819347e07f2254692f12f3697814dbc397384c3fde0be95278db54c3a91ca25ef6bbdbb2f5a064394dd354f12466d1060565f442fe3c8244fc2dd8ab92
7
+ data.tar.gz: f536335e2d498f81832e1ba8277477f82413dd5a6043778402947b341d8ac31e1e05ed5bf8f6a17d7c511e92ac1211b444f816dfa1c411e6918201e53b779d5f
@@ -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
- 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} )
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
- install = RestClient::Request.execute(method: :post, url: "#{@protocol}://#{@user}:#{@pass}@#{@host}/crx/packmgr/service/.json#{@upload_path}", payload: {cmd: 'install'} )
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
@@ -1,5 +1,5 @@
1
1
  module Aem
2
2
  module Deploy
3
- VERSION = "0.1.21"
3
+ VERSION = "0.1.22"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aem-deploy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.21
4
+ version: 0.1.22
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mitch Eaton