feature/docker #3
4 changed files with 51 additions and 6 deletions
47
.drone.yml
47
.drone.yml
|
@ -1,12 +1,19 @@
|
|||
kind: pipeline
|
||||
type: docker
|
||||
name: default
|
||||
|
||||
steps:
|
||||
- name: test
|
||||
- name: build
|
||||
image: maven:3.8-openjdk-18-slim
|
||||
commands:
|
||||
- mvn clean install -DskipTests=true -Dmaven.javadoc.skip=true -B -V
|
||||
when:
|
||||
branch:
|
||||
include:
|
||||
- master
|
||||
- feature/*
|
||||
- name: test
|
||||
image: maven:3.8-openjdk-18-slim
|
||||
commands:
|
||||
- mvn test -B
|
||||
when:
|
||||
branch:
|
||||
|
@ -26,3 +33,39 @@ steps:
|
|||
event:
|
||||
exclude:
|
||||
- pull_request
|
||||
- name: build_docker_image
|
||||
image: plugins/docker
|
||||
settings:
|
||||
registry: gittr.ch
|
||||
username: manuel
|
||||
password:
|
||||
from_secret: docker-token
|
||||
repo: gittr.ch/java/labyrinth
|
||||
tags:
|
||||
- latest
|
||||
dockerfile: docker/Dockerfile
|
||||
when:
|
||||
branch:
|
||||
- master
|
||||
event:
|
||||
exclude:
|
||||
- pull_request
|
||||
- tag
|
||||
- name: build_docker_image_release
|
||||
image: plugins/docker
|
||||
settings:
|
||||
registry: gittr.ch
|
||||
username: manuel
|
||||
password:
|
||||
from_secret: docker-token
|
||||
repo: gittr.ch/java/labyrinth
|
||||
tags:
|
||||
- latest
|
||||
- ${DRONE_TAG}
|
||||
dockerfile: docker/Dockerfile
|
||||
when:
|
||||
branch:
|
||||
- master
|
||||
event:
|
||||
include:
|
||||
- tag
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
FROM openjdk:11
|
||||
FROM openjdk:17-slim
|
||||
|
||||
COPY target/labyrinth-server-*.jar /app/app.jar
|
||||
|
||||
|
|
2
pom.xml
2
pom.xml
|
@ -18,6 +18,8 @@
|
|||
<logback.version>1.4.6</logback.version>
|
||||
<lombok.version>1.18.26</lombok.version>
|
||||
<slf4j.version>2.0.5</slf4j.version>
|
||||
<java.source.version>17</java.source.version>
|
||||
<java.target.version>17</java.target.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
|
|
|
@ -105,15 +105,15 @@ public class LabyrinthServer {
|
|||
exchange.sendResponseHeaders(302, -1);
|
||||
return;
|
||||
}
|
||||
final Labyrinth labyrinth = new Labyrinth(width, height, id);
|
||||
final byte[] render;
|
||||
try {
|
||||
final Labyrinth labyrinth = new Labyrinth(width, height, id);
|
||||
render = output.render(labyrinth);
|
||||
} catch (Exception e) {
|
||||
responseHeaders.add("Content-type", "text/plain; charset=UTF-8");
|
||||
exchange.sendResponseHeaders(500, 0);
|
||||
final OutputStream responseBody = exchange.getResponseBody();
|
||||
responseBody.write(("Error: " + e).getBytes(StandardCharsets.UTF_8));
|
||||
responseBody.write(("Error: " + e.getMessage()).getBytes(StandardCharsets.UTF_8));
|
||||
responseBody.flush();
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue