2016-05-17 15:21:37 +00:00
|
|
|
require 'logstash/devutils/rake'
|
2016-05-13 21:12:57 +00:00
|
|
|
require 'jars/installer'
|
2016-05-17 16:24:25 +00:00
|
|
|
require 'rubygems'
|
2016-05-17 11:53:13 +00:00
|
|
|
|
2016-05-17 15:21:37 +00:00
|
|
|
desc 'Fetch any jars required for this plugin'
|
2016-05-13 21:12:57 +00:00
|
|
|
task :install_jars do
|
2016-05-17 15:21:37 +00:00
|
|
|
ENV['JARS_HOME'] = Dir.pwd + '/vendor/jar-dependencies/runtime-jars'
|
|
|
|
ENV['JARS_VENDOR'] = 'false'
|
2016-05-13 21:12:57 +00:00
|
|
|
Jars::Installer.new.vendor_jars!(false)
|
|
|
|
end
|
2016-05-17 16:24:25 +00:00
|
|
|
|
|
|
|
desc 'Pre-release checks'
|
|
|
|
task :pre_release_checks do
|
|
|
|
|
|
|
|
if `git status --porcelain`.chomp.length > 0
|
|
|
|
raise "You have unstaged or uncommitted changes! Please only deploy from a clean working directory!"
|
|
|
|
end
|
|
|
|
|
|
|
|
spec = Gem::Specification::load("logstash-output-jdbc.gemspec")
|
|
|
|
expected_tag_name = "v#{spec.version}"
|
|
|
|
|
|
|
|
current_tag_name = `git describe --exact-match --tags HEAD`.chomp
|
|
|
|
if $? == 0
|
|
|
|
raise "Expected git tag to be '#{expected_tag_name}', but got '#{current_tag_name}'." if current_tag_name != expected_tag_name
|
|
|
|
else
|
|
|
|
raise "Expected git tag to be '#{expected_tag_name}, but got nothing."
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|