Skip to content

Commit

Permalink
Some more backgrounds (#21)
Browse files Browse the repository at this point in the history
  • Loading branch information
thegreystone authored Aug 1, 2024
1 parent c8d7baa commit 325b876
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 5 deletions.
2 changes: 1 addition & 1 deletion k8s/slogan-generator-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ spec:
spec:
containers:
- name: slogan-generator
image: greystone/slogan-generator:0.1.12-SNAPSHOT
image: greystone/slogan-generator:0.1.16
ports:
- containerPort: 9090
command: ["java"]
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Copyright (C) Marcus Hirt, 2024
<modelVersion>4.0.0</modelVersion>
<groupId>se.hirt</groupId>
<artifactId>slogan-generator</artifactId>
<version>0.1.16-SNAPSHOT</version>
<version>0.1.18git -SNAPSHOT</version>

<properties>
<compiler-plugin.version>3.13.0</compiler-plugin.version>
Expand Down
16 changes: 14 additions & 2 deletions release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,22 @@ export DOCKER_BUILDKIT=1
docker buildx create --name multi-arch-builder --use
docker buildx inspect --bootstrap

# Extract version from pom.xml
VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
# Extract version from pom.xml and remove -SNAPSHOT
VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout | sed 's/-SNAPSHOT//')

# Update the version in pom.xml
mvn versions:set -DnewVersion=$VERSION
mvn versions:commit

# Build the project
./mvnw package

# Only building with the release tag - latest is built on each commit to GitHub
docker buildx build -f src/main/docker/Dockerfile.jvm --platform linux/amd64,linux/arm64 -t greystone/slogan-generator:$VERSION --push .

# Revert version in pom.xml to next development version
NEXT_DEV_VERSION="${VERSION%.*}.$((${VERSION##*.} + 1))-SNAPSHOT"
mvn versions:set -DnewVersion=$NEXT_DEV_VERSION
mvn versions:commit

echo "Released version $VERSION and updated the pom to the next development version $NEXT_DEV_VERSION"
2 changes: 2 additions & 0 deletions src/main/java/se/hirt/slogan/ImageGenerator.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
@ApplicationScoped
public class ImageGenerator {
public enum Background {
BLUE("blue"),
CITY("city"),
CLOUDS("clouds"),
LAKE("lake"),
Expand All @@ -56,6 +57,7 @@ public enum Background {
NEBULA("nebula"),
NIGHT("night"),
OCEAN("ocean"),
PURPLE("purple"),
SUNSET("sunset");

private final String fileName;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/se/hirt/slogan/TestResource.java
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public String testImages() {
html.append("<table>");
html.append("<tr><th>Slogan</th><th>Item</th><th>Background</th><th>Image</th></tr>");

String[] items = {"JDK Mission Control", "Java", "OpenJDK"};
String[] items = {"JDK Mission Control", "Java"};
for (String item : items) {
for (ImageGenerator.Background bg : ImageGenerator.Background.values()) {
String staticSlogan = sloganGenerator.generateSlogan(item);
Expand Down
Binary file added src/main/resources/backgrounds/blue.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/main/resources/backgrounds/city.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/main/resources/backgrounds/lush.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/main/resources/backgrounds/purple.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 325b876

Please sign in to comment.