Skip to content

Commit

Permalink
Merge branch 'OpenEMS:develop' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
womoak75 committed Mar 21, 2024
2 parents 54c243b + 5290954 commit 8399bda
Show file tree
Hide file tree
Showing 157 changed files with 2,878 additions and 2,550 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ jobs:
build-java:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Setup Java 21
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
Expand Down Expand Up @@ -65,23 +65,23 @@ jobs:
mkdir -p ./jacoco
echo $PR_NUMBER > ./jacoco/jacoco_report_number
echo '![Code Coverage]'"(https://img.shields.io/badge/Code%20Coverage-${coverage}%25-${color}?style=flat)" > ./jacoco/jacoco_report_badge
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: jacoco_report
path: jacoco/

build-ui:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: '16'

- name: Setup Cache for Node.js
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |
~/.npm
Expand Down
88 changes: 88 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
name: Build OpenEMS Docker Image

on:
push:
branches:
- develop
- main
tags:
- "*.*.*"

jobs:
docker:
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
image: [edge, backend, ui-edge, ui-backend]
include:
- image: edge
dockerfile: tools/docker/edge/Dockerfile
args: ""
- image: ui-edge
dockerfile: tools/docker/ui/Dockerfile
args: "VERSION=openems,openems-edge-docker"
- image: backend
dockerfile: tools/docker/backend/Dockerfile
args: ""
- image: ui-backend
dockerfile: tools/docker/ui/Dockerfile
args: "VERSION=openems,openems-backend-docker"
permissions:
packages: write
contents: read

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Get cleaned branch name
id: clean_name
run: |
REF_NAME=$(echo "${{ github.ref }}" | sed -e 's/refs\/heads\///' -e 's/refs\/tags\///' -e 's/release\/v//')
echo "branch=${REF_NAME}-test" >> "$GITHUB_OUTPUT"
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.REPOSITORY_OWNER }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: |
openems/${{ matrix.image }}
ghcr.io/openems/${{ matrix.image }}
labels: |
org.opencontainers.image.authors=OpenEMS
org.opencontainers.image.title=OpenEMS ${{ matrix.image }}
org.opencontainers.image.vendor=OpenEMS <openems.io>
tags: |
type=semver,pattern={{version}}
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/master' }}
type=raw,value=develop,enable=${{ github.ref == 'refs/heads/develop' }}
- name: Build and push Docker images
uses: docker/build-push-action@v5
with:
file: ${{ matrix.dockerfile }}
platforms: linux/amd64, linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: ${{ matrix.args }}
4 changes: 2 additions & 2 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ jobs:
build-docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Setup Java 21
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
Expand Down
18 changes: 9 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ jobs:
build-java:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Setup Java 21
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
Expand All @@ -36,7 +36,7 @@ jobs:
run: ./gradlew buildEdge buildBackend

- name: Save build-artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: build-artifacts
path: |
Expand All @@ -46,15 +46,15 @@ jobs:
build-ui:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: '16'

