Skip to content

Commit

Permalink
Merge branch 'release/2024.4.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
sfeilmeier committed Mar 31, 2024
2 parents a8734be + 679c81a commit 52502bf
Show file tree
Hide file tree
Showing 501 changed files with 18,870 additions and 21,553 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/build.yml
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
@@ -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
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
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
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
57 changes: 37 additions & 20 deletions .gitpod.yml
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 All @@ -36,29 +36,46 @@ tasks:
command: odoo -d prod --addons-path=/workspace/odoo/addons-enabled -i base,partner_firstname,web_m2x_options,stock,openems
ports:
# Backend
- port: 8075 # Backend-to-Backend JSON/REST Api
- name: OpenEMS UI
description: OpenEMS User-Interface. Login admin:admin
port: 4200
onOpen: open-browser
- name: OpenEMS Backend - Odoo. Login admin:admin
description: Odoo - Open Source ERP und CRM
port: 8069
onOpen: open-browser
- name: OpenEMS Backend - Apache Felix Web Console
description: Configure Backend OSGi components via `/system/console/configMgr`
port: 8079
onOpen: ignore
- port: 8076 # Backend-to-Backend JSON/Websocket Api
- name: OpenEMS Edge - Apache Felix Web Console
description: Configure Edge OSGi components via `/system/console/configMgr`
port: 8080
onOpen: ignore
- port: 8079 # Apache Felix Web Console
- name: OpenEMS Backend - Backend-to-Backend JSON/REST Api
description: Cloud-side JSON/REST Api
port: 8075
onOpen: ignore
- port: 8081 # Edge-Websocket
- name: OpenEMS Backend - Backend-to-Backend JSON/Websocket Api
description: Cloud-side JSON/Websocket Api
port: 8076
onOpen: ignore
- port: 8082 # UI-Websocket
- name: OpenEMS Backend - Odoo XML-RPC Api
port: 5432
onOpen: ignore
# Edge
- port: 8080 # Apache Felix Web Console
- name: OpenEMS Backend - Edge-Websocket
description: OpenEMS Edges connect here
port: 8081
onOpen: ignore
- port: 8084 # JSON/REST Api
- name: OpenEMS Backend - UI-Websocket
description: OpenEMS UIs connect here
port: 8082
onOpen: ignore
- port: 8085 # JSON/Websocket Api
- name: OpenEMS Edge - JSON/REST Api
description: Local JSON/REST Api
port: 8084
onOpen: ignore
# UI
- port: 4200
onOpen: open-browser
# Odoo
- port: 8069
onOpen: open-browser
- port: 5432
- name: OpenEMS Edge - JSON/Websocket Api
description: Local JSON/Websocket Api
port: 8085
onOpen: ignore
2 changes: 1 addition & 1 deletion .gradle-wrapper/gradle-wrapper.properties
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
12 changes: 12 additions & 0 deletions build.gradle
Expand Up @@ -78,6 +78,7 @@ subprojects {
reports {
xml.required = false
html.required = false
sarif.required = false
}
minHeapSize = "256m"
maxHeapSize = "1g"
Expand All @@ -104,6 +105,17 @@ task cleanEdge() {
}
}

task checkstyleAll() {
group 'OpenEMS-Build'
description 'Checkstyle all bundles'

subprojects.each { proj ->
if (proj.tasks.findAll { it.name == 'checkstyleMain' }) {
dependsOn(proj.checkstyleMain)
}
}
}

task cleanBackend() {
group 'OpenEMS-Build'
description 'Clean all Backend-Bundles'
Expand Down
2 changes: 1 addition & 1 deletion cnf/build.bnd
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

0 comments on commit 52502bf

Please sign in to comment.