marmottawrapper 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +3 -1
- data/README.md +22 -5
- data/lib/marmottawrapper/railtie.rb +12 -0
- data/lib/marmottawrapper/tasks/marmottawrapper.rake +8 -5
- data/lib/marmottawrapper/version.rb +1 -1
- data/lib/marmottawrapper.rb +32 -77
- data/marmotta/.gitkeep +0 -0
- data/marmottawrapper.gemspec +3 -5
- metadata +8 -39
- data/marmotta/pom.xml +0 -571
- data/marmotta/src/main/resources/META-INF/beans.xml +0 -28
- data/marmotta/src/main/resources/config-defaults.properties +0 -21
- data/marmotta/src/main/resources/config-descriptions.properties +0 -24
- data/marmotta/src/main/resources/logback.xml +0 -37
- data/marmotta/src/main/webapp/META-INF/context.xml +0 -23
- data/marmotta/src/main/webapp/META-INF/jetty-web.xml +0 -27
- data/marmotta/src/main/webapp/WEB-INF/jetty-web.xml +0 -34
- data/marmotta/src/main/webapp/WEB-INF/templates/404.ftl +0 -84
- data/marmotta/src/main/webapp/WEB-INF/templates/admin.ftl +0 -104
- data/marmotta/src/main/webapp/WEB-INF/templates/rdfhtml.ftl +0 -335
- data/marmotta/src/main/webapp/WEB-INF/web.xml +0 -177
- data/marmotta/src/main/webapp/index.jsp +0 -25
- data/marmotta/src/test/resources/META-INF/beans.xml +0 -26
- data/marmotta/src/test/resources/WEB-INF/test-web.xml +0 -188
- data/marmotta/src/test/resources/jndi.properties +0 -14
- data/marmotta/src/test/resources/logback.xml +0 -60
- data/marmotta/src/test/resources/test-config.properties +0 -68
- data/marmotta/src/test/resources/verification.xml +0 -31
- data/pom.xml +0 -571
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 48644a9a81da54e2dc29ab534bf662ea620bce38
|
4
|
+
data.tar.gz: 8bd2be3debd7eee2165524231fec03812529524d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4bc65cb8b5fe2795ab99679ff3f5504c60e1efe334fb406a9cc51dd3a0d2ae9ba545642a245ae4f41c0aac4acaa4102b3bd65ebf522376eee1a47fde47a8ba96
|
7
|
+
data.tar.gz: e52d0def019dfc89c11610a738ae1a65511ddb2d2a5eed06eab6fd0354dfa4229d8fc9ab1a912cb9979d002a2ae61b39fddf2a0f2e17483e9874df747ce59f34
|
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -1,15 +1,33 @@
|
|
1
|
-
|
1
|
+
marmottawrapper
|
2
2
|
===============
|
3
3
|
|
4
4
|
This project creates rake tasks to easily start up [Apache Marmotta](http://marmotta.apache.org/) in Tomcat 7.
|
5
5
|
|
6
6
|
To install:
|
7
7
|
|
8
|
-
git clone https://github.com/dpla/
|
9
|
-
|
8
|
+
git clone https://github.com/dpla/marmottawrapper
|
9
|
+
cd marmottawrapper
|
10
10
|
bundle install
|
11
11
|
|
12
|
+
Download and install Marmotta:
|
13
|
+
|
14
|
+
rake marmotta:fetch
|
15
|
+
rake marmotta:install
|
16
|
+
|
12
17
|
* To start a Marmotta app in Tomcat 7 on port `8080`: `rake marmotta:start`
|
18
|
+
* To stop Tomcat: `rake marmotta:stop`
|
19
|
+
|
20
|
+
Use in Rails Projects
|
21
|
+
----------------------
|
22
|
+
|
23
|
+
A railtie is included to make the tasks available to Rails applications. To use
|
24
|
+
the railtie add `marmottawrapper` to your Gemfile and run `bundle install`.
|
25
|
+
|
26
|
+
`rake -T` should now reveal that the marmotta tasks are available:
|
27
|
+
|
28
|
+
rake marmotta:fetch
|
29
|
+
rake marmotta:install
|
30
|
+
rake marmotta:start
|
13
31
|
|
14
32
|
Virtual Machine
|
15
33
|
---------------
|
@@ -24,9 +42,8 @@ Marmotta should now be available on your host machine at port `8087`.
|
|
24
42
|
|
25
43
|
TODO:
|
26
44
|
-----
|
27
|
-
* [ ] Use a runnable/downloadable JAR file: `mvn clean package -Prunnable-war`, `java -jar target/marmotta-webapp-3.2.1-0.0.1-war-exec.jar`
|
28
|
-
* [ ] Add task to download JAR, to make this easier to use in projects.
|
29
45
|
* [ ] Make Tomcat port configurable.
|
46
|
+
* [ ] Make Marmotta configurable.
|
30
47
|
* [ ] Wait for Tomcat to start before quitting `start` task.
|
31
48
|
|
32
49
|
License: Apache 2.0
|
@@ -1,15 +1,18 @@
|
|
1
1
|
namespace :marmotta do
|
2
2
|
|
3
|
-
desc "remove the
|
3
|
+
desc "remove the Marmotta data directory and recreate it"
|
4
4
|
task :clean do
|
5
5
|
Marmottawrapper.clean
|
6
6
|
end
|
7
7
|
|
8
|
-
desc "
|
9
|
-
task :
|
8
|
+
desc "fetch the Marmotta and Tomcat distribution"
|
9
|
+
task :fetch do
|
10
|
+
Marmottawrapper.fetch
|
11
|
+
end
|
10
12
|
|
11
|
-
|
12
|
-
|
13
|
+
desc "Install the Marmotta and Tomcat distribution"
|
14
|
+
task :install do
|
15
|
+
Marmottawrapper.install
|
13
16
|
end
|
14
17
|
|
15
18
|
desc "Start Marmotta/Tomcat"
|
data/lib/marmottawrapper.rb
CHANGED
@@ -1,7 +1,9 @@
|
|
1
1
|
require 'fileutils'
|
2
|
-
require 'childprocess'
|
3
2
|
|
4
3
|
class Marmottawrapper
|
4
|
+
|
5
|
+
require 'marmottawrapper/railtie' if defined?(Rails)
|
6
|
+
|
5
7
|
class << self
|
6
8
|
def app_root
|
7
9
|
return @app_root if @app_root
|
@@ -9,108 +11,61 @@ class Marmottawrapper
|
|
9
11
|
@app_root ||= '.'
|
10
12
|
end
|
11
13
|
|
14
|
+
def url
|
15
|
+
@url ||= defined?(ZIP_URL) ? ZIP_URL : "https://github.com/dpla/marmotta-webapp/releases/download/v0.0.4/tomcat-marmotta.zip"
|
16
|
+
end
|
17
|
+
|
12
18
|
def marmotta_dir
|
13
19
|
File.join(app_root, 'marmotta')
|
14
20
|
end
|
15
21
|
|
16
|
-
def
|
17
|
-
File.join(
|
22
|
+
def tmp_dir
|
23
|
+
File.join(app_root, 'tmp')
|
24
|
+
end
|
25
|
+
|
26
|
+
def tomcat_dir
|
27
|
+
File.join(app_root, 'tomcat')
|
18
28
|
end
|
19
29
|
|
20
30
|
def clean
|
21
|
-
system "rm -r #{
|
22
|
-
|
31
|
+
system "rm -r #{tomcat_dir}" if File.directory?(tomcat_dir)
|
32
|
+
system "rm -r #{tmp_dir}" if File.directory?(tmp_dir)
|
33
|
+
system "rm -r #{marmotta_dir}" if File.directory?(marmotta_dir)
|
23
34
|
end
|
24
35
|
|
25
36
|
##
|
26
|
-
#
|
27
|
-
def
|
28
|
-
|
29
|
-
|
37
|
+
# Fetch the Tomcat/Marmotta distribution
|
38
|
+
def fetch
|
39
|
+
FileUtils.makedirs(tmp_dir) unless File.directory?(tmp_dir)
|
40
|
+
FileUtils.makedirs(marmotta_dir) unless File.directory?(marmotta_dir)
|
41
|
+
Dir.chdir(tmp_dir) {
|
42
|
+
system "curl -L #{url} -o tomcat-marmotta.zip"
|
30
43
|
}
|
31
44
|
end
|
32
45
|
|
46
|
+
def install
|
47
|
+
fetch unless File.exists?(File.join(tmp_dir, 'tomcat-marmotta.zip'))
|
48
|
+
system "unzip #{tmp_dir}/tomcat-marmotta.zip"
|
49
|
+
File.delete(File.join(tmp_dir, 'tomcat-marmotta.zip'))
|
50
|
+
end
|
51
|
+
|
33
52
|
##
|
34
|
-
# Start the Tomcat server with Marmotta
|
53
|
+
# Start the Tomcat server with Marmotta
|
35
54
|
def start
|
36
|
-
|
37
|
-
if is_running?
|
38
|
-
raise("Server is already running with PID #{pid}")
|
39
|
-
else
|
40
|
-
puts "Removing stale PID file at #{pid_path}"
|
41
|
-
File.delete(pid_path)
|
42
|
-
end
|
43
|
-
end
|
44
|
-
|
45
|
-
Dir.chdir(marmotta_dir) {
|
46
|
-
process.start
|
47
|
-
}
|
48
|
-
|
49
|
-
FileUtils.makedirs(pid_dir) unless File.directory?(pid_dir)
|
50
|
-
File::open(pid_path, 'w') do |f|
|
51
|
-
f.puts "#{process.pid}"
|
52
|
-
end
|
53
|
-
|
54
|
-
process.pid
|
55
|
+
system "#{tomcat_dir}/bin/startup.sh"
|
55
56
|
end
|
56
57
|
|
57
58
|
##
|
58
59
|
# Stop Tomcat/Marmotta
|
59
60
|
def stop
|
60
|
-
|
61
|
-
if @process
|
62
|
-
@process.stop
|
63
|
-
else
|
64
|
-
Process.kill("KILL", pid) rescue nil
|
65
|
-
end
|
66
|
-
|
67
|
-
begin
|
68
|
-
File.delete(pid_path)
|
69
|
-
rescue
|
70
|
-
end
|
61
|
+
system "#{tomcat_dir}/bin/shutdown.sh"
|
71
62
|
end
|
72
63
|
|
73
64
|
def restart
|
74
65
|
stop
|
66
|
+
sleep 2
|
75
67
|
start
|
76
68
|
end
|
77
69
|
|
78
|
-
def process
|
79
|
-
@process ||= begin
|
80
|
-
process = ChildProcess.build('mvn', 'clean', 'tomcat7:run')
|
81
|
-
# TODO: When use this instead of the above
|
82
|
-
# java -jar #{build_dir}/marmotta-webapp-3.2.1-0.0.1-war-exec.jar
|
83
|
-
process.detach = true
|
84
|
-
process
|
85
|
-
end
|
86
|
-
end
|
87
|
-
|
88
|
-
def is_running?
|
89
|
-
begin
|
90
|
-
return Process.getpgid(pid) != -1
|
91
|
-
rescue Errno::ESRCH
|
92
|
-
return false
|
93
|
-
end
|
94
|
-
end
|
95
|
-
|
96
|
-
def pid
|
97
|
-
File.open( pid_path ) { |f| return f.gets.to_i } if File.exist?(pid_path)
|
98
|
-
end
|
99
|
-
|
100
|
-
def pid_path
|
101
|
-
@path = File.join(pid_dir, pid_file)
|
102
|
-
end
|
103
|
-
|
104
|
-
def pid_dir
|
105
|
-
File.expand_path(File.join(app_root, 'tmp', 'pids'))
|
106
|
-
end
|
107
|
-
|
108
|
-
def pid_file
|
109
|
-
'marmotta.pid'
|
110
|
-
end
|
111
|
-
|
112
|
-
def pid_file?
|
113
|
-
File.exist?(pid_path)
|
114
|
-
end
|
115
70
|
end
|
116
71
|
end
|
data/marmotta/.gitkeep
ADDED
File without changes
|
data/marmottawrapper.gemspec
CHANGED
@@ -9,15 +9,13 @@ Gem::Specification.new do |s|
|
|
9
9
|
s.platform = Gem::Platform::RUBY
|
10
10
|
s.authors = ["Mark Matienzo", "Tom Johnson"]
|
11
11
|
s.email = ["tech@dp.la"]
|
12
|
-
s.homepage = "https://github.com/dpla/
|
13
|
-
s.summary = %q{Convenience tasks for working with
|
14
|
-
s.description = %q{Convenience tasks for working with
|
12
|
+
s.homepage = "https://github.com/dpla/marmottawrapper"
|
13
|
+
s.summary = %q{Convenience tasks for working with Apache Marmotta from within a Ruby project.}
|
14
|
+
s.description = %q{Convenience tasks for working with Apache Marmotta from within a Ruby project.}
|
15
15
|
s.files = `git ls-files`.split("\n")
|
16
16
|
s.test_files = `git ls-files -- {spec}/*`.split("\n")
|
17
17
|
s.require_paths = ["lib"]
|
18
18
|
s.license = 'APACHE 2'
|
19
|
-
|
20
|
-
s.add_dependency 'childprocess'
|
21
19
|
|
22
20
|
s.add_dependency 'rake'
|
23
21
|
s.add_development_dependency 'pry'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: marmottawrapper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mark Matienzo
|
@@ -9,22 +9,8 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-10-
|
12
|
+
date: 2014-10-14 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
|
-
- !ruby/object:Gem::Dependency
|
15
|
-
name: childprocess
|
16
|
-
requirement: !ruby/object:Gem::Requirement
|
17
|
-
requirements:
|
18
|
-
- - ">="
|
19
|
-
- !ruby/object:Gem::Version
|
20
|
-
version: '0'
|
21
|
-
type: :runtime
|
22
|
-
prerelease: false
|
23
|
-
version_requirements: !ruby/object:Gem::Requirement
|
24
|
-
requirements:
|
25
|
-
- - ">="
|
26
|
-
- !ruby/object:Gem::Version
|
27
|
-
version: '0'
|
28
14
|
- !ruby/object:Gem::Dependency
|
29
15
|
name: rake
|
30
16
|
requirement: !ruby/object:Gem::Requirement
|
@@ -53,7 +39,8 @@ dependencies:
|
|
53
39
|
- - ">="
|
54
40
|
- !ruby/object:Gem::Version
|
55
41
|
version: '0'
|
56
|
-
description: Convenience tasks for working with
|
42
|
+
description: Convenience tasks for working with Apache Marmotta from within a Ruby
|
43
|
+
project.
|
57
44
|
email:
|
58
45
|
- tech@dp.la
|
59
46
|
executables: []
|
@@ -68,30 +55,12 @@ files:
|
|
68
55
|
- Vagrantfile
|
69
56
|
- bin/setup
|
70
57
|
- lib/marmottawrapper.rb
|
58
|
+
- lib/marmottawrapper/railtie.rb
|
71
59
|
- lib/marmottawrapper/tasks/marmottawrapper.rake
|
72
60
|
- lib/marmottawrapper/version.rb
|
73
|
-
- marmotta
|
74
|
-
- marmotta/src/main/resources/META-INF/beans.xml
|
75
|
-
- marmotta/src/main/resources/config-defaults.properties
|
76
|
-
- marmotta/src/main/resources/config-descriptions.properties
|
77
|
-
- marmotta/src/main/resources/logback.xml
|
78
|
-
- marmotta/src/main/webapp/META-INF/context.xml
|
79
|
-
- marmotta/src/main/webapp/META-INF/jetty-web.xml
|
80
|
-
- marmotta/src/main/webapp/WEB-INF/jetty-web.xml
|
81
|
-
- marmotta/src/main/webapp/WEB-INF/templates/404.ftl
|
82
|
-
- marmotta/src/main/webapp/WEB-INF/templates/admin.ftl
|
83
|
-
- marmotta/src/main/webapp/WEB-INF/templates/rdfhtml.ftl
|
84
|
-
- marmotta/src/main/webapp/WEB-INF/web.xml
|
85
|
-
- marmotta/src/main/webapp/index.jsp
|
86
|
-
- marmotta/src/test/resources/META-INF/beans.xml
|
87
|
-
- marmotta/src/test/resources/WEB-INF/test-web.xml
|
88
|
-
- marmotta/src/test/resources/jndi.properties
|
89
|
-
- marmotta/src/test/resources/logback.xml
|
90
|
-
- marmotta/src/test/resources/test-config.properties
|
91
|
-
- marmotta/src/test/resources/verification.xml
|
61
|
+
- marmotta/.gitkeep
|
92
62
|
- marmottawrapper.gemspec
|
93
|
-
|
94
|
-
homepage: https://github.com/dpla/marmotta-webapp
|
63
|
+
homepage: https://github.com/dpla/marmottawrapper
|
95
64
|
licenses:
|
96
65
|
- APACHE 2
|
97
66
|
metadata: {}
|
@@ -114,6 +83,6 @@ rubyforge_project:
|
|
114
83
|
rubygems_version: 2.2.1
|
115
84
|
signing_key:
|
116
85
|
specification_version: 4
|
117
|
-
summary: Convenience tasks for working with
|
86
|
+
summary: Convenience tasks for working with Apache Marmotta from within a Ruby project.
|
118
87
|
test_files: []
|
119
88
|
has_rdoc:
|