github.com/rbisecke/kafka-go@v0.4.27/.circleci/config.yml (about) 1 version: 2 2 jobs: 3 # The kafka 0.10 tests are maintained as a separate configuration because 4 # kafka only supported plain text SASL in this version. 5 kafka-010: 6 working_directory: &working_directory /go/src/github.com/rbisecke/kafka-go 7 environment: 8 KAFKA_VERSION: "0.10.1" 9 docker: 10 - image: circleci/golang 11 - image: wurstmeister/zookeeper 12 ports: 13 - 2181:2181 14 - image: wurstmeister/kafka:0.10.1.1 15 ports: 16 - 9092:9092 17 - 9093:9093 18 environment: 19 KAFKA_BROKER_ID: '1' 20 KAFKA_CREATE_TOPICS: 'test-writer-0:3:1,test-writer-1:3:1' 21 KAFKA_DELETE_TOPIC_ENABLE: 'true' 22 KAFKA_ADVERTISED_HOST_NAME: 'localhost' 23 KAFKA_ADVERTISED_PORT: '9092' 24 KAFKA_ZOOKEEPER_CONNECT: 'localhost:2181' 25 KAFKA_AUTO_CREATE_TOPICS_ENABLE: 'true' 26 KAFKA_MESSAGE_MAX_BYTES: '200000000' 27 KAFKA_LISTENERS: 'PLAINTEXT://:9092,SASL_PLAINTEXT://:9093' 28 KAFKA_ADVERTISED_LISTENERS: 'PLAINTEXT://localhost:9092,SASL_PLAINTEXT://localhost:9093' 29 KAFKA_SASL_ENABLED_MECHANISMS: 'PLAIN' 30 KAFKA_OPTS: "-Djava.security.auth.login.config=/opt/kafka/config/kafka_server_jaas.conf" 31 CUSTOM_INIT_SCRIPT: |- 32 echo -e 'KafkaServer {\norg.apache.kafka.common.security.plain.PlainLoginModule required\n username="adminplain"\n password="admin-secret"\n user_adminplain="admin-secret";\n };' > /opt/kafka/config/kafka_server_jaas.conf; 33 steps: &steps 34 - checkout 35 - restore_cache: 36 key: kafka-go-mod-{{ checksum "go.sum" }}-1 37 - run: 38 name: Download dependencies 39 command: go mod download 40 - save_cache: 41 key: kafka-go-mod-{{ checksum "go.sum" }}-1 42 paths: 43 - /go/pkg/mod 44 - run: 45 name: Test kafka-go 46 command: go test -race -cover ./... 47 - run: 48 name: Test kafka-go/sasl/aws_msk_iam 49 working_directory: ./sasl/aws_msk_iam 50 command: go test -race -cover ./... 51 52 # Starting at version 0.11, the kafka features and configuration remained 53 # mostly stable, so we can use this CI job configuration as template for other 54 # versions as well. 55 kafka-011: 56 working_directory: *working_directory 57 environment: 58 KAFKA_VERSION: "0.11.0" 59 docker: 60 - image: circleci/golang 61 - image: wurstmeister/zookeeper 62 ports: 63 - 2181:2181 64 - image: wurstmeister/kafka:2.11-0.11.0.3 65 ports: 66 - 9092:9092 67 - 9093:9093 68 environment: &environment 69 KAFKA_BROKER_ID: '1' 70 KAFKA_CREATE_TOPICS: 'test-writer-0:3:1,test-writer-1:3:1' 71 KAFKA_DELETE_TOPIC_ENABLE: 'true' 72 KAFKA_ADVERTISED_HOST_NAME: 'localhost' 73 KAFKA_ADVERTISED_PORT: '9092' 74 KAFKA_ZOOKEEPER_CONNECT: 'localhost:2181' 75 KAFKA_AUTO_CREATE_TOPICS_ENABLE: 'true' 76 KAFKA_MESSAGE_MAX_BYTES: '200000000' 77 KAFKA_LISTENERS: 'PLAINTEXT://:9092,SASL_PLAINTEXT://:9093' 78 KAFKA_ADVERTISED_LISTENERS: 'PLAINTEXT://localhost:9092,SASL_PLAINTEXT://localhost:9093' 79 KAFKA_SASL_ENABLED_MECHANISMS: 'PLAIN,SCRAM-SHA-256,SCRAM-SHA-512' 80 KAFKA_OPTS: "-Djava.security.auth.login.config=/opt/kafka/config/kafka_server_jaas.conf" 81 CUSTOM_INIT_SCRIPT: |- 82 apk add libgcc; 83 echo -e 'KafkaServer {\norg.apache.kafka.common.security.scram.ScramLoginModule required\n username="adminscram"\n password="admin-secret";\n org.apache.kafka.common.security.plain.PlainLoginModule required\n username="adminplain"\n password="admin-secret"\n user_adminplain="admin-secret";\n };' > /opt/kafka/config/kafka_server_jaas.conf; 84 /opt/kafka/bin/kafka-configs.sh --zookeeper localhost:2181 --alter --add-config 'SCRAM-SHA-256=[password=admin-secret-256],SCRAM-SHA-512=[password=admin-secret-512]' --entity-type users --entity-name adminscram 85 steps: *steps 86 87 kafka-101: 88 working_directory: *working_directory 89 environment: 90 KAFKA_VERSION: "1.0.1" 91 docker: 92 - image: circleci/golang 93 - image: wurstmeister/zookeeper 94 ports: 95 - 2181:2181 96 - image: wurstmeister/kafka:2.11-1.0.1 97 ports: 98 - 9092:9092 99 - 9093:9093 100 environment: *environment 101 steps: *steps 102 103 kafka-111: 104 working_directory: *working_directory 105 environment: 106 KAFKA_VERSION: "1.1.1" 107 docker: 108 - image: circleci/golang 109 - image: wurstmeister/zookeeper 110 ports: 111 - 2181:2181 112 - image: wurstmeister/kafka:2.11-1.1.1 113 ports: 114 - 9092:9092 115 - 9093:9093 116 environment: *environment 117 steps: *steps 118 119 kafka-201: 120 working_directory: *working_directory 121 environment: 122 KAFKA_VERSION: "2.0.1" 123 docker: 124 - image: circleci/golang 125 - image: wurstmeister/zookeeper 126 ports: 127 - 2181:2181 128 - image: wurstmeister/kafka:2.12-2.0.1 129 ports: 130 - 9092:9092 131 - 9093:9093 132 environment: *environment 133 steps: *steps 134 135 kafka-211: 136 working_directory: *working_directory 137 environment: 138 KAFKA_VERSION: "2.1.1" 139 docker: 140 - image: circleci/golang 141 - image: wurstmeister/zookeeper 142 ports: 143 - 2181:2181 144 - image: wurstmeister/kafka:2.12-2.1.1 145 ports: 146 - 9092:9092 147 - 9093:9093 148 environment: *environment 149 steps: *steps 150 151 kafka-222: 152 working_directory: *working_directory 153 environment: 154 KAFKA_VERSION: "2.2.2" 155 docker: 156 - image: circleci/golang 157 - image: wurstmeister/zookeeper 158 ports: 159 - 2181:2181 160 - image: wurstmeister/kafka:2.12-2.2.2 161 ports: 162 - 9092:9092 163 - 9093:9093 164 environment: *environment 165 steps: *steps 166 167 kafka-231: 168 working_directory: *working_directory 169 environment: 170 KAFKA_VERSION: "2.3.1" 171 docker: 172 - image: circleci/golang 173 - image: wurstmeister/zookeeper 174 ports: 175 - 2181:2181 176 - image: wurstmeister/kafka:2.12-2.3.1 177 ports: 178 - 9092:9092 179 - 9093:9093 180 environment: *environment 181 steps: *steps 182 183 kafka-241: 184 working_directory: *working_directory 185 environment: 186 KAFKA_VERSION: "2.4.1" 187 docker: 188 - image: circleci/golang 189 - image: wurstmeister/zookeeper 190 ports: 191 - 2181:2181 192 - image: wurstmeister/kafka:2.12-2.4.1 193 ports: 194 - 9092:9092 195 - 9093:9093 196 environment: *environment 197 steps: *steps 198 199 kafka-260: 200 working_directory: *working_directory 201 environment: 202 KAFKA_VERSION: "2.6.0" 203 docker: 204 - image: circleci/golang 205 - image: wurstmeister/zookeeper 206 ports: 207 - 2181:2181 208 - image: wurstmeister/kafka:2.13-2.6.0 209 ports: 210 - 9092:9092 211 - 9093:9093 212 environment: *environment 213 steps: *steps 214 215 kafka-271: 216 working_directory: *working_directory 217 environment: 218 KAFKA_VERSION: "2.7.1" 219 docker: 220 - image: circleci/golang 221 - image: wurstmeister/zookeeper 222 ports: 223 - 2181:2181 224 - image: wurstmeister/kafka:2.13-2.7.1 225 ports: 226 - 9092:9092 227 - 9093:9093 228 environment: *environment 229 steps: *steps 230 231 workflows: 232 version: 2 233 run: 234 jobs: 235 - kafka-010 236 - kafka-011 237 - kafka-101 238 - kafka-111 239 - kafka-201 240 - kafka-211 241 - kafka-222 242 - kafka-231 243 - kafka-241 244 - kafka-260 245 - kafka-271