aemninja 0.0.5 → 0.0.6

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
- SHA1:
3
- metadata.gz: ca9b1bf58ea5c5c6eee08d04670f6226f16164ac
4
- data.tar.gz: 39a30adff9629a81c70606ae534aa912fef830d3
2
+ SHA256:
3
+ metadata.gz: 3574244789cd5443c5f92d775d7eff07a6591ede542ce354a1a2d9d59b11dd92
4
+ data.tar.gz: ab75a1c8b34e9b9c15bc42ca78b652cf6e0b03a33a23375252e92fe5fca4ddf0
5
5
  SHA512:
6
- metadata.gz: 49cda43f406bd4d6f4c0bb4888f1e3474fda0f7cf2bfcdcdabfc5562f1f3b8cd3c0709c2cf2639be5313bdb06e533989d74532938f37ce62eec11e52e5cf35a1
7
- data.tar.gz: 3f27ac3d688a579c0b6e588e77bdecb0f76d98c80c495f6d3de91aee33e325aa634b21eabfd45f1b10525c88a1328d9ac4624c4bb2ad1c397f6621b22b968188
6
+ metadata.gz: c624fccae469b96bd6c13a6fe7a72bc5029886fe7dd7bf6c9fea028b8c38225c806268cbb120f4649414e29f6792e95717e851f4311897666564ff24018f95f0
7
+ data.tar.gz: fff7d52159fd545696ee5269127c05c7fc88a98b775b40bfc833d43bd3589d1bbb97703f6230da55be344ac6e74b9c968eee22fc6cfcbf81e36dca9cccc15171
@@ -0,0 +1,20 @@
1
+ name: Ruby
2
+
3
+ on: [push]
4
+
5
+ jobs:
6
+ build:
7
+
8
+ runs-on: ubuntu-latest
9
+
10
+ steps:
11
+ - uses: actions/checkout@v1
12
+ - name: Set up Ruby 2.6.5
13
+ uses: actions/setup-ruby@v1
14
+ with:
15
+ ruby-version: 2.6.5
16
+ - name: Build and test with Rake
17
+ run: |
18
+ gem install bundler
19
+ bundle install --jobs 4 --retry 3
20
+ bundle exec rake
data/.gitignore CHANGED
@@ -1,2 +1,3 @@
1
1
  *.gem
2
- .idea
2
+ .idea
3
+ .aemninja
@@ -1 +1 @@
1
- 2.4.0
1
+ 2.6.5
data/Gemfile CHANGED
@@ -1,5 +1,5 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
- ruby "2.4.1"
3
+ ruby "2.6.5"
4
4
  # Specify your gem's dependencies in aemninja.gemspec
5
5
  gemspec
@@ -1,65 +1,69 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- aemninja (0.0.2)
4
+ aemninja (0.0.5)
5
5
  activesupport (~> 4.2)
6
6
  rest-client (~> 2.0)
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
- activesupport (4.2.9)
11
+ activesupport (4.2.11.1)
12
12
  i18n (~> 0.7)
13
13
  minitest (~> 5.1)
14
14
  thread_safe (~> 0.3, >= 0.3.4)
15
15
  tzinfo (~> 1.1)
16
- addressable (2.5.2)
17
- public_suffix (>= 2.0.2, < 4.0)
16
+ addressable (2.7.0)
17
+ public_suffix (>= 2.0.2, < 5.0)
18
+ concurrent-ruby (1.1.5)
18
19
  crack (0.4.3)
19
20
  safe_yaml (~> 1.0.0)
20
- domain_name (0.5.20170404)
21
+ domain_name (0.5.20190701)
21
22
  unf (>= 0.0.5, < 1.0.0)
22
- hashdiff (0.3.6)
23
+ hashdiff (1.0.0)
24
+ http-accept (1.7.0)
23
25
  http-cookie (1.0.3)
24
26
  domain_name (~> 0.5)
