upload-to-packages #24
6
.github/workflows/ci.yaml
vendored
6
.github/workflows/ci.yaml
vendored
@ -45,7 +45,11 @@ jobs:
|
|||||||
|
|
||||||
- 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'
|
||||||
|
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
|
||||||
|
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>
|
Loading…
x
Reference in New Issue
Block a user