kpm 0.0.2 → 0.0.3

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: 3d5ca5c072ac36556d07be40f72f57095c0f9117
4
- data.tar.gz: a86dc79c2b6560fdb6090eb5b3ffb2a23452db2d
3
+ metadata.gz: 43e527407d6c92cbe6b794e40a664d2aaf4d50e6
4
+ data.tar.gz: 05be0ce0caea3d53da35adf9a6198a1ca7b21b9d
5
5
  SHA512:
6
- metadata.gz: 518eb5300bef6175b10e414830ed73fb339dd03d61705d6007e60aed3f0e19b6948d185706c8f79de2da653f229d880ba99adb6f993da943976eb9b1cac1d0de
7
- data.tar.gz: e15d1dd9571d85927713032cdf1d90e0825e28eafe27653de3d39ae58782d4da12a24ababbcf8d19a80ff874a5c99a80667d13418b5e4caebcd485d3701b2c9c
6
+ metadata.gz: ef5a9532ff24c1c12d8930787c40c1746719f2df58c34a6890a5faf6df76e99ee2e9051ff5666f7dfe9df1a0b71c3ef5f03037ae2d0fa93835c120bd83357bbd
7
+ data.tar.gz: acc1fae6313f28e7505883dfed5348e0d7544da63b9a6a2ab94ae6de3e1ade9e157ca184e04ceada723926cd5227fc7b1e404d3feac071ed8b91ed75c76a27e3
data/.gemrelease ADDED
@@ -0,0 +1,3 @@
1
+ bump:
2
+ tag: true
3
+ release: true
data/install_example.yml CHANGED
@@ -19,3 +19,11 @@ killbill:
19
19
  # You can use https://github.com/reidmorrison/symmetric-encryption for encryption
20
20
  #username: bob
21
21
  #password: bob
22
+ kaui:
23
+ # If no version is specified, LATEST is assumed
24
+ version: LATEST
25
+ webapp_path: /var/tmp/tomcat/webapps/kaui
26
+ nexus:
27
+ ssl_verify: false
28
+ url: https://repository.sonatype.org
29
+ repository: central-proxy
data/kpm.gemspec CHANGED
@@ -19,7 +19,7 @@ require 'kpm/version'
19
19
 
20
20
  Gem::Specification.new do |s|
21
21
  s.name = 'kpm'
22
- s.version = KPM::Version.to_s
22
+ s.version = KPM::VERSION
23
23
  s.summary = 'Kill Bill package manager.'
24
24
  s.description = 'A package manager for Kill Bill.'
25
25
 
data/lib/kpm.rb CHANGED
@@ -3,6 +3,7 @@ module KPM
3
3
  autoload :BaseArtifact, 'kpm/base_artifact'
4
4
  autoload :KillbillServerArtifact, 'kpm/killbill_server_artifact'
5
5
  autoload :KillbillPluginArtifact, 'kpm/killbill_plugin_artifact'
6
+ autoload :KauiArtifact, 'kpm/kaui_artifact'
6
7
  autoload :Installer, 'kpm/installer'
7
8
  autoload :Tasks, 'kpm/tasks'
8
9
  autoload :Cli, 'kpm/cli'
data/lib/kpm/installer.rb CHANGED
@@ -10,8 +10,9 @@ module KPM
10
10
  end
11
11
 
12
12
  def initialize(raw_config, logger=nil)
13
- raise(ArgumentError, 'killbill section must be specified') if raw_config['killbill'].nil?
13
+ raise(ArgumentError, 'killbill or kaui section must be specified') if raw_config['killbill'].nil? and raw_config['kaui'].nil?
14
14
  @config = raw_config['killbill']
15
+ @kaui_config = raw_config['kaui']
15
16
 
16
17
  if logger.nil?
17
18
  @logger = Logger.new(STDOUT)
@@ -22,9 +23,14 @@ module KPM
22
23
  end
23
24
 
24
25
  def install
25
- install_killbill_server
26
- install_plugins
27
- install_default_bundles
26
+ unless @config.nil?
27
+ install_killbill_server
28
+ install_plugins
29
+ install_default_bundles
30
+ end
31
+ unless @kaui_config.nil?
32
+ install_kaui
33
+ end
28
34
  end
29
35
 
30
36
  private