25
- i18n (0.8.6)
26
- mime-types (3.1)
27
+ i18n (0.9.5)
28
+ concurrent-ruby (~> 1.0)
29
+ mime-types (3.3)
27
30
  mime-types-data (~> 3.2015)
28
- mime-types-data (3.2016.0521)
29
- minitest (5.10.3)
31
+ mime-types-data (3.2019.1009)
32
+ minitest (5.13.0)
30
33
  netrc (0.11.0)
31
- public_suffix (3.0.0)
32
- rake (10.4.2)
33
- rest-client (2.0.2)
34
+ public_suffix (4.0.1)
35
+ rake (10.5.0)
36
+ rest-client (2.1.0)
37
+ http-accept (>= 1.7.0, < 2.0)
34
38
  http-cookie (>= 1.0.2, < 2.0)
35
39
  mime-types (>= 1.16, < 4.0)
36
40
  netrc (~> 0.8)
37
- safe_yaml (1.0.4)
41
+ safe_yaml (1.0.5)
38
42
  thread_safe (0.3.6)
39
- tzinfo (1.2.3)
43
+ tzinfo (1.2.5)
40
44
  thread_safe (~> 0.1)
41
45
  unf (0.1.4)
42
46
  unf_ext
43
- unf_ext (0.0.7.4)
47
+ unf_ext (0.0.7.6)
44
48
  vcr (3.0.3)
45
- webmock (3.0.1)
49
+ webmock (3.7.6)
46
50
  addressable (>= 2.3.6)
47
51
  crack (>= 0.3.2)
48
- hashdiff
52
+ hashdiff (>= 0.4.0, < 2.0.0)
49
53
 
50
54
  PLATFORMS
51
55
  ruby
52
56
 
53
57
  DEPENDENCIES
54
58
  aemninja!
55
- bundler (~> 1.13)
59
+ bundler (~> 2.0.2)
56
60
  minitest (~> 5.8)
57
61
  rake (~> 10.0)
58
62
  vcr (~> 3.0)
59
63
  webmock (~> 3.0)
60
64
 
61
65
  RUBY VERSION
62
- ruby 2.4.1p111
66
+ ruby 2.6.5p114
63
67
 
64
68
  BUNDLED WITH
65
- 1.15.4
69
+ 2.0.2
data/README.md CHANGED
@@ -28,6 +28,7 @@
28
28
  $ aemninja deploy apps/target/your-magic-project.zip production
29
29
 
30
30
 
31
+ # FAQ
31
32
  ## But how does it now the details about my environments?
32
33
 
33
34
  * .aemninja/config/environments/local.rb
@@ -40,6 +41,19 @@ Sure! It's as easy as adding another config file to the environments directory.
40
41
 
41
42
  ### New Environment called 'qa'
42
43
  1. Copy existing config file
44
+
43
45
  $ cp .aemninja/config/environments/local.rb .aemninja/config/environments/qa.rb
44
46
 
45
47
  2. Change the configuration to match your qa environment
48
+
49
+ Aemninja.configure do |config|
50
+ config.instances = {
51
+ author: { host: "qa-author.example.com", user: "admin", password: "secret_password"},
52
+ publish: { host: "qa-publish.example.com", user: "admin", password: "secret_password"}
53
+ }
54
+ end
55
+
56
+ 2. Deploy
57
+
58
+ $ aemninja deploy apps/target/your-magic-project.zip qa
59
+
@@ -7,11 +7,11 @@ Gem::Specification.new do |spec|
7
7
  spec.name = "aemninja"
8
8
  spec.version = Aemninja::VERSION
9
9
  spec.authors = ["AEMNinja"]
10
- spec.email = ["info@aemninja.com"]
10
+ spec.email = ["info@lean.delivery"]
11
11
 
12
12
  spec.summary = %q{AEM scripting Gem}
13
13
  spec.description = %q{Reduces complexity of AEM deployments.}
14
- spec.homepage = "https://gitlab.com/aemninja/aemninja"
14
+ spec.homepage = "https://github.com/Lean-Delivery-AG/aemninja_rubygem"
15
15
  spec.license = "MIT"
