kpm 0.11.0 → 0.11.1

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
2
  SHA256:
3
- metadata.gz: 8511e401669df3cf28d9ff916b158764238109c34e818a8221ee598c11d78750
4
- data.tar.gz: cc284e39cf1c3d5b2cf7ece8fc7cbc38d2853016c666378ff1127a6761d5a04d
3
+ metadata.gz: 92f89695b531e939275ac653417d228d51b897570504418032418797a56674bf
4
+ data.tar.gz: acd577c2a29a56c50c0daeacb09a62f7fcf6068650d1ba8ed2e527d6f9db2962
5
5
  SHA512:
6
- metadata.gz: 7f6e3965bfb2e4c32707d845add23ff06fe7eb7d3bd4550d94863f2ffa207049c578ba90dff1cac3d1609427a3a6ae010582e7fa8cec309a151e7fd1e595f18e
7
- data.tar.gz: 031a2b0f7da148e24b7a13ff90e6c023d3d381040d7de8161389ca9ac523487b64540ab6174c2d1aab2d110bcf19d6af4291b28eade76c4f2d6317303ae7c662
6
+ metadata.gz: c44713659fe2517572916f45722df1d6ae7b8d639cb24b227ba161386e104df0c2dcf3f38f7a735cfe0f399cbe5d791dc5802cda6a8a73ec791c5ba9853adfd7
7
+ data.tar.gz: fd47e470a0df6c75785383a45857a93909ff44d4464136a57ad3f4d27e9331a2b9d31cb4a08834885ee099292a7df5ea6ee9417bfa94fa3c93801114c3af15d3
data/.gitignore CHANGED
@@ -2,10 +2,12 @@ Gemfile.lock
2
2
  pkg
3
3
  packaging/tmp
4
4
  packaging/vendor
5
- kpm-*-linux-x86.tar.gz
6
5
  kpm-*-linux-x86_64.tar.gz
6
+ kpm-*-osx-arm64.tar.gz
7
7
  kpm-*-osx.tar.gz
8
- traveling-ruby-*.tar.gz
8
+ kpm-*-noarch.tar.gz
9
+ portable-ruby-*.tar.gz
10
+ jruby-dist-*-bin.tar.gz
9
11
  *.asc
10
12
  .rakeTasks
11
13
  pom.xml.versionsBackup
data/README.adoc CHANGED
@@ -38,24 +38,6 @@ gem install kpm
38
38
  [[kill-bill-installation]]
39
39
  === Kill Bill installation
40
40
 
41
- [[kpm-install]]
42
- ==== kpm install
43
-
44
- `kpm install` (with no argument) will setup https://github.com/killbill/killbill[Kill Bill] and https://github.com/killbill/killbill-admin-ui-standalone[Kaui] in your current directory, including:
45
-
46
- * http://tomcat.apache.org/[Tomcat] (open-source Java web server)
47
- * The Kill Bill application (war) is installed in the `./webapps` directory
48
- * The Kill Bill UI (Kaui war) is installed in the `./webapps` directory
49
- * Default OSGI bundles are installed in the `/var/tmp/bundles` directory
50
-
51
- To start Kill Bill, simply run
52
-
53
- ....
54
- ./bin/catalina.sh run
55
- ....
56
-
57
- You can then verify Kill Bill is running by going to http://127.0.0.1:8080/kaui.
58
-
59
41
  [[kpm-install-using-a-kpm.yml-file]]
60
42
  ==== kpm install Using A `kpm.yml` File
61
43
 
data/kpm.gemspec CHANGED
@@ -41,10 +41,10 @@ Gem::Specification.new do |s|
41
41
 
42
42
  s.rdoc_options << '--exclude' << '.'
43
43
 
44
- s.add_dependency 'highline', '~> 1.6.21'
44
+ s.add_dependency 'highline', '>= 1.6.21', '< 2.1.0'
45
45
  s.add_dependency 'killbill-client', '~> 3.2'
46
- s.add_dependency 'rubyzip', '~> 1.3.0'
47
- s.add_dependency 'thor', '~> 0.19.1'
46
+ s.add_dependency 'rubyzip', '>= 1.3', '< 2.4'
47
+ s.add_dependency 'thor', '>= 0.19.1', '< 1.3.0'
48
48
 
49
49
  s.add_development_dependency 'gem-release', '~> 2.2'
