Skip to content

Commit 6c12c95

Browse files
fbivilleali-ince
andauthored
build: configure and document direnv (#19)
Rely on direnv to set up environment variables and fall back to "regular" Maven usage for running end-to-end tests. Co-authored-by: Ali Ince <ali-ince@users.noreply.github.com>
1 parent f5fbdfd commit 6c12c95

File tree

3 files changed

+26
-17
lines changed

3 files changed

+26
-17
lines changed

.envrc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
export BROKER_EXTERNAL_HOST="localhost:9092"
2+
export SCHEMA_CONTROL_REGISTRY_URI="http://schema-registry:8081"
3+
export SCHEMA_CONTROL_REGISTRY_EXTERNAL_URI="http://localhost:8081"
4+
export KAFKA_CONNECT_EXTERNAL_URI="http://localhost:8083"
5+
export NEO4J_URI="neo4j://neo4j"
6+
export NEO4J_EXTERNAL_URI="neo4j://localhost"
7+
export NEO4J_USER="neo4j"
8+
export NEO4J_PASSWORD="password"

README.md

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,17 +31,33 @@ Then add the following content into `settings/servers` inside ~/.m2/settings.xml
3131

3232
### Build locally
3333

34-
You can build and package the project using;
34+
Make sure you install [dip](https://github.com/bibendi/dip) and [direnv](https://direnv.net/).
3535

36+
For the end-to-end tests, you need to provision a local Kafka cluster, Kafka Connect instance and a Neo4j server.
37+
This is done by running (re-running recreates the containers):
38+
39+
```shell
40+
dip provision
41+
```
42+
43+
Make sure `direnv` exports environment variables by running:
44+
```shell
45+
direnv allow .
3646
```
37-
mvn clean package
47+
48+
You can build and package the project using (as many as time as necessary):
49+
50+
```shell
51+
mvn verify
3852
```
3953

4054
You'll find the connector archive
4155
at `kafka-connect-neo4j/target/components/packages/neo4j-kafka-connect-neo4j-{version}.zip`.
4256

4357
### Code Format
4458

59+
TL;DR? You can run `dip format`.
60+
4561
For Kotlin code, we follow the [ktfmt](https://github.com/facebook/ktfmt) code style. There is an `.editorconfig` file
4662
to mimic the underlying style guides for built-in Intellij code style rules, but we recommend
4763
[ktfmt IntelliJ Plugin](https://plugins.jetbrains.com/plugin/14912-ktfmt) for formatting. Remember that your builds will

dip.yml

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -19,21 +19,6 @@ interaction:
1919
find ./docker/plugins ! -name '.keep' -type f -exec rm -f {} + &&
2020
cp ./packaging/target/*.jar ./docker/plugins"
2121
22-
run-e2e:
23-
description: verify connector packages
24-
runner: local
25-
command: >
26-
sh -c "./mvnw verify -DskipUnitTests"
27-
environment:
28-
BROKER_EXTERNAL_HOST: "localhost:9092"
29-
SCHEMA_CONTROL_REGISTRY_URI: "http://schema-registry:8081"
30-
SCHEMA_CONTROL_REGISTRY_EXTERNAL_URI: "http://localhost:8081"
31-
KAFKA_CONNECT_EXTERNAL_URI: "http://localhost:8083"
32-
NEO4J_URI: "neo4j://neo4j"
33-
NEO4J_EXTERNAL_URI: "neo4j://localhost"
34-
NEO4J_USER: "neo4j"
35-
NEO4J_PASSWORD: "password"
36-
3722
stop-connect:
3823
description: stops connect container
3924
service: connect

0 commit comments

Comments
 (0)