Pre-release checks test.

This commit is contained in:
Karl Southern 2016-05-17 17:24:25 +01:00
parent baaeba3c07
commit b14d61ccf0
2 changed files with 21 additions and 0 deletions

View File

@ -1,5 +1,6 @@
require 'logstash/devutils/rake'
require 'jars/installer'
require 'rubygems'
desc 'Fetch any jars required for this plugin'
task :install_jars do
@ -7,3 +8,22 @@ task :install_jars do
ENV['JARS_VENDOR'] = 'false'
Jars::Installer.new.vendor_jars!(false)
end
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

1
Vagrantfile vendored
View File

@ -6,6 +6,7 @@ Vagrant.configure(2) do |config|
config.vm.synced_folder '.', '/vagrant', type: :virtualbox
config.vm.provision 'shell', inline: <<-EOP
apt-get install git -y -q
gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
curl -sSL https://get.rvm.io | bash -s stable --ruby=jruby-1.7
usermod -a -G rvm vagrant