50
50
  s.add_development_dependency 'rake', '~> 13.0'
data/lib/kpm/installer.rb CHANGED
@@ -87,9 +87,9 @@ module KPM
87
87
  end
88
88
  bundles_dir ||= DEFAULT_BUNDLES_DIR
89
89
 
90
- help = nil
91
90
  unless @config.nil?
92
- help = install_tomcat if @config['webapp_path'].nil?
91
+ raise ArgumentError, "Aborting installation, no webapp_path specified in config: #{@config}" if @config['webapp_path'].nil?
92
+
93
93
  install_killbill_server(@config['group_id'], @config['artifact_id'], @config['packaging'], @config['classifier'], @config['version'], @config['webapp_path'], bundles_dir, force_download, verify_sha1)
94
94
  install_plugins(bundles_dir, @config['version'], force_download, verify_sha1)
95
95
  install_default_bundles(bundles_dir, @config['default_bundles_version'], @config['version'], force_download, verify_sha1) unless @config['default_bundles'] == false
@@ -105,26 +105,11 @@ module KPM
105
105
  install_kaui(@kaui_config['group_id'], @kaui_config['artifact_id'], @kaui_config['packaging'], @kaui_config['classifier'], @kaui_config['version'], @kaui_config['webapp_path'], bundles_dir, force_download, verify_sha1)
106
106
  end
107
107
 
108
- @trace_logger.add('help', nil, help)
109
108
  @trace_logger.to_json
110
109
  end
111
110
 
112
111
  private
113
112
 
114
- def install_tomcat(dir = Dir.pwd)
115
- # Download and unpack Tomcat
116
- manager = KPM::TomcatManager.new(dir, @logger)
117
- manager.download
118
-
119
- # Update main config
120
- root_war_path = manager.setup
121
- @config['webapp_path'] = root_war_path
122
- @kaui_config['webapp_path'] = Pathname.new(File.dirname(root_war_path)).join('kaui.war').to_s unless @kaui_config.nil?
123
-
124
- # Help message
125
- manager.help
126
- end
127
-
128
113
  def install_plugins(bundles_dir, raw_kb_version, force_download, verify_sha1)
129
114
  install_java_plugins(bundles_dir, raw_kb_version, force_download, verify_sha1)
130
115
  end
@@ -147,7 +147,7 @@ module KPM
147
147
  case response.code
148
148
  when '200'
149
149
  response.body
150
- when '301', '307'
150
+ when '301', '302', '307'
151
151
  location = response['Location']
152
152
  logger.debug { "Following redirect to #{location}" }
153
153
 
@@ -13,7 +13,7 @@
13
13
  :versions:
14
14
  :0.18: 4.2.5
15
15
  :0.20: 6.0.1
16
- :0.22: 7.2.3
16
+ :0.22: 7.2.7
17
17
  :avatax:
18
18
  :type: :java
19
19
  :versions:
@@ -80,4 +80,4 @@
80
80
  :stripe:
81
81
  :type: :java
82
82
  :versions:
83
- :0.22: 7.3.1
83
+ :0.22: 7.3.3
data/lib/kpm/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module KPM
4
- VERSION = '0.11.0'
4
+ VERSION = '0.11.1'
5
5
  end
data/lib/kpm.rb CHANGED
@@ -7,7 +7,6 @@ module KPM
7
7
  autoload :Formatter, 'kpm/formatter'
8
8
  autoload :Inspector, 'kpm/inspector'
9
9
  autoload :Sha1Checker, 'kpm/sha1_checker'
10
- autoload :TomcatManager, 'kpm/tomcat_manager'
11
10
  autoload :KillbillServerArtifact, 'kpm/killbill_server_artifact'
12
11
  autoload :KillbillPluginArtifact, 'kpm/killbill_plugin_artifact'
13
12
  autoload :KauiArtifact, 'kpm/kaui_artifact'
data/packaging/Gemfile CHANGED
@@ -3,7 +3,4 @@
3
3
  source 'https://rubygems.org'
4
4
 
5
5
  gem 'kpm', '~> VERSION'
6
-
7
- group :development do
8
- gem 'rake'
9
- end
6
+ gem 'rake'
data/packaging/kpm.sh CHANGED
@@ -11,4 +11,4 @@ unset BUNDLE_IGNORE_CONFIG
11
11
 
