-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
363 additions
and
168 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
esphome2influxdb: Build for (not with) Docker | ||
== | ||
|
||
## Pull | ||
|
||
Run `docker pull climategadgets/esphome2influxdb` and then proceed to [configuration section](#configure-and-run) below - don't forget to adjust the image name to `climategadgets/esphome2influxdb`. | ||
|
||
Just in case, the image is hosted at https://hub.docker.com/r/climategadgets/esphome2influxdb. | ||
|
||
## Build | ||
|
||
Simply run `./gradlew jibDockerBuild`, this will build the image into the local Docker container (might need `sudo` if Docker is only configured to run as `root`). | ||
See [Jib Gradle Plugin](https://github.com/GoogleContainerTools/jib/tree/master/jib-gradle-plugin) docs for details. | ||
Mind the image name, it will be different for different release trains. | ||
|
||
### Build on Raspberry Pi | ||
|
||
The above will work seamlessly only on `amd64` architectures. If you need to build the image on Raspberry Pi, apply the following diff: | ||
|
||
``` | ||
diff --git a/build.gradle.kts b/build.gradle.kts | ||
index e38dbe8..1eaebe3 100644 | ||
--- a/build.gradle.kts | ||
+++ b/build.gradle.kts | ||
@@ -74,6 +74,16 @@ sonarqube { | ||
jib { | ||
+ from { | ||
+ platforms { | ||
+ platform { | ||
+ architecture = "arm" | ||
+ os = "linux" | ||
+ } | ||
+ } | ||
+ } | ||
+ | ||
to { | ||
image ="climategadgets/esphome2influxdb" | ||
} | ||
``` | ||
|
||
> NOTE: Ideally, this should be seamless, but it is not quite trivial and there's no demand. If it bothers you, please [submit a ticket](https://github.com/home-climate-control/esphome2influxdb/issues). | ||
## Configure and Run | ||
|
||
By default, the `esphome2influxdb` Docker image will be created with configuration found in `src/main/resources/esphome2influxdb.yaml` (specifically, source host of `mqtt-esphome` and target host of `influxdb-esphome`). | ||
|
||
To make it do something meaningful, either create DNS records for these hosts and pass them to Docker daemon when you create the container, and/or provide your own configuration and map Docker volumes | ||
(this is the preferred option since you will have to provide your tags at some point anyway, see [Tagging](../tagging.md) for details). | ||
|
||
### Option 1 (default configuration, use this to make sure it works) | ||
|
||
``` | ||
docker run \ | ||
--name esphome2influxdb-defaultconf \ | ||
--rm -it \ | ||
-e TZ=${your-time-zone} \ | ||
--dns ${your-dns-server-host} \ | ||
--dns-search ${your-search-domain} \ | ||
esphome2influxdb | ||
``` | ||
|
||
With this configuration, the logs will be only stored in the container - execute `docker exec -it esphome2influxdb-defaultconf /bin/bash` to connect to it and see what's going on. | ||
|
||
### Option 2 (custom configuration, logs exposed - this is what you'll have to do in the long run) | ||
|
||
``` | ||
docker run \ | ||
--name esphome2influxdb \ | ||
--restart=unless-stopped \ | ||
-e TZ=${your-time-zone} \ | ||
--dns ${your-dns-server-host} \ | ||
--dns-search ${your-search-domain} \ | ||
-v ${your-esphome2influxdb-config-directory}:/app/conf \ | ||
-v ${your-esphome2influxdb-log-directory}:/app/logs \ | ||
esphome2influxdb | ||
``` | ||
|
||
Config directory must have a `esphome2influxdb.yaml` file containing the configuration (see [Minimal Configuration](../minimal-configuration.md) for details). | ||
|
||
--- | ||
[^^^ Index](../index.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
esphome2influxdb: Build with Gradle | ||
== | ||
|
||
Run `./gradlew installDist` (Java 17 or higher). | ||
|
||
This will generate a relocatable directory tree in `./build/install/esphome2influxdb`, | ||
including a runnable Shell script at `./build/install/esphome2influxdb/bin/esphome2influxdb`. | ||
|
||
--- | ||
[^^^ Index](../index.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
esphome2influxdb: Release Notes | ||
== | ||
|
||
## v1.0.1 (2024-08-22) | ||
|
||
* Eclipse Paho MQTT has been replaced with [HiveMQ](https://github.com/hivemq/hivemq-mqtt-client) ([#17](https://github.com/home-climate-control/esphome2influxdb/issues/17)) | ||
* Quality of Life improvements |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
[versions] | ||
|
||
assertj = "3.26.3" | ||
errorprone = "2.30.0" | ||
influxdb = "2.24" | ||
jackson = "2.17.2" | ||
jib = "3.4.3" | ||
junit5 = "5.11.0" | ||
log4j = "2.22.0" | ||
mockito = "5.12.0" | ||
hivemq-mqtt = "1.3.3" | ||
sonarqube = "4.4.1.3373" | ||
|
||
[libraries] | ||
|
||
assertj-core = { module = "org.assertj:assertj-core", version.ref = "assertj" } | ||
errorprone = { module = "com.google.errorprone:error_prone_core", version.ref = "errorprone" } | ||
hivemq-mqtt-client = { module = "com.hivemq:hivemq-mqtt-client", version.ref = "hivemq-mqtt" } | ||
influxdb = { module = "org.influxdb:influxdb-java", version.ref = "influxdb" } | ||
jackson-databind = { module = "com.fasterxml.jackson.core:jackson-databind", version.ref = "jackson" } | ||
jackson-dataformat-yaml = { module = "com.fasterxml.jackson.dataformat:jackson-dataformat-yaml", version.ref = "jackson" } | ||
junit5-api = { module = "org.junit.jupiter:junit-jupiter-api", version.ref = "junit5" } | ||
junit5-engine = { module = "org.junit.jupiter:junit-jupiter-engine", version.ref = "junit5" } | ||
junit5-params = { module = "org.junit.jupiter:junit-jupiter-params", version.ref = "junit5" } | ||
log4j-api = { module = "org.apache.logging.log4j:log4j-api", version.ref = "log4j" } | ||
log4j-core = { module = "org.apache.logging.log4j:log4j-core", version.ref = "log4j" } | ||
mockito = { module = "org.mockito:mockito-core", version.ref = "mockito" } | ||
|
||
[plugins] | ||
errorprone = { id = "net.ltgt.errorprone", version = "4.0.1" } | ||
git-properties = { id = "com.gorylenko.gradle-git-properties", version = "2.4.2" } | ||
gradle-versions = { id = "com.github.ben-manes.versions", version = "0.51.0"} | ||
jib = { id = "com.google.cloud.tools.jib", version.ref = "jib" } | ||
sonarqube = { id = "org.sonarqube", version.ref = "sonarqube" } |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip | ||
networkTimeout=10000 | ||
validateDistributionUrl=true | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.