ow-nuxeo 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/ow-nuxeo +112 -0
- metadata +48 -0
data/bin/ow-nuxeo
ADDED
@@ -0,0 +1,112 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
# WARNING: Script is Linux/Cygwin-dependant
|
4
|
+
|
5
|
+
require 'fileutils'
|
6
|
+
require 'net/http'
|
7
|
+
|
8
|
+
begin
|
9
|
+
require './nuxeo-config.rb'
|
10
|
+
rescue LoadError
|
11
|
+
puts "!!! WARNING: 'nuxeo-config.rb' is missing. Using default config.\n\n"
|
12
|
+
begin
|
13
|
+
require './nuxeo-config.default.rb'
|
14
|
+
rescue LoadError
|
15
|
+
defaultConfig = File.new("nuxeo-config.default.rb", "w")
|
16
|
+
defaultConfig.puts "# Target custom Nuxeo\nNUXEO_PATH = '/data/services/nuxeo/'\n\n\# Distrib config\nMARKETPLACE_PROJECT_PATH = './myproject-distribution'\nMARKETPLACE_PACKAGE_NAME = 'myproject'\n"
|
17
|
+
defaultConfig.close
|
18
|
+
puts "\nABORTING: Created default config file './nuxeo-config.default.rb',"
|
19
|
+
puts "Please copy it customize it to fit your project."
|
20
|
+
exit 0
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
def nuxeoctl()
|
25
|
+
if defined? NUXEO_PATH
|
26
|
+
path = Dir[NUXEO_PATH + 'bin/nuxeoctl'][0]
|
27
|
+
end
|
28
|
+
if path == nil
|
29
|
+
puts "ERROR, is the Nuxeo path (in 'nuxeo-config.rb') defined correctly?"
|
30
|
+
exit 0
|
31
|
+
else
|
32
|
+
return path
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
def displayHelp()
|
37
|
+
puts '> EXAMPLES'
|
38
|
+
puts 'ow-nuxeo build'
|
39
|
+
puts 'ow-nuxeo fastbuild deploy run'
|
40
|
+
puts 'ow-nuxeo version 1.0.0'
|
41
|
+
puts 'ow-nuxeo release'
|
42
|
+
puts ''
|
43
|
+
puts '> AVAILABLE GOALS'
|
44
|
+
puts 'build : Build with tests.'
|
45
|
+
puts 'fastbuild : Build, skip the tests to go faster'
|
46
|
+
puts 'fastestbuild : Build, skip the tests and run offline to go faster (consequence: won\'t update any SNAPSHOT from remote repos, like NxStudio plugins)'
|
47
|
+
puts 'release : Build with tests and the "release" flag enabled, to enable the use of the tagged NxStudio plugin'
|
48
|
+
puts 'version [VERSION] : Updates the modules version. Specify the new version number as the second parameter.'
|
49
|
+
puts 'test : Run the Maven tests only, in debug mode'
|
50
|
+
puts 'deploy : Deploy the marketplace package'
|
51
|
+
puts 'reset : Reset the data of your custom Nuxeo (by deleting the nxserver/data folder, i.e. it only works with Derby/H2)'
|
52
|
+
puts 'run : Runs Nuxeo'
|
53
|
+
puts ''
|
54
|
+
end
|
55
|
+
|
56
|
+
ARGV.each do |arg|
|
57
|
+
|
58
|
+
case arg
|
59
|
+
|
60
|
+
when 'test'
|
61
|
+
system('mvnDebug -DforkMode=never test')
|
62
|
+
|
63
|
+
when 'build'
|
64
|
+
system('mvn clean install')
|
65
|
+
|
66
|
+
when 'fastbuild'
|
67
|
+
system('mvn clean install -DskipTests=true')
|
68
|
+
|
69
|
+
when 'fastestbuild'
|
70
|
+
system('mvn clean install -DskipTests=true -o')
|
71
|
+
|
72
|
+
when 'version'
|
73
|
+
system('mvn versions:set -DnewVersion=' + ARGV[1])
|
74
|
+
break
|
75
|
+
|
76
|
+
when 'release'
|
77
|
+
system('mvn clean install -Drelease')
|
78
|
+
|
79
|
+
when 'deploy'
|
80
|
+
nuxeoctlPath = nuxeoctl()
|
81
|
+
system('chmod +x ' + nuxeoctlPath)
|
82
|
+
|
83
|
+
puts '> Uninstalling package "' + MARKETPLACE_PACKAGE_NAME + '"...'
|
84
|
+
system(nuxeoctlPath + ' --accept=true mp-remove ' + MARKETPLACE_PACKAGE_NAME)
|
85
|
+
|
86
|
+
puts '', '> Installing new marketplace package...'
|
87
|
+
system(nuxeoctlPath + ' --accept=true mp-install ' + Dir[MARKETPLACE_PROJECT_PATH + '/target/' + MARKETPLACE_PROJECT_PATH.split('/').last + '-*.zip'][0])
|
88
|
+
|
89
|
+
when 'run'
|
90
|
+
system(nuxeoctl() + ' console')
|
91
|
+
|
92
|
+
when 'reset'
|
93
|
+
if defined? NUXEO_PATH
|
94
|
+
deletePath = Dir[NUXEO_PATH + 'nxserver/data'][0]
|
95
|
+
end
|
96
|
+
if !deletePath.nil?
|
97
|
+
puts '> Deleting', deletePath
|
98
|
+
FileUtils.rm_r deletePath, :force => true
|
99
|
+
else
|
100
|
+
puts '> Nothing to delete'
|
101
|
+
end
|
102
|
+
|
103
|
+
else
|
104
|
+
displayHelp()
|
105
|
+
|
106
|
+
end
|
107
|
+
|
108
|
+
end
|
109
|
+
|
110
|
+
if ARGV.empty?
|
111
|
+
displayHelp()
|
112
|
+
end
|
metadata
ADDED
@@ -0,0 +1,48 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: ow-nuxeo
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.1
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Marwane Kalam-Alami
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2013-07-12 00:00:00.000000000 Z
|
13
|
+
dependencies: []
|
14
|
+
description: Eases common tasks with Nuxeo projects, from building to launching. Mainly
|
15
|
+
targeted to Open Wide projects, but could fit any Maven project hierarchy using
|
16
|
+
a Nuxeo Marketplace package for distribution.
|
17
|
+
email: marwane.kalam-alami@openwide.fr
|
18
|
+
executables:
|
19
|
+
- ow-nuxeo
|
20
|
+
extensions: []
|
21
|
+
extra_rdoc_files: []
|
22
|
+
files:
|
23
|
+
- bin/ow-nuxeo
|
24
|
+
homepage: http://rubygems.org/gems/ow-nuxeo
|
25
|
+
licenses: []
|
26
|
+
post_install_message:
|
27
|
+
rdoc_options: []
|
28
|
+
require_paths:
|
29
|
+
- bin
|
30
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
31
|
+
none: false
|
32
|
+
requirements:
|
33
|
+
- - ! '>='
|
34
|
+
- !ruby/object:Gem::Version
|
35
|
+
version: '0'
|
36
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
37
|
+
none: false
|
38
|
+
requirements:
|
39
|
+
- - ! '>='
|
40
|
+
- !ruby/object:Gem::Version
|
41
|
+
version: '0'
|
42
|
+
requirements: []
|
43
|
+
rubyforge_project:
|
44
|
+
rubygems_version: 1.8.23
|
45
|
+
signing_key:
|
46
|
+
specification_version: 3
|
47
|
+
summary: A script for Nuxeo projects based on the Open Wide skeleton
|
48
|
+
test_files: []
|