Skip to content

Commit

Permalink
Update .gitignore
Browse files Browse the repository at this point in the history
Exclude logs dir
  • Loading branch information
sebastienvermeille committed May 14, 2023
1 parent cb70d44 commit b994ce8
Show file tree
Hide file tree
Showing 14 changed files with 402 additions and 317 deletions.
8 changes: 8 additions & 0 deletions .docker/init.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env bash
# Init script for rika2mqtt

# Run it
java --add-opens=java.base/java.net=ALL-UNNAMED \
--add-opens=java.base/java.io=ALL-UNNAMED \
--add-opens=java.base/java.nio=ALL-UNNAMED \
-jar rika2mqtt.jar
18 changes: 18 additions & 0 deletions .mvn/wrapper/maven-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.7/apache-maven-3.8.7-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar
9 changes: 9 additions & 0 deletions DEV.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,12 @@ Then you can create a run configuration similar to that:
> (You can do other ways, the advantage here is that you never risk to publish your credentials by accident)
Then you can run the project and enjoy :)

## CLI Style

If you want to run the project in pure CLI there is a `Makefile` available.

You can run:
* `make jar`
* `make test`
* `make docker`
13 changes: 13 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM eclipse-temurin:20.0.1_9-jre-jammy

RUN mkdir -p /opt/rika2mqtt

WORKDIR /opt/rika2mqtt
COPY .docker/ .
COPY bridge/target/*.jar rika2mqtt.jar
RUN sh -c 'touch rika2mqtt.jar'

RUN chmod a+x init.sh

# set the startup command to run
ENTRYPOINT ["/opt/rika2mqtt/init.sh"]
14 changes: 14 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
DEFAULT: jar

# ============= BUILDS =============
jar: ## build executable jar
@./scripts/build.sh

test: ## execute tests
@./scripts/test.sh

docker: jar ## build docker image
@./scripts/docker.sh

help: ## print this help
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z0-9_-]+:.*?## / {gsub("\\\\n",sprintf("\n%22c",""), $$2);printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ docker run \
-e MQTT_HOST=127.0.0.1 \
-e MQTT_USER=<optional> \
-e MQTT_PASSWORD=<optional> \
-d --name rika2mqtt sbeex/rika2mqtt:latest
-d --name rika2mqtt cookiecodedev/rika2mqtt:latest
```

It will publish to the defined mqtt server in topic `tele/rika2mqtt`.
Expand Down
11 changes: 3 additions & 8 deletions bridge/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,9 @@
</dependency>
<!-- 3rd part dependencies-->
<dependency>
<artifactId>javax.el-api</artifactId>
<groupId>javax.el</groupId>
<version>3.0.0</version>
</dependency>
<dependency>
<artifactId>javax.el</artifactId>
<groupId>org.glassfish</groupId>
<version>3.0.0</version>
<groupId>org.glassfish.expressly</groupId>
<artifactId>expressly</artifactId>
<version>5.0.0</version>
</dependency>
<!-- test dependencies -->
<dependency>
Expand Down
10 changes: 5 additions & 5 deletions bridge/src/main/resources/application.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
rika:
email:
password:
email: ${RIKA_EMAIL}
password: ${RIKA_PASSWORD}
keepAliveTimeout: PT60S
mqtt:
host:
username:
password:
host: ${MQTT_HOST}
username: ${MQTT_USERNAME}
password: ${MQTT_PASSWORD}
bridge:
reportInterval: PT60S
2 changes: 1 addition & 1 deletion bridge/src/main/resources/logback-spring.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
org.fusesource.jansi:jansi:1.8 on the class path. Note that
Unix-based operating systems such as Linux and Mac OS X
support ANSI color codes by default. -->
<withJansi>true</withJansi>
<!-- <withJansi>true</withJansi>-->
<encoder>
<pattern>[%thread] %highlight(%-5level) %cyan(%logger{15}) - %msg %n</pattern>
</encoder>
Expand Down
Loading

0 comments on commit b994ce8

Please sign in to comment.