Compare commits
17 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1dc4940d8c | ||
|
|
1cefb117fe | ||
| ba48da80ed | |||
| 4fd83f48cd | |||
| 24acc0b942 | |||
| cab7ec34d2 | |||
|
|
c8cd05f035 | ||
|
|
3e35dfb9ba | ||
| f465e1c101 | |||
|
|
2f4cc2de8b | ||
| b977996689 | |||
| 1544776ecc | |||
| 468d9660c4 | |||
| a43f5b30f7 | |||
| 4ebd9a7262 | |||
| ad4179a517 | |||
|
|
f7705e15e5 |
34
.github/workflows/ci.yaml
vendored
34
.github/workflows/ci.yaml
vendored
@@ -11,6 +11,8 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Check out repository code
|
- name: Check out repository code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Setup JDK
|
- name: Setup JDK
|
||||||
uses: actions/setup-java@v4
|
uses: actions/setup-java@v4
|
||||||
@@ -18,8 +20,14 @@ jobs:
|
|||||||
distribution: 'zulu'
|
distribution: 'zulu'
|
||||||
java-version: '21'
|
java-version: '21'
|
||||||
|
|
||||||
|
- name: new Version
|
||||||
|
if: github.ref_name == 'main'
|
||||||
|
run: |
|
||||||
|
./mvnw -B --no-transfer-progress versions:set -DremoveSnapshot
|
||||||
|
|
||||||
- name: Build Runner
|
- name: Build Runner
|
||||||
run: ./mvnw --no-transfer-progress clean verify -Pnative -Dquarkus.native.remote-container-build=true
|
run: |
|
||||||
|
./mvnw -B --no-transfer-progress clean verify -Pnative -Dquarkus.native.remote-container-build=true -Djgitver.skip=true
|
||||||
|
|
||||||
- name: Add coverage to PR
|
- name: Add coverage to PR
|
||||||
id: jacoco
|
id: jacoco
|
||||||
@@ -31,10 +39,32 @@ jobs:
|
|||||||
min-coverage-changed-files: 60
|
min-coverage-changed-files: 60
|
||||||
title: ${{ env.REPO }} Coverage
|
title: ${{ env.REPO }} Coverage
|
||||||
|
|
||||||
|
- id: version
|
||||||
|
name: Version
|
||||||
|
run: echo "VERSION=$(./mvnw help:evaluate -Dexpression=project.version -q -DforceStdout)" >> ${GITHUB_OUTPUT}
|
||||||
|
|
||||||
- name: Build Container
|
- name: Build Container
|
||||||
if: github.ref_name == 'main'
|
if: github.ref_name == 'main'
|
||||||
run: docker build -f src/main/docker/Dockerfile.native-micro -t ${{ env.REPO }} .
|
run: |
|
||||||
|
echo ${{secrets.PACKAGES_TOKEN}} | docker login --username ${{ secrets.PACKAGES_USER }} --password-stdin git.arindy.de
|
||||||
|
docker build -f src/main/docker/Dockerfile.native-micro -t git.arindy.de/arindy/dice-tower:latest -t git.arindy.de/arindy/dice-tower:${{ steps.version.outputs.VERSION }} .
|
||||||
|
docker push git.arindy.de/arindy/dice-tower:${{ steps.version.outputs.VERSION }}
|
||||||
|
docker push git.arindy.de/arindy/dice-tower:latest
|
||||||
|
|
||||||
- name: Deploy
|
- name: Deploy
|
||||||
if: github.ref_name == 'main'
|
if: github.ref_name == 'main'
|
||||||
run: "docker compose up -d"
|
run: "docker compose up -d"
|
||||||
|
|
||||||
|
- name: create tag
|
||||||
|
if: github.ref_name == 'main'
|
||||||
|
run: |
|
||||||
|
git config user.email "ci@git.arindy.de"
|
||||||
|
git config user.name "gitea"
|
||||||
|
git add ./pom.xml
|
||||||
|
git commit -m "[no ci] release ${{ steps.version.outputs.VERSION }}"
|
||||||
|
./mvnw -B --no-transfer-progress clean validate -Pnew-snapshot
|
||||||
|
git add ./pom.xml
|
||||||
|
git commit -m "[no ci] prepare new Version"
|
||||||
|
git tag ${{ steps.version.outputs.VERSION }} -m "release ${{ steps.version.outputs.VERSION }}"
|
||||||
|
git push origin main
|
||||||
|
git push origin ${{ steps.version.outputs.VERSION }}
|
||||||
|
|||||||
25
README.md
25
README.md
@@ -6,7 +6,8 @@
|
|||||||
|
|
||||||
<p align="center">
|
<p align="center">
|
||||||
<a href="#key-features">Key Features</a> •
|
<a href="#key-features">Key Features</a> •
|
||||||
<a href="#how-to-build">How To Build</a> •
|
<a href="#start-container">Start Container</a> •
|
||||||
|
<a href="#how-to-build-from-scratch">How To Build from scratch</a> •
|
||||||
<a href="#credits">Credits</a> •
|
<a href="#credits">Credits</a> •
|
||||||
<a href="#license">License</a>
|
<a href="#license">License</a>
|
||||||
</p>
|
</p>
|
||||||
@@ -24,8 +25,28 @@
|
|||||||
* Watch roll results (also available as Browser Source in OBS)
|
* Watch roll results (also available as Browser Source in OBS)
|
||||||
|
|
||||||
---
|
---
|
||||||
|
## Start Container
|
||||||
|
|
||||||
## How To Build
|
You can start dice-tower with docker compose
|
||||||
|
|
||||||
|
Create a `compose.yml`-File with following content:
|
||||||
|
```yaml
|
||||||
|
services:
|
||||||
|
api:
|
||||||
|
container_name: dice-tower
|
||||||
|
image: git.arindy.de/arindy/dice-tower:latest
|
||||||
|
restart: always
|
||||||
|
ports:
|
||||||
|
- "8080:8080"
|
||||||
|
```
|
||||||
|
Run the container with:
|
||||||
|
```bash
|
||||||
|
docker compose up -d
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## How To Build from scratch
|
||||||
|
|
||||||
To clone and run this application, you'll need `git`, `java21` and `docker`.
|
To clone and run this application, you'll need `git`, `java21` and `docker`.
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
services:
|
services:
|
||||||
api:
|
api:
|
||||||
container_name: dice-tower
|
container_name: dice-tower
|
||||||
image: dice-tower
|
image: git.arindy.de/arindy/dice-tower:latest
|
||||||
restart: always
|
restart: always
|
||||||
networks:
|
networks:
|
||||||
- reverse_proxy
|
- reverse_proxy
|
||||||
|
|||||||
46
pom.xml
46
pom.xml
@@ -4,7 +4,7 @@
|
|||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>de.arindy</groupId>
|
<groupId>de.arindy</groupId>
|
||||||
<artifactId>dice-tower</artifactId>
|
<artifactId>dice-tower</artifactId>
|
||||||
<version>1.0.0-SNAPSHOT</version>
|
<version>1.0.3-SNAPSHOT</version>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<compiler-plugin.version>3.13.0</compiler-plugin.version>
|
<compiler-plugin.version>3.13.0</compiler-plugin.version>
|
||||||
@@ -21,6 +21,13 @@
|
|||||||
<rxjava-version>2.2.8</rxjava-version>
|
<rxjava-version>2.2.8</rxjava-version>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
|
<scm>
|
||||||
|
<connection>scm:git:https://git.arindy.de/arindy/dice-tower.git</connection>
|
||||||
|
<developerConnection>scm:git:https://git.arindy.de/arindy/dice-tower.git</developerConnection>
|
||||||
|
<url>https://git.arindy.de/arindy/dice-tower</url>
|
||||||
|
<tag>HEAD</tag>
|
||||||
|
</scm>
|
||||||
|
|
||||||
<dependencyManagement>
|
<dependencyManagement>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
@@ -267,5 +274,42 @@
|
|||||||
<quarkus.native.enabled>true</quarkus.native.enabled>
|
<quarkus.native.enabled>true</quarkus.native.enabled>
|
||||||
</properties>
|
</properties>
|
||||||
</profile>
|
</profile>
|
||||||
|
<profile>
|
||||||
|
<id>new-snapshot</id>
|
||||||
|
<build>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.codehaus.mojo</groupId>
|
||||||
|
<artifactId>build-helper-maven-plugin</artifactId>
|
||||||
|
<version>3.0.0</version>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<id>next-version</id>
|
||||||
|
<goals>
|
||||||
|
<goal>parse-version</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.codehaus.mojo</groupId>
|
||||||
|
<artifactId>versions-maven-plugin</artifactId>
|
||||||
|
<version>2.18.0</version>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<id>release-version</id>
|
||||||
|
<phase>validate</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>set</goal>
|
||||||
|
</goals>
|
||||||
|
<configuration>
|
||||||
|
<newVersion>${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.nextIncrementalVersion}-SNAPSHOT</newVersion>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
</profile>
|
||||||
</profiles>
|
</profiles>
|
||||||
</project>
|
</project>
|
||||||
|
|||||||
35
src/main/kotlin/de/arindy/dicetower/IndexResource.kt
Normal file
35
src/main/kotlin/de/arindy/dicetower/IndexResource.kt
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
package de.arindy.dicetower
|
||||||
|
|
||||||
|
import io.quarkus.qute.TemplateInstance
|
||||||
|
import io.quarkus.runtime.annotations.RegisterForReflection
|
||||||
|
import jakarta.enterprise.context.ApplicationScoped
|
||||||
|
import jakarta.ws.rs.Consumes
|
||||||
|
import jakarta.ws.rs.GET
|
||||||
|
import jakarta.ws.rs.POST
|
||||||
|
import jakarta.ws.rs.Path
|
||||||
|
import jakarta.ws.rs.PathParam
|
||||||
|
import jakarta.ws.rs.Produces
|
||||||
|
import jakarta.ws.rs.QueryParam
|
||||||
|
import jakarta.ws.rs.core.Context
|
||||||
|
import jakarta.ws.rs.core.MediaType
|
||||||
|
import jakarta.ws.rs.sse.OutboundSseEvent
|
||||||
|
import jakarta.ws.rs.sse.Sse
|
||||||
|
import jakarta.ws.rs.sse.SseBroadcaster
|
||||||
|
import jakarta.ws.rs.sse.SseEventSink
|
||||||
|
import org.eclipse.microprofile.config.inject.ConfigProperty
|
||||||
|
import java.util.UUID
|
||||||
|
|
||||||
|
@Path("/")
|
||||||
|
@ApplicationScoped
|
||||||
|
final class IndexResource() {
|
||||||
|
|
||||||
|
@ConfigProperty(name = "quarkus.application.version")
|
||||||
|
private lateinit var version: String
|
||||||
|
|
||||||
|
@GET
|
||||||
|
@Produces(MediaType.TEXT_HTML)
|
||||||
|
fun get(): TemplateInstance {
|
||||||
|
return Templates.index(version)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -9,4 +9,6 @@ object Templates {
|
|||||||
external fun overlay(diceid: String, scale: Int?, clearAfter: Long?): TemplateInstance
|
external fun overlay(diceid: String, scale: Int?, clearAfter: Long?): TemplateInstance
|
||||||
@JvmStatic
|
@JvmStatic
|
||||||
external fun results(room: String, name: String?, user: String?): TemplateInstance
|
external fun results(room: String, name: String?, user: String?): TemplateInstance
|
||||||
|
@JvmStatic
|
||||||
|
external fun index(version: String): TemplateInstance
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
<title>Dice-Tower</title>
|
<title>Dice-Tower</title>
|
||||||
<link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">
|
<link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">
|
||||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
|
||||||
<script src="/vendor/color-picker.js"></script>
|
<script src="/META-INF/resources/vendor/color-picker.js"></script>
|
||||||
<style>
|
<style>
|
||||||
.w3-theme-l6 {
|
.w3-theme-l6 {
|
||||||
color: #000 !important;
|
color: #000 !important;
|
||||||
@@ -611,6 +611,7 @@
|
|||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
<footer class="w3-theme-l1 w3-center w3-padding-16">
|
<footer class="w3-theme-l1 w3-center w3-padding-16">
|
||||||
|
Version {version} ::
|
||||||
<a href="https://git.arindy.de/arindy/dice-tower" target="_blank" class="w3-hover-text-black">Dice-Tower on my
|
<a href="https://git.arindy.de/arindy/dice-tower" target="_blank" class="w3-hover-text-black">Dice-Tower on my
|
||||||
GitTea</a>
|
GitTea</a>
|
||||||
</footer>
|
</footer>
|
||||||
Reference in New Issue
Block a user