diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 388a5fea..9e436904 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -16,7 +16,18 @@ on: - "[0-9]+.[0-9]+.[0-9]+-adopt13" jobs: + test: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Run tests + run: | + tests/test.sh build: + needs: + - test runs-on: ubuntu-latest steps: @@ -32,4 +43,5 @@ jobs: tag_with_sha: false cache_froms: itzg/minecraft-server:latest add_git_labels: true + labels: org.opencontainers.image.url=https://github.com/itzg/docker-minecraft-server,org.opencontainers.image.documentation=https://github.com/itzg/docker-minecraft-server push: true diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 94d19913..16096da7 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -5,15 +5,12 @@ on: branches: [ master ] jobs: - build: + test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - name: Build Docker image - uses: docker/build-push-action@v1.1.0 - with: - tag_with_sha: true - cache_froms: itzg/minecraft-server:latest - push: false + - name: Run tests + run: | + tests/test.sh diff --git a/Dockerfile b/Dockerfile index 67a88b02..017babd9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,9 @@ FROM adoptopenjdk/openjdk8-openj9:alpine-nightly -LABEL maintainer "itzg" +LABEL org.opencontainers.image.authors="Geoff Bourne " + +# upgrade all packages since alpine jre8 base image tops out at 8u212 +RUN apk -U --no-cache upgrade RUN apk add --no-cache -U \ openssl \ diff --git a/README.md b/README.md index 5a7a9279..c1abb810 100644 --- a/README.md +++ b/README.md @@ -324,7 +324,13 @@ There are some limitations to what characters you can use. Variables will be replaced in files with the following extensions: `.yml`, `.yaml`, `.txt`, `.cfg`, `.conf`, `.properties`. -Specific files can be excluded by listing their name (without path) in the variable `REPLACE_ENV_VARIABLES_EXCLUDES`. Paths can be excluded by listing them in the variable `REPLACE_ENV_VARIABLES_EXCLUDE_PATHS`. +Specific files can be excluded by listing their name (without path) in the variable `REPLACE_ENV_VARIABLES_EXCLUDES`. + +Paths can be excluded by listing them in the variable `REPLACE_ENV_VARIABLES_EXCLUDE_PATHS`. Path +excludes are recursive. Here is an example: +``` +REPLACE_ENV_VARIABLES_EXCLUDE_PATHS="/data/plugins/Essentials/userdata/ /data/plugins/MyPlugin/" +``` Here is a full example where we want to replace values inside a `database.yml`. diff --git a/start-configuration b/start-configuration index 1218ca7f..deb6e792 100644 --- a/start-configuration +++ b/start-configuration @@ -45,6 +45,22 @@ if [[ $PROXY ]]; then sleep 5 fi +if [[ $RCON_PASSWORD_FILE ]]; then + log "" + if [ ! -e ${RCON_PASSWORD_FILE} ]; then + log "Initial RCON password file ${RCON_PASSWORD_FILE} does not seems to exist." + log "Please ensure your configuration." + log "If you are using Docker Secrets feature, please check this for further information: " + log " https://docs.docker.com/engine/swarm/secrets" + log "" + exit 1 + else + RCON_PASSWORD=$(cat ${RCON_PASSWORD_FILE}) + export RCON_PASSWORD + fi + log "" +fi + export SERVER_PROPERTIES=/data/server.properties export VERSIONS_JSON=https://launchermeta.mojang.com/mc/game/version_manifest.json @@ -129,8 +145,9 @@ case "${TYPE^^}" in *) log "Invalid type: '$TYPE'" - log "Must be: VANILLA, FORGE, BUKKIT, SPIGOT, PAPER, FTBA, CURSEFORGE, SPONGEVANILLA," - log " CUSTOM, CURSE_INSTANCE, MAGMA, MOHIST, CATSERVER" + log "Must be: VANILLA, FORGE, BUKKIT, SPIGOT, PAPER, FTBA (multiarch-only)," + log " CURSE_INSTANCE, CURSEFORGE, SPONGEVANILLA," + log " CUSTOM, MAGMA, MOHIST, CATSERVER" exit 1 ;; diff --git a/start-deployBukkitSpigot b/start-deployBukkitSpigot index 28b07fd3..cb2309e5 100644 --- a/start-deployBukkitSpigot +++ b/start-deployBukkitSpigot @@ -62,8 +62,12 @@ function downloadSpigot { downloadUrl="https://cdn.getbukkit.org/${getbukkitFlavor}/${getbukkitFlavor}-${VANILLA_VERSION}.jar" fi + if [ -f $SERVER ]; then + # tell curl to only download when newer + zarg="-z $SERVER" + fi log "Downloading $match from $downloadUrl ..." - curl -fsSL -o $SERVER "$downloadUrl" + curl -fsSL -o $SERVER $zarg "$downloadUrl" if [[ $? != 0 || $(grep -c "DOCTYPE html" $SERVER) != 0 ]]; then cat <