16
16
 
17
17
  # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
@@ -32,7 +32,7 @@ Gem::Specification.new do |spec|
32
32
 
33
33
  spec.add_runtime_dependency "activesupport", "~> 4.2"
34
34
  spec.add_runtime_dependency "rest-client", "~> 2.0"
35
- spec.add_development_dependency "bundler", "~> 1.13"
35
+ spec.add_development_dependency "bundler", "~> 2.0.2"
36
36
  spec.add_development_dependency "rake", "~> 10.0"
37
37
  spec.add_development_dependency "minitest", "~> 5.8"
38
38
  spec.add_development_dependency "vcr", "~> 3.0"
@@ -17,6 +17,9 @@ if command == "deploy" then
17
17
  elsif command == "init" then
18
18
  aemninja.init!
19
19
 
20
+ elsif command == "list" then
21
+ aemninja.list!
22
+
20
23
  else
21
24
  aemninja.no_valid_command
22
25
  end
@@ -1,2 +1,2 @@
1
1
  gem build aemninja.gemspec
2
- gem install aemninja-0.0.3.gem
2
+ gem install aemninja-0.0.5.gem
@@ -84,6 +84,30 @@ module Aemninja
84
84
 
85
85
  end
86
86
 
87
+ def list!(environment='local')
88
+ puts "--------------------------------------------------------"
89
+ puts "Deployment to \'#{environment}\' environment"
90
+ puts "--------------------------------------------------------"
91
+ puts
92
+ puts "Configuration: .aemninja/config/environments/#{environment}.rb"
93
+ puts
94
+
95
+ require "./.aemninja/config/environments/#{environment}.rb"
96
+
97
+ Aemninja.configuration.instances.each do |key, array|
98
+ host = array[:host]
99
+ user = array[:user]
100
+ password = array[:password]
101
+
102
+ puts
103
+ puts key.to_s + " [" + host + "]"
104
+
105
+ Aem::list host, user, password
106
+
107
+ end
108
+ end
109
+
110
+
87
111
  def deploy!(package, environment='local')
88
112
 
89
113
  # Read Environment from Config File
@@ -1,3 +1,4 @@
1
+ require 'base64'
1
2
  require 'json'
2
3
  require 'rest-client'
3
4
  require 'active_support/core_ext/hash'
@@ -33,8 +34,21 @@ module Aem
33
34
  #
34
35
  # returns adobe/aem6/sample/we.retail.download-1.0.8.zip
35
36
  #
37
+ def self.list host="localhost:4502", user="admin", password="admin"
38
+ # puts user
39
+ # puts password
40
+ # puts "#{user}:#{password}"
41
+ auth = Base64.strict_encode64("#{user}:#{password}")
42
+ # puts auth
43
+ response_xml = RestClient.get "#{host}/crx/packmgr/service.jsp", {params: {cmd: 'ls'}, Authorization: "Basic #{auth}"}
44
+
45
+ puts response_xml
46
+ end
47
+
36
48
  def self.is_package_installed? host="localhost:4502", user="admin", password="admin", package
37
- response_xml = RestClient.get "#{user}:#{password}@#{host}/crx/packmgr/service.jsp", {params: {cmd: 'ls'}}
49
+ auth = Base64.strict_encode64("#{user}:#{password}")
50
+
51
+ response_xml = RestClient.get "#{host}/crx/packmgr/service.jsp", {params: {cmd: 'ls'}, Authorization: "Basic #{auth}"}
38
52
 
39
53
  response_hash = Hash.from_xml(response_xml.body)
40
54
 
@@ -50,24 +64,30 @@ module Aem
50
64
  end
51
65
 
52
66
  def self.uninstall host="localhost:4502", user="admin", password="admin", package
