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 +5 -5
- data/.github/workflows/ruby.yml +20 -0
- data/.gitignore +2 -1
- data/.ruby-version +1 -1
- data/Gemfile +1 -1
- data/Gemfile.lock +25 -21
- data/README.md +14 -0
- data/aemninja.gemspec +3 -3
- data/bin/aemninja +3 -0
- data/build_and_install.sh +1 -1
- data/lib/aemninja.rb +24 -0
- data/lib/aemninja/aem.rb +33 -11
- data/lib/aemninja/version.rb +1 -1
- metadata +8 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 3574244789cd5443c5f92d775d7eff07a6591ede542ce354a1a2d9d59b11dd92
|
4
|
+
data.tar.gz: ab75a1c8b34e9b9c15bc42ca78b652cf6e0b03a33a23375252e92fe5fca4ddf0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.
|
1
|
+
2.6.5
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,65 +1,69 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
aemninja (0.0.
|
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.
|
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.
|
17
|
-
public_suffix (>= 2.0.2, <
|
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.
|
21
|
+
domain_name (0.5.20190701)
|
21
22
|
unf (>= 0.0.5, < 1.0.0)
|
22
|
-
hashdiff (0.
|
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.
|
26
|
-
|
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.
|
29
|
-
minitest (5.
|
31
|
+
mime-types-data (3.2019.1009)
|
32
|
+
minitest (5.13.0)
|
30
33
|
netrc (0.11.0)
|
31
|
-
public_suffix (
|
32
|
-
rake (10.
|
33
|
-
rest-client (2.0
|
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.
|
41
|
+
safe_yaml (1.0.5)
|
38
42
|
thread_safe (0.3.6)
|
39
|
-
tzinfo (1.2.
|
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.
|
47
|
+
unf_ext (0.0.7.6)
|
44
48
|
vcr (3.0.3)
|
45
|
-
webmock (3.
|
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 (~>
|
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.
|
66
|
+
ruby 2.6.5p114
|
63
67
|
|
64
68
|
BUNDLED WITH
|
65
|
-
|
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
|
+
|
data/aemninja.gemspec
CHANGED
@@ -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@
|
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://
|
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", "~>
|
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"
|
data/bin/aemninja
CHANGED
data/build_and_install.sh
CHANGED
@@ -1,2 +1,2 @@
|
|
1
1
|
gem build aemninja.gemspec
|
2
|
-
gem install aemninja-0.0.
|
2
|
+
gem install aemninja-0.0.5.gem
|
data/lib/aemninja.rb
CHANGED
@@ -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
|
data/lib/aemninja/aem.rb
CHANGED
@@ -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
|
-
|
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
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
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 => "#{
|
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 => "
|
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)
|
data/lib/aemninja/version.rb
CHANGED
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.
|
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:
|
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:
|
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:
|
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@
|
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://
|
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
|
-
|
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
|