forked from neo4j-contrib/authentication-extension
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathRakefile
34 lines (27 loc) · 1.31 KB
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
require 'rubygems'
require 'bundler'
version_minor = ENV['BUILD_NUMBER'] || 0
version = "1.0-#{version_minor}"
DEB_NAME='authentication-extension-1.9'
DEB_NAME_VERSION="#{DEB_NAME}_#{version}_amd64"
task :clean do
# rm_rf 'target'
end
task :build do
# sh 'mvn package'
end
task :package do
rm_rf %W(target/deb target/#{DEB_NAME}.deb target/#{DEB_NAME_VERSION}.deb)
mkdir_p 'target/deb/usr/share/neo4j-1.9/plugins'
sh 'cd target/deb/usr/share/neo4j-1.9/plugins && unzip ../../../../../authentication-extension-1.9-1.0-SNAPSHOT-server-plugin.zip'
sh 'find target/deb -name .DS_Store -delete'
deps = %w( neo4j-cloud-1.9 )
sh "fpm -v #{version} -s dir -t deb -n #{DEB_NAME} -m [email protected] #{deps.collect { |d| " -d #{d}" }} --deb-user 0 --deb-group 0 "+
"-p target/#{DEB_NAME_VERSION}.deb --post-install package/post-install.sh --pre-uninstall package/pre-uninstall.sh -C target/deb ."
sh "cp target/#{DEB_NAME_VERSION}.deb target/#{DEB_NAME}.deb"
end
task :deploy => [:clean, :build, :package] do
sh "scp -oStrictHostKeyChecking=no target/#{DEB_NAME_VERSION}.deb [email protected]:/tmp"
sh "ssh -oStrictHostKeyChecking=no [email protected] './take-deb private /tmp/#{DEB_NAME_VERSION}.deb'"
sh "ssh -oStrictHostKeyChecking=no [email protected] 'rm -f /tmp/#{DEB_NAME_VERSION}.deb'"
end