sinicum-runner 0.5.0.pre3 → 0.5.0.pre4
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/.gitignore +1 -0
- data/.rspec +1 -0
- data/.travis.yml +3 -0
- data/README.md +2 -0
- data/Rakefile +12 -0
- data/lib/java/lib/{tomcat-annotations-api-7.0.53.jar → tomcat-annotations-api-7.0.54.jar} +0 -0
- data/lib/java/lib/{tomcat-api-7.0.53.jar → tomcat-api-7.0.54.jar} +0 -0
- data/lib/java/lib/{tomcat-catalina-7.0.53.jar → tomcat-catalina-7.0.54.jar} +0 -0
- data/lib/java/lib/{tomcat-el-api-7.0.53.jar → tomcat-el-api-7.0.54.jar} +0 -0
- data/lib/java/lib/{tomcat-embed-core-7.0.53.jar → tomcat-embed-core-7.0.54.jar} +0 -0
- data/lib/java/lib/{tomcat-jasper-7.0.53.jar → tomcat-jasper-7.0.54.jar} +0 -0
- data/lib/java/lib/{tomcat-jasper-el-7.0.53.jar → tomcat-jasper-el-7.0.54.jar} +0 -0
- data/lib/java/lib/{tomcat-jsp-api-7.0.53.jar → tomcat-jsp-api-7.0.54.jar} +0 -0
- data/lib/java/lib/{tomcat-juli-7.0.53.jar → tomcat-juli-7.0.54.jar} +0 -0
- data/lib/java/lib/{tomcat-servlet-api-7.0.53.jar → tomcat-servlet-api-7.0.54.jar} +0 -0
- data/lib/java/lib/{tomcat-util-7.0.53.jar → tomcat-util-7.0.54.jar} +0 -0
- data/lib/java/sinicum-runner-0.5.0.pre4.jar +0 -0
- data/lib/sinicum-runner/runner_cli.rb +16 -6
- data/lib/sinicum-runner/version.rb +1 -1
- data/lib/tasks/maven.rake +19 -0
- data/pom.xml +2 -2
- data/sinicum-runner.gemspec +4 -0
- data/spec/sinicum-runner/runner_cli_spec.rb +21 -11
- metadata +46 -16
- data/lib/java/sinicum-runner-0.5.0.pre3.jar +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a05c2535dfe8ca1e64b49c453c294f09936e896e
|
4
|
+
data.tar.gz: 03d1ce4591bf7202bbff103b5fe6194317810f3d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4164b3e4ffbae6705f86d3bba69a24a7d19c6ddf357285a6c1e13084ce3ed4741ecf7afbc95f42e69378ecd190ece75d7b8917ed835894ab5bf896d799dd15ea
|
7
|
+
data.tar.gz: db60d95b9cfb04404763d486248a69535cac7bdd31220ff271644e7a2771d363d81941c46f753043e897cd66d6c31de7b663cce910df7f9efbdaed43f3320fb8
|
data/.gitignore
CHANGED
data/.rspec
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
--color
|
data/.travis.yml
ADDED
data/README.md
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
[](https://travis-ci.org/dievision/sinicum-runner)
|
2
|
+
|
1
3
|
# Sinicum::Runner
|
2
4
|
|
3
5
|
Sinicum-runner is a simple embedded Tomcat server, which runs Magnolia CMS from
the app’s root directory.
|
data/Rakefile
CHANGED
@@ -1 +1,13 @@
|
|
1
1
|
require "bundler/gem_tasks"
|
2
|
+
|
3
|
+
require 'rspec/core/rake_task'
|
4
|
+
|
5
|
+
Dir[File.expand_path('../lib/tasks/**/*rake', __FILE__)].each do |file|
|
6
|
+
load file
|
7
|
+
end
|
8
|
+
|
9
|
+
desc "Runs the tests"
|
10
|
+
RSpec::Core::RakeTask.new(:spec)
|
11
|
+
|
12
|
+
task default: [:spec, :maven_test]
|
13
|
+
task :build => :maven_package
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -4,6 +4,8 @@ require 'optparse'
|
|
4
4
|
module Sinicum
|
5
5
|
module Runner
|
6
6
|
class RunnerCli
|
7
|
+
SINICUM_ENV_NAME = "SINICUM_ENV"
|
8
|
+
WEBAPP_BASE_DIR = File.join(FileUtils.pwd, "tmp", "magnolia")
|
7
9
|
RUNNER_TMP_DIR = ".sinicum-runner"
|
8
10
|
|
9
11
|
def run(args)
|
@@ -37,7 +39,8 @@ module Sinicum
|
|
37
39
|
def build_webapp
|
38
40
|
current_dir = FileUtils.pwd
|
39
41
|
FileUtils.cd(magnolia_module_dir)
|
40
|
-
run_command("
|
42
|
+
run_command("#{SINICUM_ENV_NAME}=#{@options.environment} " +
|
43
|
+
"mvn -Dmaven.test.skip=true clean package war:exploded")
|
41
44
|
ensure
|
42
45
|
FileUtils.cd(current_dir)
|
43
46
|
end
|
@@ -48,7 +51,8 @@ module Sinicum
|
|
48
51
|
options.concat(["-jar", jar_location, "--basedir", runner_dir,
|
49
52
|
"--appbase", webapp_directory_path])
|
50
53
|
options.concat(@options.to_option_args)
|
51
|
-
ret_value = system("java", *options)
|
54
|
+
ret_value = system({ SINICUM_ENV_NAME => @options.environment }, "java", *options)
|
55
|
+
puts ""
|
52
56
|
exit 1 unless ret_value
|
53
57
|
ret_value
|
54
58
|
end
|
@@ -81,7 +85,7 @@ module Sinicum
|
|
81
85
|
end
|
82
86
|
|
83
87
|
def webapp_directory_path
|
84
|
-
|
88
|
+
File.join(WEBAPP_BASE_DIR, @options.environment, @options.environment)
|
85
89
|
end
|
86
90
|
|
87
91
|
def magnolia_module_name
|
@@ -144,10 +148,11 @@ module Sinicum
|
|
144
148
|
end
|
145
149
|
|
146
150
|
class Options
|
147
|
-
|
151
|
+
DEFAULT_ENVIRONMENT = "development"
|
152
|
+
attr_reader :port, :ajp_port, :context, :skip_build, :only_build, :hostname, :environment
|
148
153
|
|
149
154
|
def initialize(args = [])
|
150
|
-
|
155
|
+
options = OptionParser.new do |opts|
|
151
156
|
opts.on("-p", "--port [PORT]", "HTTP port to bind to") do |port|
|
152
157
|
@port = port
|
153
158
|
end
|
@@ -168,11 +173,16 @@ module Sinicum
|
|
168
173
|
opts.on("-b", "--only-build", "only builds the Maven project") do |skip|
|
169
174
|
@only_build = true
|
170
175
|
end
|
176
|
+
@environment = DEFAULT_ENVIRONMENT
|
177
|
+
opts.on("-e", "--environment [ENVIRONMENT]",
|
178
|
+
"name of the Magnolia environment") do |environment|
|
179
|
+
@environment = environment
|
180
|
+
end
|
171
181
|
opts.on("-J[PARAM]", "JVM parameter") do |parameter|
|
172
182
|
jvm_params << parameter
|
173
183
|
end
|
174
184
|
end
|
175
|
-
|
185
|
+
options.parse!(args)
|
176
186
|
end
|
177
187
|
|
178
188
|
def jvm_params
|
@@ -0,0 +1,19 @@
|
|
1
|
+
desc "Run the Maven tests"
|
2
|
+
task :maven_test do
|
3
|
+
run_or_exit("mvn verify")
|
4
|
+
end
|
5
|
+
|
6
|
+
desc "Create the Jars"
|
7
|
+
task :maven_package do
|
8
|
+
run_or_exit("mvn clean verify")
|
9
|
+
end
|
10
|
+
|
11
|
+
private
|
12
|
+
|
13
|
+
def run_or_exit(command)
|
14
|
+
result = system(command)
|
15
|
+
unless result
|
16
|
+
$stderr.puts "Error executing Maven test, exiting."
|
17
|
+
exit($?.exitstatus)
|
18
|
+
end
|
19
|
+
end
|
data/pom.xml
CHANGED
@@ -4,14 +4,14 @@
|
|
4
4
|
|
5
5
|
<groupId>com.dievision.sinicum</groupId>
|
6
6
|
<artifactId>sinicum-runner</artifactId>
|
7
|
-
<version>0.5.0.
|
7
|
+
<version>0.5.0.pre4</version>
|
8
8
|
<packaging>jar</packaging>
|
9
9
|
|
10
10
|
<name>sinicum-runner</name>
|
11
11
|
<url>http://maven.apache.org</url>
|
12
12
|
|
13
13
|
<properties>
|
14
|
-
<tomcatVersion>7.0.
|
14
|
+
<tomcatVersion>7.0.54</tomcatVersion>
|
15
15
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
16
16
|
</properties>
|
17
17
|
|
data/sinicum-runner.gemspec
CHANGED
@@ -14,7 +14,11 @@ Gem::Specification.new do |gem|
|
|
14
14
|
gem.license = "MIT/Apache-2.0"
|
15
15
|
|
16
16
|
gem.files = `git ls-files`.split($/)
|
17
|
+
gem.files += Dir['lib/java/**/*.jar']
|
17
18
|
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
18
19
|
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
19
20
|
gem.require_paths = ["lib"]
|
21
|
+
|
22
|
+
gem.add_development_dependency 'rake', '> 10.3'
|
23
|
+
gem.add_development_dependency 'rspec', '~> 3.0'
|
20
24
|
end
|
@@ -5,57 +5,67 @@ module Sinicum
|
|
5
5
|
describe Options do
|
6
6
|
it "should work without options" do
|
7
7
|
opts = Options.new([])
|
8
|
-
opts.
|
8
|
+
expect(opts).not_to be nil
|
9
9
|
end
|
10
10
|
|
11
11
|
it "shoud parse the port" do
|
12
12
|
opts = Options.new(["-p", "8090"])
|
13
|
-
opts.port.
|
13
|
+
expect(opts.port).to eq("8090")
|
14
14
|
end
|
15
15
|
|
16
16
|
it "should parse the AJP port" do
|
17
17
|
opts = Options.new(["-a", "8009"])
|
18
|
-
opts.ajp_port.
|
18
|
+
expect(opts.ajp_port).to eq("8009")
|
19
19
|
end
|
20
20
|
|
21
21
|
it "should parse the context path" do
|
22
22
|
opts = Options.new(["-c", "some_context"])
|
23
|
-
opts.context.
|
23
|
+
expect(opts.context).to eq("some_context")
|
24
24
|
end
|
25
25
|
|
26
26
|
it "should allow for multiple JVM args" do
|
27
27
|
opts = Options.new(["-JXmx256m", "-JXmn256m"])
|
28
|
-
opts.jvm_params.
|
28
|
+
expect(opts.jvm_params).to eq(["Xmx256m", "Xmn256m"])
|
29
29
|
end
|
30
30
|
|
31
31
|
it "should use Xmx512m as JVM option by default" do
|
32
32
|
opts = Options.new
|
33
|
-
opts.to_jvm_options.
|
33
|
+
expect(opts.to_jvm_options).to eq(["-Xmx512m"])
|
34
34
|
end
|
35
35
|
|
36
36
|
it "should use other JVM options if any JVM arguments are given" do
|
37
37
|
opts = Options.new(["-J-Xmn256m", "-J-XX:MaxPermSize=256m"])
|
38
|
-
opts.to_jvm_options.
|
38
|
+
expect(opts.to_jvm_options).to eq(["-Xmn256m", "-XX:MaxPermSize=256m"])
|
39
39
|
end
|
40
40
|
|
41
41
|
it "should not skip the build by default" do
|
42
42
|
opts = Options.new
|
43
|
-
opts.skip_build.
|
43
|
+
expect(opts.skip_build).to be false
|
44
44
|
end
|
45
45
|
|
46
46
|
it "should skip the build if asked to do so" do
|
47
47
|
opts = Options.new(["-s"])
|
48
|
-
opts.skip_build.
|
48
|
+
expect(opts.skip_build).to be true
|
49
49
|
end
|
50
50
|
|
51
51
|
it "should not skip the server by default" do
|
52
52
|
opts = Options.new
|
53
|
-
opts.only_build.
|
53
|
+
expect(opts.only_build).to be false
|
54
54
|
end
|
55
55
|
|
56
56
|
it "should skip the server if asked to do so" do
|
57
57
|
opts = Options.new(["-b"])
|
58
|
-
opts.only_build.
|
58
|
+
expect(opts.only_build).to be true
|
59
|
+
end
|
60
|
+
|
61
|
+
it "should have the 'development' environment per default" do
|
62
|
+
opts = Options.new
|
63
|
+
expect(opts.environment).to eq 'development'
|
64
|
+
end
|
65
|
+
|
66
|
+
it "should be possible to set different environments" do
|
67
|
+
opts = Options.new(['-e', 'author'])
|
68
|
+
expect(opts.environment).to eq 'author'
|
59
69
|
end
|
60
70
|
end
|
61
71
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sinicum-runner
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.0.
|
4
|
+
version: 0.5.0.pre4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Patrik Metzmacher
|
@@ -9,8 +9,36 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-
|
13
|
-
dependencies:
|
12
|
+
date: 2014-07-29 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: rake
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
requirements:
|
18
|
+
- - ">"
|
19
|
+
- !ruby/object:Gem::Version
|
20
|
+
version: '10.3'
|
21
|
+
type: :development
|
22
|
+
prerelease: false
|
23
|
+
version_requirements: !ruby/object:Gem::Requirement
|
24
|
+
requirements:
|
25
|
+
- - ">"
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
version: '10.3'
|
28
|
+
- !ruby/object:Gem::Dependency
|
29
|
+
name: rspec
|
30
|
+
requirement: !ruby/object:Gem::Requirement
|
31
|
+
requirements:
|
32
|
+
- - "~>"
|
33
|
+
- !ruby/object:Gem::Version
|
34
|
+
version: '3.0'
|
35
|
+
type: :development
|
36
|
+
prerelease: false
|
37
|
+
version_requirements: !ruby/object:Gem::Requirement
|
38
|
+
requirements:
|
39
|
+
- - "~>"
|
40
|
+
- !ruby/object:Gem::Version
|
41
|
+
version: '3.0'
|
14
42
|
description: A gem to easily run Magnolia CMS in a Tomcat instance
|
15
43
|
email:
|
16
44
|
- sinicum@dievision.de
|
@@ -20,6 +48,8 @@ extensions: []
|
|
20
48
|
extra_rdoc_files: []
|
21
49
|
files:
|
22
50
|
- ".gitignore"
|
51
|
+
- ".rspec"
|
52
|
+
- ".travis.yml"
|
23
53
|
- Gemfile
|
24
54
|
- LICENSE
|
25
55
|
- README.md
|
@@ -28,21 +58,22 @@ files:
|
|
28
58
|
- lib/java/lib/ecj-P20140317-1600.jar
|
29
59
|
- lib/java/lib/hamcrest-core-1.3.jar
|
30
60
|
- lib/java/lib/jcommander-1.30.jar
|
31
|
-
- lib/java/lib/tomcat-annotations-api-7.0.
|
32
|
-
- lib/java/lib/tomcat-api-7.0.
|
33
|
-
- lib/java/lib/tomcat-catalina-7.0.
|
34
|
-
- lib/java/lib/tomcat-el-api-7.0.
|
35
|
-
- lib/java/lib/tomcat-embed-core-7.0.
|
36
|
-
- lib/java/lib/tomcat-jasper-7.0.
|
37
|
-
- lib/java/lib/tomcat-jasper-el-7.0.
|
38
|
-
- lib/java/lib/tomcat-jsp-api-7.0.
|
39
|
-
- lib/java/lib/tomcat-juli-7.0.
|
40
|
-
- lib/java/lib/tomcat-servlet-api-7.0.
|
41
|
-
- lib/java/lib/tomcat-util-7.0.
|
42
|
-
- lib/java/sinicum-runner-0.5.0.
|
61
|
+
- lib/java/lib/tomcat-annotations-api-7.0.54.jar
|
62
|
+
- lib/java/lib/tomcat-api-7.0.54.jar
|
63
|
+
- lib/java/lib/tomcat-catalina-7.0.54.jar
|
64
|
+
- lib/java/lib/tomcat-el-api-7.0.54.jar
|
65
|
+
- lib/java/lib/tomcat-embed-core-7.0.54.jar
|
66
|
+
- lib/java/lib/tomcat-jasper-7.0.54.jar
|
67
|
+
- lib/java/lib/tomcat-jasper-el-7.0.54.jar
|
68
|
+
- lib/java/lib/tomcat-jsp-api-7.0.54.jar
|
69
|
+
- lib/java/lib/tomcat-juli-7.0.54.jar
|
70
|
+
- lib/java/lib/tomcat-servlet-api-7.0.54.jar
|
71
|
+
- lib/java/lib/tomcat-util-7.0.54.jar
|
72
|
+
- lib/java/sinicum-runner-0.5.0.pre4.jar
|
43
73
|
- lib/sinicum-runner.rb
|
44
74
|
- lib/sinicum-runner/runner_cli.rb
|
45
75
|
- lib/sinicum-runner/version.rb
|
76
|
+
- lib/tasks/maven.rake
|
46
77
|
- pom.xml
|
47
78
|
- sinicum-runner.gemspec
|
48
79
|
- spec/sinicum-runner/runner_cli_spec.rb
|
@@ -75,4 +106,3 @@ specification_version: 4
|
|
75
106
|
summary: Simple embedded Tomcat server
|
76
107
|
test_files:
|
77
108
|
- spec/sinicum-runner/runner_cli_spec.rb
|
78
|
-
has_rdoc:
|
Binary file
|