@@ -101,5 +107,17 @@ module KPM
101
107
  # The special JRuby bundle needs to be called jruby.jar
102
108
  File.rename Dir.glob("#{destination}/killbill-osgi-bundles-jruby-*.jar").first, "#{destination}/jruby.jar"
103
109
  end
110
+
111
+ def install_kaui
112
+ version = @kaui_config['version'] || LATEST_VERSION
113
+ webapp_path = @kaui_config['webapp_path'] || KPM::root
114
+
115
+ webapp_dir = File.dirname(webapp_path)
116
+ FileUtils.mkdir_p(webapp_dir)
117
+
118
+ @logger.info "Installing Kaui #{version} to #{webapp_path}"
119
+ file = KauiArtifact.pull(version, webapp_dir, @kaui_config['nexus'], @kaui_config['nexus']['ssl_verify'])
120
+ FileUtils.mv file[:file_path], webapp_path
121
+ end
104
122
  end
105
123
  end
@@ -0,0 +1,21 @@
1
+ require 'rexml/document'
2
+ require 'set'
3
+
4
+ module KPM
5
+ class KauiArtifact < BaseArtifact
6
+ class << self
7
+ KAUI_WAR = "org.kill-bill.billing.kaui:kaui-standalone:war"
8
+
9
+ def pull(version='LATEST', destination=nil, overrides={}, ssl_verify=true)
10
+ nexus_remote(overrides, ssl_verify).pull_artifact("#{KAUI_WAR}:#{version}", destination)
11
+ end
12
+
13
+ def versions(overrides={}, ssl_verify=true)
14
+ response = REXML::Document.new nexus_remote(overrides, ssl_verify).search_for_artifacts(KAUI_WAR)
15
+ versions = SortedSet.new
16
+ response.elements.each("search-results/data/artifact/version") { |element| versions << element.text }
17
+ versions
18
+ end
19
+ end
20
+ end
21
+ end
data/lib/kpm/tasks.rb CHANGED
@@ -71,6 +71,21 @@ module KPM
71
71
 
72
72
  say result, :green
73
73
  end
74
+
75
+ method_option :destination,
76
+ :type => :string,
77
+ :default => nil,
78
+ :desc => "A different folder other than the current working directory."
79
+ desc "pull_kaui_war version", "Pulls Kaui war from Sonatype and places it on your machine."
80
+ def pull_kaui_war(version='LATEST')
81
+ response = KauiArtifact.pull(version, options[:destination], options[:overrides], options[:ssl_verify])
82
+ say "Artifact has been retrieved and can be found at path: #{response[:file_path]}", :green
83
+ end
84
+
85
+ desc "search_for_kaui", "Searches for all versions of Kaui and prints them to the screen."
86
+ def search_for_kaui
87
+ say "Available versions: #{KauiArtifact.versions(options[:overrides], options[:ssl_verify]).to_a.join(', ')}", :green
88
+ end
74
89
  end
75
90
  end
76
91
  end
data/lib/kpm/version.rb CHANGED
@@ -1,18 +1,3 @@
1
1
  module KPM
2
- module Version
3
- MAJOR = 0
4
- MINOR = 0
5
- PATCH = 2
6
- PRE = nil
7
-
8
- VERSION = [MAJOR, MINOR, PATCH, PRE].compact.join('.').freeze
9
-
10
- class << self
11
- def inspect
12
- VERSION.dup
13
- end
14
-
15
- alias to_s inspect
16
- end
17
- end
2
+ VERSION = '0.0.3'
18
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kpm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kill Bill core team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-04-02 00:00:00.000000000 Z
11
+ date: 2014-04-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: highline
@@ -87,6 +87,7 @@ executables:
87
87
  extensions: []
88
88
  extra_rdoc_files: []
89
89
  files:
90
+ - ".gemrelease"
90
91
  - ".gitignore"
91
92
  - Gemfile
92
93
  - Rakefile
@@ -97,6 +98,7 @@ files:
97
98
  - lib/kpm/base_artifact.rb
98
99
  - lib/kpm/cli.rb
99
100
  - lib/kpm/installer.rb
101
+ - lib/kpm/kaui_artifact.rb
100
102
  - lib/kpm/killbill_plugin_artifact.rb
101
103
  - lib/kpm/killbill_server_artifact.rb
102
104
  - lib/kpm/tasks.rb