diff --git a/.woodpecker/.build.yml b/.woodpecker/.build.yml index 1af7a08..10d90bb 100644 --- a/.woodpecker/.build.yml +++ b/.woodpecker/.build.yml @@ -29,3 +29,16 @@ steps: - RCON_CLI_VER=1.6.4 - memory_size=3G # - java_flags="-Dlog4j2.formatMsgNoLookups=true -XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC -XX:+AlwaysPreTouch -XX:G1NewSizePercent=30 -XX:G1MaxNewSizePercent=40 -XX:G1HeapRegionSize=8M -XX:G1ReservePercent=20 -XX:G1HeapWastePercent=5 -XX:G1MixedGCCountTarget=4 -XX:InitiatingHeapOccupancyPercent=15 -XX:G1MixedGCLiveThresholdPercent=90 -XX:G1RSetUpdatingPauseTimePercent=5 -XX:SurvivorRatio=32 -XX:+PerfDisableSharedMem -XX:MaxTenuringThreshold=1 -Dusing.aikars.flags=mcflags.emc.gs -Dcom.mojang.eula.agree=true" + discord notification: + image: appleboy/drone-discord + settings: + webhook_id: + from_secret: discord_webhook_id + webhook_token: + from_secret: discord_webhook_token + message: > + {{#success build.status}} + build {{build.number}} succeeded. Good job. + {{else}} + build {{build.number}} failed. Fix me please. + {{/success}} diff --git a/Dockerfile b/Dockerfile index d85ea0e..dc1ce57 100755 --- a/Dockerfile +++ b/Dockerfile @@ -2,6 +2,10 @@ ############## We use a java base image ################ ######################################################## FROM debian:sid AS build +# Set environment variables to avoid interactive prompts +ENV DEBIAN_FRONTEND=noninteractive +ENV APT_LISTCHANGES_FRONTEND=none + RUN ls -lah /etc/apt/sources.list.d/ RUN sed -i -e's/ main/ main contrib non-free/g' /etc/apt/sources.list.d/debian.sources RUN apt update && apt install -y curl jq bash sudo wget gnupg2 @@ -32,6 +36,10 @@ RUN java -Dpaperclip.patchonly=true -jar /opt/minecraft/paperclip.jar; exit 0 ############## Running environment ##################### ######################################################## FROM debian:sid AS runtime +# Set environment variables to avoid interactive prompts +ENV DEBIAN_FRONTEND=noninteractive +ENV APT_LISTCHANGES_FRONTEND=none + RUN sed -i -e's/ main/ main contrib non-free/g' /etc/apt/sources.list.d/debian.sources RUN apt update && apt install -y curl jq bash sudo wget gnupg2 diff --git a/discord-notify.sh b/discord-notify.sh new file mode 100755 index 0000000..6a4eef2 --- /dev/null +++ b/discord-notify.sh @@ -0,0 +1,10 @@ +#!/bin/bash +set -euxo pipefail + +# Message to send +MESSAGE="A build of the Docker container has finished." + +# Send the message using curl +curl -X POST $WEBHOOK_URL \ + -H "Content-Type: application/json" \ + -d "{\"content\": \"$MESSAGE\"}"