-
Notifications
You must be signed in to change notification settings - Fork 74
/
.travis.yml
61 lines (57 loc) · 2.78 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
language: go
go:
- 1.3
- 1.4
before_install:
- export KAFKA_VERSION=0.8.2.1
- export SCALA_VERSION=2.10
- export KAFKA_RELEASE=kafka_$SCALA_VERSION-$KAFKA_VERSION
- export KAFKA_URL=https://archive.apache.org/dist/kafka/$KAFKA_VERSION/$KAFKA_RELEASE.tgz
- export KAFKA_PATH=/tmp/$KAFKA_RELEASE
- export BROKER_ID=1
- export HOST_IP=localhost
- export PORT=9092
- export ZK_VERSION=3.4.6
- export ZK_RELEASE=zookeeper-$ZK_VERSION
- export ZK_URL=https://archive.apache.org/dist/zookeeper/zookeeper-$ZK_VERSION/$ZK_RELEASE.tar.gz
- export ZK_HOME=/tmp/$ZK_RELEASE
- export REGISTRY_VERSION=1.0
- export SCALA_VERSION=2.10.4
- export REGISTRY_URL=http://packages.confluent.io/archive/$REGISTRY_VERSION/confluent-$REGISTRY_VERSION-$SCALA_VERSION.tar.gz
- export REGISTRY_HOME=/tmp/confluent-$REGISTRY_VERSION
- export GOMAXPROCS=1
- wget -q $KAFKA_URL -O /tmp/$KAFKA_RELEASE.tgz
- tar xfz /tmp/$KAFKA_RELEASE.tgz -C /tmp
- wget -q $ZK_URL -O /tmp/$ZK_RELEASE.tar.gz
- tar -xzf /tmp/$ZK_RELEASE.tar.gz -C /tmp
- cp $ZK_HOME/conf/zoo_sample.cfg $ZK_HOME/conf/zoo.cfg
- wget -q $REGISTRY_URL -O /tmp/confluent-$REGISTRY_VERSION-$SCALA_VERSION.tgz
- tar xfz /tmp/confluent-$REGISTRY_VERSION-$SCALA_VERSION.tgz -C /tmp
- $ZK_HOME/bin/zkServer.sh start
- sed -r -i "s/(zookeeper.connect)=(.*)/\\1=$ZK_PORT_2181_TCP_ADDR/g" $KAFKA_PATH/config/server.properties
- sed -r -i "s/(broker.id)=(.*)/\\1=$BROKER_ID/g" $KAFKA_PATH/config/server.properties
- sed -r -i "s/#(advertised.host.name)=(.*)/\\1=$HOST_IP/g" $KAFKA_PATH/config/server.properties
- sed -r -i "s/^(port)=(.*)/\\1=$PORT/g" $KAFKA_PATH/config/server.properties
- sed -r -i "s/^(log4j.rootLogger)=(.*)( stdout)/\\1=WARN\\3/g" $KAFKA_PATH/config/log4j.properties
- $KAFKA_PATH/bin/kafka-server-start.sh $KAFKA_PATH/config/server.properties &
- $REGISTRY_HOME/bin/schema-registry-start $REGISTRY_HOME/etc/schema-registry/schema-registry.properties &
- sleep 15
script: go test -v -timeout 20m
after_script:
- $KAFKA_PATH/bin/kafka-server-stop.sh
- $ZK_HOME/bin/zkServer.sh stop
- $REGISTRY_HOME/bin/schema-registry-stop