67
+ auth = Base64.strict_encode64("#{user}:#{password}")
53
68
  request = RestClient::Request.new(
54
- :method => :post,
55
- :url => "#{user}:#{password}@#{host}/crx/packmgr/service/.json/etc/packages/#{package}",
56
- :payload => {
57
- :cmd => 'uninstall'
58
- })
69
+ :method => :post,
70
+ :url => "#{host}/crx/packmgr/service/.json/etc/packages/#{package}",
71
+ :payload => {
72
+ :cmd => 'uninstall'
73
+ },
74
+ :headers => {Authorization: "Basic #{auth}"}
75
+ )
59
76
  response = request.execute
60
77
 
61
78
  JSON.parse(response)["success"]
62
79
  end
63
80
 
64
81
  def self.delete host="localhost:4502", user="admin", password="admin", package
82
+ auth = Base64.strict_encode64("#{user}:#{password}")
65
83
  request = RestClient::Request.new(
66
84
  :method => :post,
67
- :url => "#{user}:#{password}@#{host}/crx/packmgr/service/.json/etc/packages/#{package}",
85
+ :url => "#{host}/crx/packmgr/service/.json/etc/packages/#{package}",
68
86
  :payload => {
69
87
  :cmd => 'delete'
70
- })
88
+ },
89
+ :headers => {Authorization: "Basic #{auth}"}
90
+ )
71
91
  response = request.execute
72
92
 
73
93
  JSON.parse(response)["success"]
@@ -76,18 +96,20 @@ module Aem
76
96
 
77
97
 
78
98
  def self.install host="localhost:4502", user="admin", password="admin", package
99
+ auth = Base64.strict_encode64("#{user}:#{password}")
79
100
  stripped_pkg = Aemninja::Helpers::remove_path_and_version_from package
80
101
  request = RestClient::Request.new(
81
-
82
102
  :method => :post,
83
- :url => "#{user}:#{password}@#{host}/crx/packmgr/service.jsp",
103
+ :url => "@#{host}/crx/packmgr/service.jsp",
84
104
  :payload => {
85
105
  :multipart => true,
86
106
  :file => File.new(package, 'rb'),
87
107
  :name => stripped_pkg,
88
108
  :force => true,
89
109
  :install => true
90
- })
110
+ },
111
+ :headers => {Authorization: "Basic #{auth}"}
112
+ )
91
113
  response_xml = request.execute
92
114
 
93
115
  #response_hash = Hash.from_xml(response_xml.body)
@@ -1,3 +1,3 @@
1
1
  module Aemninja
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aemninja
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - AEMNinja
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-09-12 00:00:00.000000000 Z
11
+ date: 2019-12-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '1.13'
47
+ version: 2.0.2
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '1.13'
54
+ version: 2.0.2
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rake
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -110,12 +110,13 @@ dependencies:
110
110
  version: '3.0'
111
111
  description: Reduces complexity of AEM deployments.
112
112
  email:
113
- - info@aemninja.com
113
+ - info@lean.delivery
114
114
  executables:
115
115
  - aemninja
116
116
  extensions: []
117
117
  extra_rdoc_files: []
118
118
  files:
119
+ - ".github/workflows/ruby.yml"
119
120
  - ".gitignore"
120
121
  - ".gitlab-ci.yml"
121
122
  - ".ruby-version"
@@ -135,7 +136,7 @@ files:
135
136
  - lib/aemninja/helpers.rb
136
137
  - lib/aemninja/usage.rb
137
138
  - lib/aemninja/version.rb
138
- homepage: https://gitlab.com/aemninja/aemninja
139
+ homepage: https://github.com/Lean-Delivery-AG/aemninja_rubygem
139
140
  licenses:
140
141
  - MIT
141
142
  metadata: {}
@@ -154,8 +155,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
154
155
  - !ruby/object:Gem::Version
155
156
  version: '0'
156
157
  requirements: []
157
- rubyforge_project:
158
- rubygems_version: 2.6.13
158
+ rubygems_version: 3.0.3
159
159
  signing_key:
160
160
  specification_version: 4
161
161
  summary: AEM scripting Gem