capistrano-karaf 1.1.0 → 1.2.0
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 +4 -4
- data/lib/capistrano-karaf.rb +43 -20
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ef0e08765fe3c86715be70affc4055105446ba12
|
4
|
+
data.tar.gz: 2035db8bf22c1d7fbe6a8018e30d8fbc104cdf75
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 56d9bc7ee59811c66c1b3b03833421ecd7a3ee87cc77e9be5dd3b7dbc392eaf99974730d04b30919bec98cc9a35b736b59756ddf15c8aa83a82d541a08626cf6
|
7
|
+
data.tar.gz: 3faff81ac8518e9602647bbada6cbf14fd1faf2d4206c2eec91511de8a9c7aea6e193bf40a4d6e82fd6d4513a69126115c988c03dcada5f9075b5e33714d0713
|
data/lib/capistrano-karaf.rb
CHANGED
@@ -1,15 +1,16 @@
|
|
1
1
|
require 'sshkit'
|
2
2
|
|
3
|
-
SSHKit.config.command_map =
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
3
|
+
SSHKit.config.command_map[:features_addurl] = 'features:addurl'
|
4
|
+
SSHKit.config.command_map[:features_removeurl] = 'features:removeurl'
|
5
|
+
SSHKit.config.command_map[:features_refreshurl] = 'features:refreshurl'
|
6
|
+
SSHKit.config.command_map[:features_install] = 'features:install'
|
7
|
+
SSHKit.config.command_map[:features_list] = 'features:list'
|
8
|
+
SSHKit.config.command_map[:features_info] = 'features:info'
|
9
|
+
SSHKit.config.command_map[:headers] = 'headers'
|
10
|
+
SSHKit.config.command_map[:list] = 'list'
|
11
|
+
SSHKit.config.command_map[:log_set] = 'log:set'
|
12
|
+
SSHKit.config.command_map[:stop] = 'osgi:stop'
|
13
|
+
SSHKit.config.command_map[:start] = 'osgi:start'
|
13
14
|
|
14
15
|
def add_url (url)
|
15
16
|
execute(:features_addurl, url)
|
@@ -19,6 +20,10 @@ def remove_url (url)
|
|
19
20
|
execute(:features_removeurl, url)
|
20
21
|
end
|
21
22
|
|
23
|
+
def features_refreshurl
|
24
|
+
execute(:features_refreshurl)
|
25
|
+
end
|
26
|
+
|
22
27
|
def feature_install (name)
|
23
28
|
execute(:features_install, name)
|
24
29
|
end
|
@@ -27,25 +32,43 @@ def feature_uninstall (name)
|
|
27
32
|
execute(:features_uninstall, name)
|
28
33
|
end
|
29
34
|
|
35
|
+
def log_set (level)
|
36
|
+
execute(:log_set, level)
|
37
|
+
end
|
38
|
+
|
39
|
+
def start (bundleId)
|
40
|
+
execute(:start, bundleId)
|
41
|
+
end
|
42
|
+
|
43
|
+
def stop (bundleId)
|
44
|
+
execute(:stop, bundleId)
|
45
|
+
end
|
46
|
+
|
47
|
+
def fragment_bundle? (bundleId)
|
48
|
+
headers = capture(:headers)
|
49
|
+
headers.lines.any? {|l| l.match('^Fragment-Host.*')}
|
50
|
+
end
|
51
|
+
|
30
52
|
def list_bundles ()
|
31
|
-
bundle_line_matcher =
|
53
|
+
bundle_line_matcher = %r{(?<id> \d+){0}
|
54
|
+
(?<status> \w+){0}
|
55
|
+
(?<context> \w*){0}
|
56
|
+
(?<level> \d+){0}
|
57
|
+
(?<name> [\w\s\-\:]+){0}
|
58
|
+
(?<version> .+){0}
|
32
59
|
|
33
|
-
|
60
|
+
^\[\s*\g<id>\]\s\[\s*\g<status>\s*\]\s\[\s{12}\]\s\[\s*\g<context>\s*\]\s\[\s*\g<level>\s*\]\s\g<name>\s\(\g<version>\)
|
61
|
+
}x
|
62
|
+
|
34
63
|
data = capture(:list)
|
35
64
|
bundles = []
|
36
65
|
data.lines.each do |line|
|
37
66
|
m = bundle_line_matcher.match(line)
|
38
67
|
if m then
|
39
|
-
bundles.push(
|
40
|
-
:status => m['BundleStatus'],
|
41
|
-
:context => m['ContextStatus'],
|
42
|
-
:level => m['BundleLevel'],
|
43
|
-
:name => m['BundleName'],
|
44
|
-
:version => m['BundleVersion']
|
45
|
-
})
|
68
|
+
bundles.push(m)
|
46
69
|
end
|
47
|
-
bundles
|
48
70
|
end
|
71
|
+
bundles
|
49
72
|
end
|
50
73
|
|
51
74
|
def started? (name)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: capistrano-karaf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brecht Hoflack
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-12-03 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description:
|
14
14
|
email: brecht.hoflack@gmail.com
|