Quick and dirty setup so it's a bit quicker to use vagrant. I'll clean this up more later.

This commit is contained in:
Karl Southern 2016-05-03 17:09:21 +01:00
parent e6e9ac3b04
commit 0ff6f16ec7
6 changed files with 25 additions and 19 deletions

View File

@ -3,12 +3,6 @@ cache: bundler
rvm:
- jruby
before_script:
- wget http://search.maven.org/remotecontent?filepath=org/apache/derby/derby/10.12.1.1/derby-10.12.1.1.jar -O /tmp/derby.jar
- export JDBC_DERBY_JAR=/tmp/derby.jar
- sudo apt-get install mysql-server -qq -y
- echo "create database logstash_output_jdbc_test;" | mysql -u root
- wget http://search.maven.org/remotecontent?filepath=mysql/mysql-connector-java/5.1.38/mysql-connector-java-5.1.38.jar -O /tmp/mysql.jar
- export JDBC_MYSQL_JAR=/tmp/mysql.jar
- wget http://search.maven.org/remotecontent?filepath=org/xerial/sqlite-jdbc/3.8.11.2/sqlite-jdbc-3.8.11.2.jar -O /tmp/sqlite.jar
- export JDBC_SQLITE_JAR=/tmp/sqlite.jar
- ./scripts/travis-before_script.sh
- source ./scripts/travis-variables.sh
script: bundle exec rspec

View File

@ -21,7 +21,7 @@ See CHANGELOG.md
Released versions are available via rubygems, and typically tagged.
For development:
- See master branch for logstash v5
- See master branch for logstash v5 (currently **development only**)
- See v2.x branch for logstash v2
- See v1.5 branch for logstash v1.5
- See v1.4 branch for logstash 1.4
@ -36,14 +36,17 @@ For development:
- And then configure (examples below)
## Running tests
At this time tests only run against Derby, in an in-memory database.
Acceptance tests for individual database engines will be added over time.
For development tests are recommended to run inside a virtual machine (Vagrantfile is included in the repo), as it requires
access to various database engines and could completely destroy any data in a live system.
Assuming valid jruby is installed
- First time, issue `jruby -S bundle install` to install dependencies
- Next, download Derby jar from https://db.apache.org/derby/
- Run the tests `JDBC_DERBY_JAR=path/to/derby.jar jruby -S rspec`
- Optionally add the `JDBC_DEBUG=1` env variable to add logging to stdout
If you have vagrant available:
- `vagrant up`
- `vagrant ssh`
- `cd /vagrant`
- `gem install bundler`
- `cd /vagrant && bundle install`
- `./scripts/travis-before_script.sh && source ./scripts/travis-variables.sh`
- `bundle exec rspec`
## Configuration options

2
Vagrantfile vendored
View File

@ -9,7 +9,5 @@ Vagrant.configure(2) do |config|
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
gem install bundler
cd /vagrant && bundle install
EOP
end

View File

@ -3,7 +3,7 @@ Gem::Specification.new do |s|
s.version = "1.0.0.pre"
s.licenses = [ "Apache License (2.0)" ]
s.summary = "This plugin allows you to output to SQL, via JDBC"
s.description = "This gem is a logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/plugin install gemname. This gem is not a stand-alone program"
s.description = "This gem is a logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/logstash-plugin install 'logstash-output-jdbc'. This gem is not a stand-alone program"
s.authors = ["the_angry_angel"]
s.email = "karl+github@theangryangel.co.uk"
s.homepage = "https://github.com/theangryangel/logstash-output-jdbc"

View File

@ -0,0 +1,8 @@
#!/bin/bash
wget http://search.maven.org/remotecontent?filepath=org/apache/derby/derby/10.12.1.1/derby-10.12.1.1.jar -O /tmp/derby.jar
sudo apt-get install mysql-server -qq -y
echo "create database logstash_output_jdbc_test;" | mysql -u root
wget http://search.maven.org/remotecontent?filepath=mysql/mysql-connector-java/5.1.38/mysql-connector-java-5.1.38.jar -O /tmp/mysql.jar
wget http://search.maven.org/remotecontent?filepath=org/xerial/sqlite-jdbc/3.8.11.2/sqlite-jdbc-3.8.11.2.jar -O /tmp/sqlite.jar

View File

@ -0,0 +1,3 @@
export JDBC_DERBY_JAR=/tmp/derby.jar
export JDBC_MYSQL_JAR=/tmp/mysql.jar
export JDBC_SQLITE_JAR=/tmp/sqlite.jar