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:
parent
e6e9ac3b04
commit
0ff6f16ec7
10
.travis.yml
10
.travis.yml
|
@ -3,12 +3,6 @@ cache: bundler
|
||||||
rvm:
|
rvm:
|
||||||
- jruby
|
- jruby
|
||||||
before_script:
|
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
|
- ./scripts/travis-before_script.sh
|
||||||
- export JDBC_DERBY_JAR=/tmp/derby.jar
|
- source ./scripts/travis-variables.sh
|
||||||
- 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
|
|
||||||
script: bundle exec rspec
|
script: bundle exec rspec
|
||||||
|
|
19
README.md
19
README.md
|
@ -21,7 +21,7 @@ See CHANGELOG.md
|
||||||
Released versions are available via rubygems, and typically tagged.
|
Released versions are available via rubygems, and typically tagged.
|
||||||
|
|
||||||
For development:
|
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 v2.x branch for logstash v2
|
||||||
- See v1.5 branch for logstash v1.5
|
- See v1.5 branch for logstash v1.5
|
||||||
- See v1.4 branch for logstash 1.4
|
- See v1.4 branch for logstash 1.4
|
||||||
|
@ -36,14 +36,17 @@ For development:
|
||||||
- And then configure (examples below)
|
- And then configure (examples below)
|
||||||
|
|
||||||
## Running tests
|
## Running tests
|
||||||
At this time tests only run against Derby, in an in-memory database.
|
For development tests are recommended to run inside a virtual machine (Vagrantfile is included in the repo), as it requires
|
||||||
Acceptance tests for individual database engines will be added over time.
|
access to various database engines and could completely destroy any data in a live system.
|
||||||
|
|
||||||
Assuming valid jruby is installed
|
If you have vagrant available:
|
||||||
- First time, issue `jruby -S bundle install` to install dependencies
|
- `vagrant up`
|
||||||
- Next, download Derby jar from https://db.apache.org/derby/
|
- `vagrant ssh`
|
||||||
- Run the tests `JDBC_DERBY_JAR=path/to/derby.jar jruby -S rspec`
|
- `cd /vagrant`
|
||||||
- Optionally add the `JDBC_DEBUG=1` env variable to add logging to stdout
|
- `gem install bundler`
|
||||||
|
- `cd /vagrant && bundle install`
|
||||||
|
- `./scripts/travis-before_script.sh && source ./scripts/travis-variables.sh`
|
||||||
|
- `bundle exec rspec`
|
||||||
|
|
||||||
## Configuration options
|
## Configuration options
|
||||||
|
|
||||||
|
|
2
Vagrantfile
vendored
2
Vagrantfile
vendored
|
@ -9,7 +9,5 @@ Vagrant.configure(2) do |config|
|
||||||
gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
|
gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
|
||||||
curl -sSL https://get.rvm.io | bash -s stable --ruby=jruby-1.7
|
curl -sSL https://get.rvm.io | bash -s stable --ruby=jruby-1.7
|
||||||
usermod -a -G rvm vagrant
|
usermod -a -G rvm vagrant
|
||||||
gem install bundler
|
|
||||||
cd /vagrant && bundle install
|
|
||||||
EOP
|
EOP
|
||||||
end
|
end
|
||||||
|
|
|
@ -3,7 +3,7 @@ Gem::Specification.new do |s|
|
||||||
s.version = "1.0.0.pre"
|
s.version = "1.0.0.pre"
|
||||||
s.licenses = [ "Apache License (2.0)" ]
|
s.licenses = [ "Apache License (2.0)" ]
|
||||||
s.summary = "This plugin allows you to output to SQL, via JDBC"
|
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.authors = ["the_angry_angel"]
|
||||||
s.email = "karl+github@theangryangel.co.uk"
|
s.email = "karl+github@theangryangel.co.uk"
|
||||||
s.homepage = "https://github.com/theangryangel/logstash-output-jdbc"
|
s.homepage = "https://github.com/theangryangel/logstash-output-jdbc"
|
||||||
|
|
8
scripts/travis-before_script.sh
Executable file
8
scripts/travis-before_script.sh
Executable 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
|
3
scripts/travis-variables.sh
Normal file
3
scripts/travis-variables.sh
Normal 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
|
Loading…
Reference in New Issue
Block a user