forked from kafkajs/confluent-schema-registry
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dockest.ts
51 lines (45 loc) · 1.26 KB
/
dockest.ts
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
import { default as Dockest, runners, logLevel } from 'dockest'
const { ZooKeeperRunner, SimpleRunner, KafkaRunner } = runners
const zooKeeperRunner = new ZooKeeperRunner({
service: 'zooKeeper',
ports: {
[ZooKeeperRunner.DEFAULT_PORT]: ZooKeeperRunner.DEFAULT_PORT,
},
})
/**
* Debug SchemaRegistry with CURL: https://docs.confluent.io/2.0.0/schema-registry/docs/intro.html
*/
const schemaRegistryRunner = new SimpleRunner({
service: 'schemaRegistry',
image: 'confluentinc/cp-schema-registry:5.3.0',
ports: {
'8982': '8081',
},
environment: {
SCHEMA_REGISTRY_KAFKASTORE_CONNECTION_URL: `${zooKeeperRunner.runnerConfig.service}:${ZooKeeperRunner.DEFAULT_PORT}`,
SCHEMA_REGISTRY_HOST_NAME: 'localhost',
},
})
const kafkaRunner = new KafkaRunner({
service: 'kafka',
image: 'confluentinc/cp-kafka:5.2.2',
dependsOn: [zooKeeperRunner],
ports: {
[KafkaRunner.DEFAULT_PORT_PLAINTEXT]: KafkaRunner.DEFAULT_PORT_PLAINTEXT,
},
})
const dockest = new Dockest({
runners: [kafkaRunner, schemaRegistryRunner],
jest: {
lib: require('jest'),
verbose: true,
},
opts: {
logLevel: logLevel.DEBUG,
afterSetupSleep: 35,
dev: {
debug: process.argv[2] === 'debug' || process.argv[2] === 'dev',
},
},
})
dockest.run()