12
12
  # Run the actual app using the bundled Ruby interpreter, with Bundler activated.
13
13
  # See https://github.com/phusion/traveling-ruby/issues/58
14
- exec "$SELFDIR/lib/ruby/bin/ruby" -rbundler/setup -rreadline $SELFDIR/lib/vendor/ruby/2.*/bin/kpm $@
14
+ exec "$SELFDIR/lib/ruby/bin/ruby" -rbundler/setup -rreadline $SELFDIR/lib/vendor/*ruby/2.*/bin/kpm $@
data/pom.xml CHANGED
@@ -22,7 +22,7 @@
22
22
  <modelVersion>4.0.0</modelVersion>
23
23
  <groupId>org.kill-bill.billing.installer</groupId>
24
24
  <artifactId>kpm</artifactId>
25
- <version>0.11.0</version>
25
+ <version>0.11.1</version>
26
26
  <packaging>pom</packaging>
27
27
  <name>KPM</name>
28
28
  <description>KPM: the Kill Bill Package Manager</description>
@@ -147,11 +147,6 @@
147
147
  </goals>
148
148
  <configuration>
149
149
  <artifacts>
150
- <artifact>
151
- <file>kpm-${project.version}-linux-x86.tar.gz</file>
152
- <type>tar.gz</type>
153
- <classifier>linux-x86</classifier>
154
- </artifact>
155
150
  <artifact>
156
151
  <file>kpm-${project.version}-linux-x86_64.tar.gz</file>
157
152
  <type>tar.gz</type>
@@ -162,6 +157,16 @@
162
157
  <type>tar.gz</type>
163
158
  <classifier>osx</classifier>
164
159
  </artifact>
160
+ <artifact>
161
+ <file>kpm-${project.version}-osx-arm64.tar.gz</file>
162
+ <type>tar.gz</type>
163
+ <classifier>osx-arm64</classifier>
164
+ </artifact>
165
+ <artifact>
166
+ <file>kpm-${project.version}-noarch.tar.gz</file>
167
+ <type>tar.gz</type>
168
+ <classifier>noarch</classifier>
169
+ </artifact>
165
170
  </artifacts>
166
171
  </configuration>
167
172
  </execution>
data/tasks/package.rake CHANGED
@@ -9,33 +9,50 @@ PACKAGE_NAME = 'kpm'
9
9
  require './lib/kpm/version'
10
10
  VERSION = KPM::VERSION
11
11
 
12
- # See https://traveling-ruby.s3-us-west-2.amazonaws.com/list.html
13
- TRAVELING_RUBY_VERSION = '20150715-2.2.2'
12
+ # See https://www.jruby.org/download
13
+ JRUBY_VERSION = '9.3.4.0'
14
+ # See https://github.com/Homebrew/homebrew-portable-ruby/releases
15
+ HOMEBREW_PORTABLE_RUBY_VERSION = '2.6.8_1'
14
16
 
15
17
  # Remove unused files to reduce package size
16
18
  GEMS_PATH = 'packaging/vendor/ruby/*/gems/*/'
