Docker-compose file, logo update and formatting
This commit is contained in:
parent
7314cde1f4
commit
d874f4bd5f
3 changed files with 42 additions and 24 deletions
|
@ -3,19 +3,22 @@ package de.rpr.githubreleases
|
||||||
import java.io.PrintStream
|
import java.io.PrintStream
|
||||||
import java.time.LocalDateTime
|
import java.time.LocalDateTime
|
||||||
|
|
||||||
fun log(message: String, logLevel: LogLevel = LogLevel.INFO) {
|
fun log(
|
||||||
|
message: String,
|
||||||
|
logLevel: LogLevel = LogLevel.INFO,
|
||||||
|
) {
|
||||||
logLevel.log(message)
|
logLevel.log(message)
|
||||||
}
|
}
|
||||||
|
|
||||||
enum class LogLevel(val order: Int, val out: PrintStream) {
|
enum class LogLevel(val order: Int, val out: PrintStream) {
|
||||||
DEBUG(1, System.out),
|
DEBUG(1, System.out),
|
||||||
INFO(2, System.out),
|
INFO(2, System.out),
|
||||||
ERROR(3, System.err);
|
ERROR(3, System.err),
|
||||||
|
;
|
||||||
|
|
||||||
|
|
||||||
fun log(message: String) {
|
fun log(message: String) {
|
||||||
val activeLogLevel = System.getenv("LOG_LEVEL")
|
val activeLogLevel =
|
||||||
|
System.getenv("LOG_LEVEL")
|
||||||
?.let { LogLevel.valueOf(it.uppercase()) }
|
?.let { LogLevel.valueOf(it.uppercase()) }
|
||||||
?: LogLevel.valueOf("INFO")
|
?: LogLevel.valueOf("INFO")
|
||||||
if (activeLogLevel.order <= this.order) {
|
if (activeLogLevel.order <= this.order) {
|
||||||
|
@ -23,7 +26,8 @@ enum class LogLevel(val order: Int, val out: PrintStream) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private val timeFormatter = java.time.format.DateTimeFormatterBuilder()
|
private val timeFormatter =
|
||||||
|
java.time.format.DateTimeFormatterBuilder()
|
||||||
.appendValue(java.time.temporal.ChronoField.HOUR_OF_DAY, 2)
|
.appendValue(java.time.temporal.ChronoField.HOUR_OF_DAY, 2)
|
||||||
.appendLiteral(':')
|
.appendLiteral(':')
|
||||||
.appendValue(java.time.temporal.ChronoField.MINUTE_OF_HOUR, 2)
|
.appendValue(java.time.temporal.ChronoField.MINUTE_OF_HOUR, 2)
|
||||||
|
@ -34,10 +38,11 @@ enum class LogLevel(val order: Int, val out: PrintStream) {
|
||||||
.appendValue(java.time.temporal.ChronoField.MILLI_OF_SECOND, 3)
|
.appendValue(java.time.temporal.ChronoField.MILLI_OF_SECOND, 3)
|
||||||
.toFormatter()
|
.toFormatter()
|
||||||
|
|
||||||
private val dateTimeFormatter = java.time.format.DateTimeFormatterBuilder()
|
private val dateTimeFormatter =
|
||||||
|
java.time.format.DateTimeFormatterBuilder()
|
||||||
.parseCaseInsensitive()
|
.parseCaseInsensitive()
|
||||||
.append(java.time.format.DateTimeFormatter.ISO_LOCAL_DATE)
|
.append(java.time.format.DateTimeFormatter.ISO_LOCAL_DATE)
|
||||||
.appendLiteral('T')
|
.appendLiteral('T')
|
||||||
.append(timeFormatter)
|
.append(timeFormatter)
|
||||||
.toFormatter();
|
.toFormatter()
|
||||||
}
|
}
|
||||||
|
|
13
docker-compose.yml
Normal file
13
docker-compose.yml
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
version: '3.1'
|
||||||
|
services:
|
||||||
|
github-release-bot:
|
||||||
|
image: github-release-bot:latest
|
||||||
|
restart: unless-stopped
|
||||||
|
environment:
|
||||||
|
SCHEDULING_DELAY: ${SCHEDULING_DELAY}
|
||||||
|
REPO_PATH: /releases
|
||||||
|
PUBLISH_DRY_RUN: ${PUBLISH_DRY_RUN}
|
||||||
|
LOG_LEVEL: ${LOG_LEVEL}
|
||||||
|
volumes:
|
||||||
|
- ./releases:/releases
|
||||||
|
- ./config.json:/config.json
|
Loading…
Reference in a new issue