Skip to content

Commit 1f9196b

Browse files
authored
Merge pull request karafka#1 from thijsc/travis
Setup travis build
2 parents 20c0373 + 7c36673 commit 1f9196b

File tree

3 files changed

+30
-2
lines changed

3 files changed

+30
-2
lines changed

Diff for: .travis.yml

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
language: ruby
2+
3+
sudo: false
4+
5+
rvm:
6+
- 2.1
7+
- 2.2
8+
- 2.3
9+
- 2.4
10+
11+
before_install:
12+
- wget http://www.us.apache.org/dist/kafka/0.11.0.1/kafka_2.12-0.11.0.1.tgz -O kafka.tgz
13+
- mkdir -p kafka && tar xzf kafka.tgz -C kafka --strip-components 1
14+
- nohup bash -c "cd kafka && bin/zookeeper-server-start.sh config/zookeeper.properties &"
15+
- nohup bash -c "cd kafka && bin/kafka-server-start.sh config/server.properties &"
16+
17+
before_script:
18+
- cd ext && bundle exec rake && cd ..
19+
- bundle exec rake create_topics
20+
21+
script:
22+
- bundle exec rspec

Diff for: README.md

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Rdkafka
22

3+
[![Build Status](https://travis-ci.org/thijsc/rdkafka-ruby.svg?branch=master)](https://travis-ci.org/thijsc/rdkafka-ruby)
34
[![Gem Version](https://badge.fury.io/rb/rdkafka.svg)](https://badge.fury.io/rb/rdkafka)
45

56
The `rdkafka` gem is a modern Kafka client library for Ruby based on

Diff for: Rakefile

+7-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,13 @@ require "./lib/rdkafka"
22

33
task :create_topics do
44
puts "Creating test topics"
5-
`kafka-topics --create --topic=produce_test_topic --zookeeper=127.0.0.1:2181 --partitions=3 --replication-factor=1`
6-
`kafka-topics --create --topic=rake_test_topic --zookeeper=127.0.0.1:2181 --partitions=3 --replication-factor=1`
5+
kafka_topics = if ENV['TRAVIS']
6+
'kafka/bin/kafka-topics.sh'
7+
else
8+
'kafka-topics'
9+
end
10+
`#{kafka_topics} --create --topic=produce_test_topic --zookeeper=127.0.0.1:2181 --partitions=3 --replication-factor=1`
11+
`#{kafka_topics} --create --topic=rake_test_topic --zookeeper=127.0.0.1:2181 --partitions=3 --replication-factor=1`
712
end
813

914
task :produce_messages do

0 commit comments

Comments
 (0)