17
19
  REMOVE_FILES = %w[test tests spec README* CHANGE* Change* COPYING* LICENSE* MIT-LICENSE* doc docs examples ext/*/Makefile .gitignore .travis.yml].freeze
18
20
  REMOVE_EXTENSIONS = %w[*.md *.c *.h *.rl extconf.rb *.java *.class *.so *.o].freeze
19
21
 
22
+ NOARCH_TARGET = 'noarch'
23
+ LINUX_X86_TARGET = 'x86_64_linux'
24
+ OSX_X86_TARGET = 'el_capitan'
25
+ OSX_ARM_TARGET = 'arm64_big_sur'
26
+
20
27
  desc 'Package your app'
21
- task package: %w[package:linux:x86 package:linux:x86_64 package:osx]
28
+ task package: %w[package:noarch package:linux:x86_64 package:osx:x86_64 package:osx:arm64]
22
29
 
23
30
  namespace :package do
24
- namespace :linux do
25
- desc 'Package KPM for Linux x86'
26
- task x86: [:bundle_install, "packaging/traveling-ruby-#{TRAVELING_RUBY_VERSION}-linux-x86.tar.gz"] do
27
- create_package('linux-x86')
28
- end
31
+ desc 'Package KPM (noarch)'
32
+ task noarch: [:bundle_install, "packaging/jruby-dist-#{JRUBY_VERSION}-bin.tar.gz"] do
33
+ create_package(NOARCH_TARGET, 'noarch')
34
+ end
29
35
 
36
+ namespace :linux do
30
37
  desc 'Package KPM for Linux x86_64'
31
- task x86_64: [:bundle_install, "packaging/traveling-ruby-#{TRAVELING_RUBY_VERSION}-linux-x86_64.tar.gz"] do
32
- create_package('linux-x86_64')
38
+ task x86_64: [:bundle_install, "packaging/portable-ruby-#{HOMEBREW_PORTABLE_RUBY_VERSION}.#{LINUX_X86_TARGET}.bottle.tar.gz"] do
39
+ ensure_ruby_version
40
+ create_package(LINUX_X86_TARGET, 'linux-x86_64')
33
41
  end
34
42
  end
35
43
 
36
- desc 'Package KPM for OS X'
37
- task osx: [:bundle_install, "packaging/traveling-ruby-#{TRAVELING_RUBY_VERSION}-osx.tar.gz"] do
38
- create_package('osx')
44
+ namespace :osx do
45
+ desc 'Package KPM for OSX x86_64'
46
+ task x86_64: [:bundle_install, "packaging/portable-ruby-#{HOMEBREW_PORTABLE_RUBY_VERSION}.#{OSX_X86_TARGET}.bottle.tar.gz"] do
47
+ ensure_ruby_version
48
+ create_package(OSX_X86_TARGET, 'osx')
49
+ end
50
+
51
+ desc 'Package KPM for OSX arm64'
52
+ task arm64: [:bundle_install, "packaging/portable-ruby-#{HOMEBREW_PORTABLE_RUBY_VERSION}.#{OSX_ARM_TARGET}.bottle.tar.gz"] do
53
+ ensure_ruby_version
54
+ create_package(OSX_ARM_TARGET, 'osx-arm64')
55
+ end
39
56
  end
40
57
 
41
58
  desc 'Install gems to local directory'
@@ -43,15 +60,12 @@ namespace :package do
43
60
  # abort if version packaging does not exist on repository
44
61
  abort "KPM #{VERSION} does not exists in the repository." unless gem_exists?
45
62
 
46
- # Note! Must match TRAVELING_RUBY_VERSION above
47
- expected_ruby_version = TRAVELING_RUBY_VERSION.split('-')[-1]
48
- abort "You can only 'bundle install' using Ruby #{expected_ruby_version}, because that's what Traveling Ruby uses." if RUBY_VERSION !~ /#{Regexp.quote(expected_ruby_version)}/
49
63
  sh 'rm -rf packaging/tmp'
50
64
  sh 'mkdir -p packaging/tmp'
51
65
  sh 'cp packaging/Gemfile packaging/tmp/'
52
66
  sh "sed -i 's/VERSION/#{VERSION}/g' packaging/tmp/Gemfile"
53
67
 
54
- sh "rm -rf packaging/vendor/ruby/#{expected_ruby_version}/bundler" # if multiple clones of same repo, may load in wrong one
68
+ sh 'rm -rf packaging/vendor/ruby/2.*/bundler' # if multiple clones of same repo, may load in wrong one
55
69
 
56
70
  Bundler.with_clean_env do
57
71
  sh 'cd packaging/tmp && env BUNDLE_IGNORE_CONFIG=1 bundle install --path ../vendor --without development'
@@ -80,28 +94,42 @@ namespace :package do
80
94
  end
81
95
  end
82
96
 
83
- file "packaging/traveling-ruby-#{TRAVELING_RUBY_VERSION}-linux-x86.tar.gz" do
84
- download_runtime('linux-x86')
97
+ file "packaging/jruby-dist-#{JRUBY_VERSION}-bin.tar.gz" do
98
+ download_noarch_runtime
85
99
  end
86
100
 
87
- file "packaging/traveling-ruby-#{TRAVELING_RUBY_VERSION}-linux-x86_64.tar.gz" do
88
- download_runtime('linux-x86_64')
101
+ file "packaging/portable-ruby-#{HOMEBREW_PORTABLE_RUBY_VERSION}.#{LINUX_X86_TARGET}.bottle.tar.gz" do
102
+ download_portable_runtime(LINUX_X86_TARGET)
89
103
  end
90
104
 
91
- file "packaging/traveling-ruby-#{TRAVELING_RUBY_VERSION}-osx.tar.gz" do
92
- download_runtime('osx')
105
+ file "packaging/portable-ruby-#{HOMEBREW_PORTABLE_RUBY_VERSION}.#{OSX_X86_TARGET}.bottle.tar.gz" do
106
+ download_portable_runtime(OSX_X86_TARGET)
93
107
  end
94
108
 
95
- def create_package(target)
96
- package_dir = "#{PACKAGE_NAME}-#{VERSION}-#{target}"
109
+ file "packaging/portable-ruby-#{HOMEBREW_PORTABLE_RUBY_VERSION}.#{OSX_ARM_TARGET}.bottle.tar.gz" do
110
+ download_portable_runtime(OSX_ARM_TARGET)
111
+ end
112
+
113
+ def create_package(target, package_dir_suffix)
114
+ pom_version = %r{<version>(.*)</version>}.match(File.read("#{__dir__}/../pom.xml"))[1]
115
+ package_dir = "#{PACKAGE_NAME}-#{pom_version}-#{package_dir_suffix}"
97
116
  sh "rm -rf #{package_dir}"
98
117
  sh "mkdir -p #{package_dir}/lib/ruby"
99
- sh "tar -xzf packaging/traveling-ruby-#{TRAVELING_RUBY_VERSION}-#{target}.tar.gz -C #{package_dir}/lib/ruby"
118
+ if target == NOARCH_TARGET
119
+ sh "tar -xzf packaging/jruby-dist-#{JRUBY_VERSION}-bin.tar.gz -C #{package_dir}/lib/ruby --strip-components 1"
120
+ else
121
+ sh "tar -xzf packaging/portable-ruby-#{HOMEBREW_PORTABLE_RUBY_VERSION}.#{target}.bottle.tar.gz -C #{package_dir}/lib/ruby --strip-components 2"
122
+ end
100
123
 
101
124
  sh "cp packaging/kpm.sh #{package_dir}/kpm"
102
125
  sh "chmod +x packaging/kpm.sh #{package_dir}/kpm"
103
126
 
104
127
  sh "cp -pR packaging/vendor #{package_dir}/lib/"
128
+ if target == NOARCH_TARGET
129
+ # Need to tweak a few things to make it work with JRuby
130
+ sh "cp #{package_dir}/lib/ruby/bin/jruby #{package_dir}/lib/ruby/bin/ruby"
131
+ sh "mv #{package_dir}/lib/vendor/ruby #{package_dir}/lib/vendor/jruby"
132
+ end
105
133
 
106
134
  sh "cp packaging/Gemfile* #{package_dir}/lib/vendor/"
107
135
  sh "sed -i 's/VERSION/#{VERSION}/g' #{package_dir}/lib/vendor/Gemfile"
@@ -114,9 +142,14 @@ def create_package(target)
114
142
  sh "rm -rf #{package_dir}"
115
143
  end
116
144
 
117
- def download_runtime(target)
145
+ def download_noarch_runtime
146
+ sh 'mkdir -p packaging && cd packaging && curl -L -O --fail ' \
147
+ "https://repo1.maven.org/maven2/org/jruby/jruby-dist/#{JRUBY_VERSION}/jruby-dist-#{JRUBY_VERSION}-bin.tar.gz"
148
+ end
149
+
150
+ def download_portable_runtime(target)
118
151
  sh 'mkdir -p packaging && cd packaging && curl -L -O --fail ' \
119
- "https://d6r77u77i8pq3.cloudfront.net/releases/traveling-ruby-#{TRAVELING_RUBY_VERSION}-#{target}.tar.gz"
152
+ "https://github.com/Homebrew/homebrew-portable-ruby/releases/download/#{HOMEBREW_PORTABLE_RUBY_VERSION}/portable-ruby-#{HOMEBREW_PORTABLE_RUBY_VERSION}.#{target}.bottle.tar.gz"
120
153
  end
121
154
 
122
155
  def gem_exists?
@@ -126,3 +159,9 @@ def gem_exists?
126
159
  specification = YAML.load(response)
127
160
  specification.instance_of?(Gem::Specification)
128
161
  end
162
+
163
+ def ensure_ruby_version
164
+ # Note! Must match HOMEBREW_PORTABLE_RUBY_VERSION above
165
+ expected_ruby_version = HOMEBREW_PORTABLE_RUBY_VERSION.split('_')[0]
166
+ abort "You can only 'bundle install' using Ruby #{expected_ruby_version}, because that's what homebrew-portable-ruby uses." if RUBY_VERSION !~ /#{Regexp.quote(expected_ruby_version)}/
167
+ end
metadata CHANGED
@@ -1,29 +1,35 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kpm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.0
4
+ version: 0.11.1
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: 2022-05-18 00:00:00.000000000 Z
11
+ date: 2022-12-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: highline
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: 1.6.21
20
+ - - "<"
21
+ - !ruby/object:Gem::Version
22
+ version: 2.1.0
20
23
  type: :runtime
21
24
  prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
23
26
  requirements:
24
- - - "~>"
27
+ - - ">="
25
28
  - !ruby/object:Gem::Version
26
29
  version: 1.6.21
30
+ - - "<"
31
+ - !ruby/object:Gem::Version
32
+ version: 2.1.0
27
33
  - !ruby/object:Gem::Dependency
28
34
  name: killbill-client
29
35
  requirement: !ruby/object:Gem::Requirement
@@ -42,30 +48,42 @@ dependencies:
42
48
  name: rubyzip
43
49
  requirement: !ruby/object:Gem::Requirement
44
50
  requirements:
45
- - - "~>"
51
+ - - ">="
46
52
  - !ruby/object:Gem::Version
47
- version: 1.3.0
53
+ version: '1.3'
54
+ - - "<"
55
+ - !ruby/object:Gem::Version
56
+ version: '2.4'
48
57
  type: :runtime
49
58
  prerelease: false
50
59
  version_requirements: !ruby/object:Gem::Requirement
51
60
  requirements:
52
- - - "~>"
61
+ - - ">="
53
62
  - !ruby/object:Gem::Version
54
- version: 1.3.0
63
+ version: '1.3'
64
+ - - "<"
65
+ - !ruby/object:Gem::Version
66
+ version: '2.4'
55
67
  - !ruby/object:Gem::Dependency
56
68
  name: thor
57
69
  requirement: !ruby/object:Gem::Requirement
58
70
  requirements:
59
- - - "~>"
71
+ - - ">="
60
72
  - !ruby/object:Gem::Version
61
73
  version: 0.19.1
74
+ - - "<"
75
+ - !ruby/object:Gem::Version
76
+ version: 1.3.0
62
77
  type: :runtime
63
78
  prerelease: false
64
79
  version_requirements: !ruby/object:Gem::Requirement
65
80
  requirements:
66
- - - "~>"
81
+ - - ">="
67
82
  - !ruby/object:Gem::Version
68
83
  version: 0.19.1
84
+ - - "<"
85
+ - !ruby/object:Gem::Version
86
+ version: 1.3.0
69
87
  - !ruby/object:Gem::Dependency
70
88
  name: gem-release
71
89
  requirement: !ruby/object:Gem::Requirement
@@ -108,6 +126,20 @@ dependencies:
108
126
  - - "~>"
109
127
  - !ruby/object:Gem::Version
110
128
  version: '3.9'
129
+ - !ruby/object:Gem::Dependency
130
+ name: rubocop
131
+ requirement: !ruby/object:Gem::Requirement
132
+ requirements:
133
+ - - "~>"
134
+ - !ruby/object:Gem::Version
135
+ version: 0.88.0
136
+ type: :development
137
+ prerelease: false
138
+ version_requirements: !ruby/object:Gem::Requirement
139
+ requirements:
140
+ - - "~>"
141
+ - !ruby/object:Gem::Version
142
+ version: 0.88.0
111
143
  description: A package manager for Kill Bill.
112
144
  email: killbilling-users@googlegroups.com
113
145
  executables:
@@ -159,7 +191,6 @@ files:
159
191
  - lib/kpm/system_helpers/system_proxy.rb
160
192
  - lib/kpm/tasks.rb
161
193
  - lib/kpm/tenant_config.rb
162
- - lib/kpm/tomcat_manager.rb
163
194
  - lib/kpm/trace_logger.rb
164
195
  - lib/kpm/uninstaller.rb
165
196
  - lib/kpm/utils.rb
@@ -168,7 +199,6 @@ files:
168
199
  - packaging/bundler-config
169
200
  - packaging/kpm.sh
170
201
  - pom.xml
171
- - release.sh
172
202
  - spec/kpm/remote/base_artifact_spec.rb
173
203
  - spec/kpm/remote/base_installer_spec.rb
174
204
  - spec/kpm/remote/cloudsmith_api_calls_spec.rb
@@ -181,7 +211,6 @@ files:
181
211
  - spec/kpm/remote/nexus_facade_spec.rb
182
212
  - spec/kpm/remote/tenant_config_spec.rb
183
213
  - spec/kpm/remote/tenant_config_spec.yml
184
- - spec/kpm/remote/tomcat_manager_spec.rb
185
214
  - spec/kpm/unit/actions_spec.rb
186
215
  - spec/kpm/unit/base_artifact_spec.rb
187
216
  - spec/kpm/unit/cpu_information_spec.rb
@@ -223,7 +252,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
223
252
  - !ruby/object:Gem::Version
224
253
  version: '0'
225
254
  requirements: []
226
- rubygems_version: 3.0.8
255
+ rubygems_version: 3.0.3.1
227
256
  signing_key:
228
257
  specification_version: 4
229
258
  summary: Kill Bill package manager.
@@ -1,95 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'pathname'
4
- require 'net/http'
5
- require 'uri'
6
-
7
- module KPM
8
- class TomcatManager
9
- DOWNLOAD_URL = 'https://s3.amazonaws.com/kb-binaries/apache-tomcat-7.0.42.tar.gz'
10
-
11
- def initialize(tomcat_dir, logger)
12
- @tomcat_dir = Pathname.new(tomcat_dir)
13
- @logger = logger
14
- end
15
-
16
- def download
17
- uri = URI.parse(DOWNLOAD_URL)
18
-
19
- path = nil
20
- Dir.mktmpdir do |dir|
21
- file = Pathname.new(dir).join('tomcat.tar.gz')
22
-
23
- @logger.info "Starting download of #{DOWNLOAD_URL} to #{file}"
24
- Net::HTTP.start(uri.host, uri.port, use_ssl: uri.scheme == 'https') do |http|
25
- File.open(file, 'wb+') do |f|
26
- http.get(uri.path) do |body|
27
- f.write(body)
28
- end
29
- end
30
- end
31
-
32
- path = Utils.unpack_tgz(file.to_s, @tomcat_dir, true)
33
- end
34
-
35
- @logger.info "Successful installation of #{DOWNLOAD_URL} to #{path}"
36
- path
37
- end
38
-
39
- def setup
40
- # Remove default webapps
41
- %w[ROOT docs examples host-manager manager].each do |webapp|
42
- FileUtils.rm_rf(@tomcat_dir.join('webapps').join(webapp))
43
- end
44
-
45
- # Update Root.xml
46
- root_xml_dir = @tomcat_dir.join('conf').join('Catalina').join('localhost')
47
- FileUtils.mkdir_p(root_xml_dir)
48
- File.write(root_xml_dir.join('ROOT.xml'), '<Context></Context>')
49
-
50
- # Setup default properties
51
- setenv_sh_path = @tomcat_dir.join('bin').join('setenv.sh')
52
-
53
- File.write(setenv_sh_path, "export CATALINA_OPTS=\"$CATALINA_OPTS #{default_java_properties}\"")
54
-
55
- @tomcat_dir.join('webapps').join('ROOT.war').to_s
56
- end
57
-
58
- def help
59
- "Tomcat installed at #{@tomcat_dir}
60
- Start script: #{@tomcat_dir.join('bin').join('startup.sh')}
61
- Stop script: #{@tomcat_dir.join('bin').join('shutdown.sh')}
62
- Logs: #{@tomcat_dir.join('logs')}"
63
- end
64
-
65
- private
66
-
67
- def default_java_properties
68
- <<HEREDOC.gsub(/\s+/, ' ').strip
69
- -server
70
- -showversion
71
- -XX:+PrintCommandLineFlags
72
- -XX:+UseCodeCacheFlushing
73
- -XX:PermSize=512m
74
- -XX:MaxPermSize=1G
75
- -Xms1G
76
- -Xmx2G
77
- -XX:+CMSClassUnloadingEnabled
78
- -XX:-OmitStackTraceInFastThrow
79
- -XX:+UseParNewGC
80
- -XX:+UseConcMarkSweepGC
81
- -XX:+CMSConcurrentMTEnabled
82
- -XX:+CMSParallelRemarkEnabled
83
- -XX:+UseCMSInitiatingOccupancyOnly
84
- -XX:CMSInitiatingOccupancyFraction=70
85
- -XX:+ScavengeBeforeFullGC
86
- -XX:+CMSScavengeBeforeRemark
87
- -XX:NewSize=600m
88
- -XX:MaxNewSize=900m
89
- -XX:SurvivorRatio=10
90
- -XX:+DisableExplicitGC
91
- -Djava.security.egd=file:/dev/./urandom
92
- HEREDOC
93
- end
94
- end
95
- end
data/release.sh DELETED
@@ -1,60 +0,0 @@
1
- #!/usr/bin/env bash
2
-
3
- set -e
4
-
5
- BUNDLE=${BUNDLE-"bundle exec"}
6
- MVN=${MVN-"mvn"}
7
-
8
- if [ 'GNU' != "$(tar --help | grep GNU | head -1 | awk '{print $1}')" ]; then
9
- echo 'Unable to release: make sure to use GNU tar'
10
- exit 1
11
- fi
12
-
13
- # See TRAVELING_RUBY_VERSION in tasks/package.rake
14
- if [[ "$(ruby --version 2>&1 | tail -1 | awk '{print $2}')" != 2.2.2* ]]; then
15
- echo 'Ruby version 2.2.2 is required'
16
- exit 1
17
- fi
18
-
19
- VERSION=`grep -E '<version>([0-9]+\.[0-9]+\.[0-9]+)</version>' pom.xml | sed 's/[\t \n]*<version>\(.*\)<\/version>[\t \n]*/\1/'`
20
- if [[ -z "$NO_RELEASE" && "$VERSION" != "$(ruby -r./lib/kpm/version.rb -e "print KPM::VERSION")" ]]; then
21
- echo 'Unable to release: make sure the versions in pom.xml and VERSION match'
22
- exit 1
23
- fi
24
-
25
- if [[ -z "$NO_RELEASE" ]]; then
26
- echo 'Pushing the gem to Rubygems'
27
- $BUNDLE rake release
28
- fi
29
-
30
- # Wait for the gem to be propagated
31
- sleep 15
32
-
33
- $BUNDLE rake package
34
-
35
- if [[ -z "$NO_RELEASE" ]]; then
36
- GOAL=gpg:sign-and-deploy-file
37
- REPOSITORY_ID=ossrh-releases
38
- URL=https://oss.sonatype.org/service/local/staging/deploy/maven2/
39
- REPO_VERSION=$VERSION
40
- else
41
- GOAL=deploy:deploy-file
42
- REPOSITORY_ID=sonatype-nexus-snapshots
43
- URL=https://oss.sonatype.org/content/repositories/snapshots/
44
- REPO_VERSION="$VERSION-SNAPSHOT"
45
- fi
46
-
47
- echo "Pushing artifacts to Maven Central"
48
- $MVN $GOAL \
49
- -DgroupId=org.kill-bill.billing.installer \
50
- -DartifactId=kpm \
51
- -Dversion=$REPO_VERSION \
52
- -Dpackaging=tar.gz \
53
- -DrepositoryId=$REPOSITORY_ID \
54
- -Durl=$URL \
55
- -Dfile=kpm-$VERSION-linux-x86_64.tar.gz \
56
- -Dclassifier=linux-x86_64 \
57
- -Dfiles=kpm-$VERSION-linux-x86.tar.gz,kpm-$VERSION-osx.tar.gz \
58
- -Dclassifiers=linux-x86,osx \
59
- -Dtypes=tar.gz,tar.gz \
60
- -DpomFile=pom.xml
@@ -1,22 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'spec_helper'
4
-
5
- describe KPM::TomcatManager do
6
- before(:all) do
7
- @logger = Logger.new(STDOUT)
8
- @logger.level = Logger::INFO
9
- end
10
-
11
- it 'should be able to download and unpack tomcat' do
12
- Dir.mktmpdir do |dir|
13
- manager = KPM::TomcatManager.new(dir, @logger)
14
-
15
- tomcat_path = manager.download
16
- expect(tomcat_path).not_to be_nil
17
-
18
- root_war_path = manager.setup
19
- expect(root_war_path).not_to be_nil
20
- end
21
- end
22
- end