-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
38 lines (32 loc) · 1.67 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
language: rust
rust:
- 1.36.0
evn:
- RUST_BACKTRACE=1
services:
- postgresql
- docker
branches:
only: ["master"]
cache: cargo
before_cache:
- rm -rfv target/debug/incremental/push_the_elephant-*
- rm -rfv target/debug/.fingerprint/push_the_elephant-*
- rm -rfv target/debug/build/push_the_elephant-*
- rm -rfv target/debug/deps/libpush_the_elephant-*
- rm -rfv target/debug/deps/push_the_elephant-*
- rm -rfv target/debug/push_the_elephant,libpush_the_elephant}.d
- cargo clean -p push_the_elephant
before_script:
- docker swarm init
- docker network create -d overlay confluent_network
- docker stack deploy -c travis/kafka.yml confluent
- psql -c "create database push_the_elephant;" -U postgres
- psql -c "create user push_the_elephant with encrypted password 'push_the_elephant';" -U postgres
- psql -c "grant all privileges on database push_the_elephant to push_the_elephant;" -U postgres
- psql -f travis/sql/init.sql -U postgres push_the_elephant
- while true; do netstat -tpln 2>&1|grep LISTEN|grep 32181 >/dev/null; if [ "$?" == "0" ]; then break; else echo "Waiting for Kafka to start"; sleep 5; docker service logs confluent_zookeeper; docker stack ps confluent --no-trunc; fi; done
- while true; do netstat -tpln 2>&1|grep LISTEN|grep 29092 >/dev/null; if [ "$?" == "0" ]; then break; else echo "Waiting for Kafka to start"; sleep 5; docker service logs confluent_kafka; docker stack ps confluent --no-trunc; fi; done
- export RUST_BACKTRACE=1
- sleep 10
- docker exec -ti `docker ps|grep confluent_kafka|awk '{print($1)}'` kafka-topics --create --partitions 1 --replication-factor 1 --topic events --zookeeper confluent_zookeeper:32181