- name: Setup Cache for Node.js
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |
~/.npm
Expand All @@ -80,7 +80,7 @@ jobs:
zip -r ../../build/openems-ui.zip ./*
- name: Save build-artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: build-artifacts
path: build/openems-ui.zip
Expand All @@ -90,13 +90,13 @@ jobs:
needs: [build-java, build-ui]
steps:
- name: Load build-artifacts
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: build-artifacts
path: build

- name: Create draft Release
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
with:
draft: true
files: |
Expand Down
8 changes: 4 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -218,10 +218,10 @@ gradle-app.setting
# docs
/doc/build/package-lock.json

# tools (docker) build Directories
/tools/docker/openems-backend/build
/tools/docker/openems-edge/build
/tools/docker/openems-ui/build
# tools (gitpod) build Directories
/tools/gitpod/openems-backend/build
/tools/gitpod/openems-edge/build
/tools/gitpod/openems-ui/build
.atom-build.yml

# OpenEMS temp files
Expand Down
6 changes: 3 additions & 3 deletions .gitpod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ tasks:
./gradlew build buildBackend -x test
rm /tmp/.gradle-lock
command: java
-Dfelix.cm.dir=$(pwd)/tools/docker/openems-backend/config.d
-Dfelix.cm.dir=$(pwd)/tools/gitpod/openems-backend/config.d
-jar build/openems-backend.jar
- init: |
sleep 10 && while [ -f /tmp/.gradle-lock ]; do sleep 1; done
./gradlew build buildEdge -x test
command: java
-Dfelix.cm.dir=$(pwd)/tools/docker/openems-edge/config.d
-Dopenems.data.dir=$(pwd)/tools/docker/openems-edge/data
-Dfelix.cm.dir=$(pwd)/tools/gitpod/openems-edge/config.d
-Dopenems.data.dir=$(pwd)/tools/gitpod/openems-edge/data
-jar build/openems-edge.jar
- init: cd ui && npm install
command: ng serve
Expand Down
2 changes: 1 addition & 1 deletion cnf/build.bnd
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ buildpath: \
org.osgi.service.metatype;version='1.4.1',\
org.osgi.service.metatype.annotations;version='1.4.1',\
org.osgi.util.promise;version='1.2.0',\
com.google.guava;version='33.0.0.jre',\
com.google.guava;version='33.1.0.jre',\
com.google.gson;version='2.10.1',\

testpath: \
Expand Down
23 changes: 12 additions & 11 deletions cnf/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@
<version>2.9.3</version>
</dependency>
<dependency>
<!-- Changelog: https://github.com/steveohara/j2mod/blob/master/RELEASE_NOTES.md -->
<groupId>com.ghgande</groupId>
<artifactId>j2mod</artifactId>
<version>3.2.0</version>
<version>3.2.1</version>
</dependency>
<dependency>
<groupId>com.github.rzymek</groupId>
Expand All @@ -37,7 +38,7 @@
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>33.0.0-jre</version>
<version>33.1.0-jre</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
Expand All @@ -60,31 +61,31 @@
<!-- Used by com.squareup.okhttp3: okhttp -->
<groupId>com.squareup.okio</groupId>
<artifactId>okio-jvm</artifactId>
<version>3.8.0</version>
<version>3.9.0</version>
</dependency>
<dependency>
<!-- Used by com.influxdb: influxdb-client -->
<groupId>com.squareup.retrofit2</groupId>
<artifactId>converter-gson</artifactId>
<version>2.9.0</version>
<version>2.10.0</version>
</dependency>
<dependency>
<!-- Used by com.influxdb: influxdb-client -->
<groupId>com.squareup.retrofit2</groupId>
<artifactId>retrofit</artifactId>
<version>2.9.0</version>
<version>2.10.0</version>
</dependency>
<dependency>
<!-- Used by com.influxdb: influxdb-client -->
<groupId>com.squareup.retrofit2</groupId>
<artifactId>converter-scalars</artifactId>
<version>2.9.0</version>
<version>2.10.0</version>
</dependency>
<dependency>
<!-- Used by com.influxdb: influxdb -->
<groupId>com.squareup.retrofit2</groupId>
<artifactId>adapter-rxjava3</artifactId>
<version>2.9.0</version>
<version>2.10.0</version>
</dependency>
<dependency>
<!-- JavaBeans Activation Framework -->
Expand All @@ -104,7 +105,7 @@
<!-- Changelog: https://github.com/PgBulkInsert/PgBulkInsert/blob/master/CHANGELOG.md-->
<groupId>de.bytefish</groupId>
<artifactId>pgbulkinsert</artifactId>
<version>8.1.2</version>
<version>8.1.3</version>
</dependency>
<!-- eu -->
<dependency>
Expand Down Expand Up @@ -202,7 +203,7 @@
<!-- Changelog: https://github.com/apache/felix-dev/commits/master/http -->
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.http.jetty</artifactId>
<version>5.1.8</version>
<version>5.1.10</version>
</dependency>
<dependency>
<!-- Apache Felix Servlet API -->
Expand Down Expand Up @@ -295,7 +296,7 @@
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-osgi-bundle</artifactId>
<version>1.9.22</version>
<version>1.9.23</version>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlinx</groupId>
Expand Down Expand Up @@ -393,7 +394,7 @@
<!-- Used by io.openems.backend.metadata.odoo -->
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>42.7.2</version>
<version>42.7.3</version>
</dependency>
<dependency>
<!-- Used by com.influxdb: influxdb -->
Expand Down
2 changes: 1 addition & 1 deletion doc/modules/ROOT/pages/contribute/coding-guidelines.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ Use Eclipse checkstyle plugin `Eclipse-cs`. Install it with

Configure it with

* Eclipse -> Window -> Preferences -> New ->
* Eclipse -> Window -> Preferences -> Checkstyle -> New ->
** Type: `Project Relative Configuration`
** Name: `OpenEMS`
** Location: `/cnf/checkstyle.xml`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,9 @@ protected void addOrUpdate(Edge edge, Level sumState) {
this.log.warn(ex.getMessage());
}
} else {
oldMsg.setSumState(sumState, this.timeService.now());
if (oldMsg.getSumState() != sumState) {
oldMsg.setSumState(sumState, this.timeService.now());
}
if (!oldMsg.isEmpty()) {
this.msgScheduler.schedule(oldMsg);
}
Expand Down
Loading

0 comments on commit 8399bda

Please sign in to comment.