logstash-output-jdbc/Rakefile

30 lines
925 B
Ruby
Raw Normal View History

require 'logstash/devutils/rake'
require 'jars/installer'
2016-05-17 16:24:25 +00:00
require 'rubygems'
2016-05-17 11:53:13 +00:00
desc 'Fetch any jars required for this plugin'
task :install_jars do
ENV['JARS_HOME'] = Dir.pwd + '/vendor/jar-dependencies/runtime-jars'
ENV['JARS_VENDOR'] = 'false'
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