forked from wurstmeister/kafka-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
96 lines (83 loc) · 2.82 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
sudo: required
language: scala
services:
- docker
# This version will be also tagged as 'latest'
env:
global:
- LATEST="2.13-2.8.1"
# Build recommended versions based on: http://kafka.apache.org/downloads
matrix:
include:
- scala: 2.12
env: KAFKA_VERSION=2.1.1
- scala: 2.12
env: KAFKA_VERSION=2.2.2
- scala: 2.12
env: KAFKA_VERSION=2.3.1
- scala: 2.12
env: KAFKA_VERSION=2.4.1
- scala: 2.12
env: KAFKA_VERSION=2.5.1
- scala: 2.13
env: KAFKA_VERSION=2.6.3
- scala: 2.13
env: KAFKA_VERSION=2.7.2
- scala: 2.13
env: KAFKA_VERSION=2.8.1
# Upgrade Docker Engine so we can use buildx
before_install:
- curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
- sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
- sudo apt-get update
- sudo apt-get -y -o Dpkg::Options::="--force-confnew" install docker-ce
install:
- docker --version
- docker buildx version
- docker-compose --version
- echo "KAFKA VERSION $KAFKA_VERSION"
- echo "SCALA VERSION $TRAVIS_SCALA_VERSION"
- echo "LATEST VERSION $LATEST"
- if [ -z ${DOCKER_PASSWORD+x} ]; then echo "Using unauthenticated pulls on PR"; else echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin; fi
- export CURRENT=${TRAVIS_SCALA_VERSION}-${KAFKA_VERSION}
# Prepare the environment for multi-arch builds
- docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
- docker buildx create --use
# Build all of the platforms and cache the result
- bash docker_buildx
# Using the multi-arch build cache, load the current architecture image into docker for the
# subsequent docker-compose/test stuff.
- bash docker_buildx --load
- docker pull confluentinc/cp-kafkacat
before_script:
- docker-compose -f test/docker-compose.yml up -d zookeeper kafka_1 kafka_2
script:
# Shellcheck main source files
- shellcheck -s bash broker-list.sh create-topics.sh start-kafka.sh download-kafka.sh versions.sh
- cd test
# Shellcheck the tests
- shellcheck -x -e SC1090 -s bash *.sh **/*.sh
- ./verifyImageLabels.sh # Verify docker image's label
- sleep 5 # Wait for containers to start
- docker-compose logs
- docker ps -a
- ./runAllTests.sh
# End-to-End scenario tests
- cd scenarios
- ./runJmxScenario.sh
- cd $TRAVIS_BUILD_DIR
after_script:
- docker-compose stop
# This will deploy from master. Might want to have a single release branch for a little more control
deploy:
- provider: script
script: bash docker_push latest
on:
repo: wurstmeister/kafka-docker
branch: master
condition: $CURRENT = $LATEST
- provider: script
script: bash docker_push "${TRAVIS_SCALA_VERSION}-${KAFKA_VERSION}"
on:
repo: wurstmeister/kafka-docker
# branch: release