Compare commits

...

14 Commits

Author SHA1 Message Date
Geoff Bourne
68b926f2b1 Auto-merging via docker-versions-create 2022-02-05 22:52:42 -06:00
Geoff Bourne
306671ffe7 Disabled world_from_tarzstd test for now 2022-02-05 22:50:12 -06:00
Geoff Bourne
be99d171f5 Added extract detection for application/x-zstd 2022-02-05 22:47:58 -06:00
Geoff Bourne
882f3b1cd8 Added zstd package 2022-02-05 22:44:13 -06:00
Geoff Bourne
eb6c7c98f0 build: adjusted discord workflow name 2022-02-05 22:40:42 -06:00
Geoff Bourne
3472c67ca8 build: give issue-label workflow a name 2022-02-05 16:10:12 -06:00
Geoff Bourne
8995e63b72 build: fixed typo in push condition 2022-02-05 16:03:40 -06:00
Geoff Bourne
b65f108917 build: also push git tag builds 2022-02-05 16:02:27 -06:00
itzg
2b374a2073 docs: Auto update markdown TOC 2022-02-05 18:38:46 +00:00
Geoff Bourne
b5b164d5d3 feat: added SKIP_GENERIC_PACK_UPDATE_CHECK and FORCE_GENERIC_PACK_UPDATE (#1333) 2022-02-05 12:38:33 -06:00
itzg
0cde40604e docs: Auto update markdown TOC 2022-02-05 18:27:33 +00:00
Geoff Bourne
22f2eb7308 feat: add option to include timestamp with init logs (#1332) 2022-02-05 12:27:17 -06:00
Geoff Bourne
4a1d2d2b80 build: adjusted for eclipse-temurin:8-jdk not being on armv7 2022-02-02 22:27:38 -06:00
Geoff Bourne
10922b261b build: build-multiarch tags were too broad 2022-02-02 22:18:54 -06:00
12 changed files with 70 additions and 21 deletions

View File

@@ -6,7 +6,6 @@ on:
- test/** - test/**
tags: tags:
- "[0-9]+.[0-9]+.[0-9]+" - "[0-9]+.[0-9]+.[0-9]+"
- "[0-9]+.[0-9]+.[0-9]+-*"
paths-ignore: paths-ignore:
- "*.md" - "*.md"
- "docs/**" - "docs/**"
@@ -39,7 +38,7 @@ jobs:
- variant: java8-multiarch - variant: java8-multiarch
baseImage: eclipse-temurin:8-jdk baseImage: eclipse-temurin:8-jdk
tagPrefix: java8- tagPrefix: java8-
platforms: linux/amd64,linux/arm/v7,linux/arm64 platforms: linux/amd64,linux/arm64
mcVersion: 1.12.2 mcVersion: 1.12.2
- variant: java8-openj9 - variant: java8-openj9
baseImage: ibm-semeru-runtimes:open-8-jdk baseImage: ibm-semeru-runtimes:open-8-jdk
@@ -71,7 +70,7 @@ jobs:
itzg/minecraft-server itzg/minecraft-server
tags: | tags: |
type=ref,event=tag,enable=${{ matrix.variant == 'java17' }} type=ref,event=tag,enable=${{ matrix.variant == 'java17' }}
type=ref,event=tag,prefix=${{ matrix.variant }}- type=ref,event=tag,suffix=-${{ matrix.variant }}
type=raw,value=${{ matrix.variant }} type=raw,value=${{ matrix.variant }}
flavor: | flavor: |
latest=${{ matrix.variant == 'java17' }} latest=${{ matrix.variant == 'java17' }}
@@ -116,7 +115,7 @@ jobs:
uses: docker/build-push-action@v2.8.0 uses: docker/build-push-action@v2.8.0
with: with:
platforms: ${{ matrix.platforms }} platforms: ${{ matrix.platforms }}
push: ${{ github.ref_name == 'master' }} push: ${{ github.ref_type == 'tag' || github.ref_name == 'master' }}
tags: ${{ steps.meta.outputs.tags }} tags: ${{ steps.meta.outputs.tags }}
# ensure latest base image is used # ensure latest base image is used
pull: true pull: true

View File

@@ -1,4 +1,4 @@
name: discord name: Discord notifications
on: on:
workflow_run: workflow_run:

View File

@@ -1,3 +1,5 @@
name: Issue labels
on: on:
issues: issues:
types: [labeled] types: [labeled]

View File

@@ -20,7 +20,8 @@ RUN apk add --no-cache -U \
nano \ nano \
sudo \ sudo \
knock \ knock \
ttf-dejavu ttf-dejavu \
zstd
RUN addgroup -g 1000 minecraft \ RUN addgroup -g 1000 minecraft \
&& adduser -Ss /bin/false -u 1000 -G minecraft -h /home/minecraft minecraft \ && adduser -Ss /bin/false -u 1000 -G minecraft -h /home/minecraft minecraft \
@@ -61,7 +62,7 @@ RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \
--var version=0.1.1 --var app=maven-metadata-release --file {{.app}} \ --var version=0.1.1 --var app=maven-metadata-release --file {{.app}} \
--from https://github.com/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz --from https://github.com/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz
ARG MC_HELPER_VERSION=1.16.3 ARG MC_HELPER_VERSION=1.16.5
ARG MC_HELPER_BASE_URL=https://github.com/itzg/mc-image-helper/releases/download/v${MC_HELPER_VERSION} ARG MC_HELPER_BASE_URL=https://github.com/itzg/mc-image-helper/releases/download/v${MC_HELPER_VERSION}
RUN curl -fsSL ${MC_HELPER_BASE_URL}/mc-image-helper-${MC_HELPER_VERSION}.tgz \ RUN curl -fsSL ${MC_HELPER_BASE_URL}/mc-image-helper-${MC_HELPER_VERSION}.tgz \
| tar -C /usr/share -zxf - \ | tar -C /usr/share -zxf - \

View File

@@ -68,7 +68,7 @@ By default, the container will download the latest version of the "vanilla" [Min
* [Optional plugins, mods, and config attach points](#optional-plugins-mods-and-config-attach-points) * [Optional plugins, mods, and config attach points](#optional-plugins-mods-and-config-attach-points)
* [Auto-downloading SpigotMC/Bukkit/PaperMC plugins](#auto-downloading-spigotmcbukkitpapermc-plugins) * [Auto-downloading SpigotMC/Bukkit/PaperMC plugins](#auto-downloading-spigotmcbukkitpapermc-plugins)
* [Downloadable mod/plugin pack for Forge, Fabric, and Bukkit-like Servers](#downloadable-modplugin-pack-for-forge-fabric-and-bukkit-like-servers) * [Downloadable mod/plugin pack for Forge, Fabric, and Bukkit-like Servers](#downloadable-modplugin-pack-for-forge-fabric-and-bukkit-like-servers)
* [<strong>ForgeAPI</strong> usage to use non-version specific projects](#forgeapi-usage-to-use-non-version-specific-projects) * [ForgeAPI usage to use non-version specific projects](#forgeapi-usage-to-use-non-version-specific-projects)
* [Generic pack files](#generic-pack-files) * [Generic pack files](#generic-pack-files)
* [Mod/Plugin URL Listing File](#modplugin-url-listing-file) * [Mod/Plugin URL Listing File](#modplugin-url-listing-file)
* [Remove old mods/plugins](#remove-old-modsplugins) * [Remove old mods/plugins](#remove-old-modsplugins)
@@ -134,6 +134,7 @@ By default, the container will download the latest version of the "vanilla" [Min
* [Stop Duration](#stop-duration) * [Stop Duration](#stop-duration)
* [Setup only](#setup-only) * [Setup only](#setup-only)
* [Enable Flare Flags](#enable-flare-flags) * [Enable Flare Flags](#enable-flare-flags)
* [Enable timestamps in init logs](#enable-timestamps-in-init-logs)
* [Autopause](#autopause) * [Autopause](#autopause)
* [Description](#description) * [Description](#description)
* [Enabling Autopause](#enabling-autopause) * [Enabling Autopause](#enabling-autopause)
@@ -141,7 +142,7 @@ By default, the container will download the latest version of the "vanilla" [Min
* [Running on RaspberryPi](#running-on-raspberrypi) * [Running on RaspberryPi](#running-on-raspberrypi)
* [Contributing](#contributing) * [Contributing](#contributing)
<!-- Added by: runner, at: Wed Feb 2 02:53:20 UTC 2022 --> <!-- Added by: runner, at: Sat Feb 5 18:38:45 UTC 2022 -->
<!--te--> <!--te-->
@@ -746,9 +747,9 @@ You may also download or copy over individual mods using the `MODS` environment
docker run -d -e MODS=https://www.example.com/mods/mod1.jar,/plugins/common,/plugins/special/mod2.jar ... docker run -d -e MODS=https://www.example.com/mods/mod1.jar,/plugins/common,/plugins/special/mod2.jar ...
### **ForgeAPI** usage to use non-version specific projects ### ForgeAPI usage to use non-version specific projects
**NOTE:** This potentially could lead to unexpected behavior if the Mod recieves an update with unexpected behavior. **NOTE:** This potentially could lead to unexpected behavior if the Mod receives an update with unexpected behavior.
This is more complicated because you will be pulling/using the latest mod for the release of your game. To get started make sure you have a [CursedForge API Key](https://docs.curseforge.com/#getting-started). Then use the environmental parameters in your docker build. This is more complicated because you will be pulling/using the latest mod for the release of your game. To get started make sure you have a [CursedForge API Key](https://docs.curseforge.com/#getting-started). Then use the environmental parameters in your docker build.
@@ -774,10 +775,10 @@ Example of expected forge api project ids, releases, and key:
Example of expected ForgeAPI file format. Example of expected ForgeAPI file format.
**Field Description**: **Field Description**:
* Name is currently unused, but can be used to document each entry. * `name` is currently unused, but can be used to document each entry.
* Project id is the id found on the CurseForge website for a particular mod * `projectId` id is the id found on the CurseForge website for a particular mod
* Release Type corresponds to forge's R, B, A icon for each file. Default Release, options are (release|beta|alpha). * `releaseType` Type corresponds to forge's R, B, A icon for each file. Default Release, options are (release|beta|alpha).
* FileName is used for version pinning if latest file will not work for you. * `fileName` is used for version pinning if latest file will not work for you.
```json ```json
[ [
@@ -802,7 +803,7 @@ Example of expected ForgeAPI file format.
### Generic pack files ### Generic pack files
To install all of the server content (jars, mods, plugins, configs, etc) from a zip or tgz file, such as a CurseForge modpack that is missing a server start script, then set `GENERIC_PACK` to the container path or URL of the archive file. To install all the server content (jars, mods, plugins, configs, etc.) from a zip or tgz file, then set `GENERIC_PACK` to the container path or URL of the archive file. This can also be used to apply a CurseForge modpack that is missing a server start script and/or Forge installer.
If multiple generic packs need to be applied together, set `GENERIC_PACKS` instead, with a comma separated list of archive file paths and/or URLs to files. If multiple generic packs need to be applied together, set `GENERIC_PACKS` instead, with a comma separated list of archive file paths and/or URLs to files.
@@ -816,6 +817,8 @@ GENERIC_PACKS_SUFFIX=.zip
would expand to `https://cdn.example.org/configs-v9.0.1.zip,https://cdn.example.org/mods-v4.3.6.zip`. would expand to `https://cdn.example.org/configs-v9.0.1.zip,https://cdn.example.org/mods-v4.3.6.zip`.
If applying large generic packs, the update check can be time-consuming since a SHA1 checksum is compared. To skip the update check set `SKIP_GENERIC_PACK_UPDATE_CHECK` to "true". Conversely, the generic pack(s) can be forced to be applied without comparing the checksum by setting `FORCE_GENERIC_PACK_UPDATE` to "true".
### Mod/Plugin URL Listing File ### Mod/Plugin URL Listing File
As an alternative to `MODS`, the variable `MODS_FILE` can be set with the path to a text file listing a mod/plugin URL on each line. For example, the following As an alternative to `MODS`, the variable `MODS_FILE` can be set with the path to a text file listing a mod/plugin URL on each line. For example, the following
@@ -1559,6 +1562,20 @@ To enable the JVM flags required to fully support the [Flare profiling suite](ht
Flare is built-in to Airplane/Pufferfish/Purpur, and is available in [plugin form](https://github.com/TECHNOVE/FlarePlugin) for other server types. Flare is built-in to Airplane/Pufferfish/Purpur, and is available in [plugin form](https://github.com/TECHNOVE/FlarePlugin) for other server types.
### Enable timestamps in init logs
Before the container starts the Minecraft Server its output is prefixed with `[init]`, such as
```
[init] Starting the Minecraft server...
```
To also include the timestamp with each log, set `LOG_TIMESTAMP` to "true". The log output will then look like:
```
[init] 2022-02-05 16:58:33+00:00 Starting the Minecraft server...
```
## Autopause ## Autopause
### Description ### Description

View File

@@ -29,7 +29,7 @@ if [[ "${PACKWIZ_URL}" ]]; then
if [[ -z "${latestPackwiz}" ]]; then if [[ -z "${latestPackwiz}" ]]; then
log "WARNING: Could not retrieve Packwiz bootstrap installer release information" log "WARNING: Could not retrieve Packwiz bootstrap installer release information"
else else
isDebugging && log "Latest packwiz ${latestPackWiz}" isDebugging && log "Latest packwiz ${latestPackwiz}"
latestPackwizVer=$(echo ${latestPackwiz} | jq --raw-output '.tag_name') latestPackwizVer=$(echo ${latestPackwiz} | jq --raw-output '.tag_name')
latestPackwizUrl=$(echo ${latestPackwiz} | jq --raw-output '.assets[] | select(.name | match("packwiz-installer-bootstrap.jar")) | .url') latestPackwizUrl=$(echo ${latestPackwiz} | jq --raw-output '.assets[] | select(.name | match("packwiz-installer-bootstrap.jar")) | .url')
: "${PACKWIZ_JAR:=packwiz-installer-bootstrap_${latestPackwizVer}.jar}" : "${PACKWIZ_JAR:=packwiz-installer-bootstrap_${latestPackwizVer}.jar}"
@@ -199,6 +199,7 @@ if [[ "${GENERIC_PACKS}" ]]; then
pack="${GENERIC_PACKS_PREFIX}${packEntry}${GENERIC_PACKS_SUFFIX}" pack="${GENERIC_PACKS_PREFIX}${packEntry}${GENERIC_PACKS_SUFFIX}"
if isURL "${pack}"; then if isURL "${pack}"; then
mkdir -p /data/packs mkdir -p /data/packs
log "Downloading generic pack from $pack"
if ! outfile=$(get -o /data/packs --output-filename --skip-existing "$pack"); then if ! outfile=$(get -o /data/packs --output-filename --skip-existing "$pack"); then
log "ERROR: failed to download $pack" log "ERROR: failed to download $pack"
exit 2 exit 2
@@ -210,7 +211,13 @@ if [[ "${GENERIC_PACKS}" ]]; then
done done
isDebugging && [ -f "$sum_file}" ] && cat "$sum_file" isDebugging && [ -f "$sum_file}" ] && cat "$sum_file"
if ! sha1sum -c "${sum_file}" --status 2> /dev/null; then
log "Checking if generic packs are up to date"
if isTrue "${SKIP_GENERIC_PACK_UPDATE_CHECK:-false}" && [ -f "$sum_file" ]; then
log "Skipping generic pack update check"
elif isTrue "${FORCE_GENERIC_PACK_UPDATE}" || ! sha1sum -c "${sum_file}" --status 2> /dev/null; then
log "Generic pack(s) are out of date. Re-applying..."
base_dir=/tmp/generic_pack_base base_dir=/tmp/generic_pack_base
mkdir -p ${base_dir} mkdir -p ${base_dir}
for pack in "${packFiles[@]}"; do for pack in "${packFiles[@]}"; do
@@ -243,6 +250,7 @@ if [[ "${GENERIC_PACKS}" ]]; then
cp -R -f "${base_dir}"/* /data cp -R -f "${base_dir}"/* /data
rm -rf /tmp/generic_pack_base rm -rf /tmp/generic_pack_base
log "Saving generic pack(s) checksum"
sha1sum "${packFiles[@]}" > "${sum_file}" sha1sum "${packFiles[@]}" > "${sum_file}"
isDebugging && cat "$sum_file" isDebugging && cat "$sum_file"
fi fi

View File

@@ -40,6 +40,10 @@ function getFilenameFromUrl() {
} }
function isTrue() { function isTrue() {
local oldState
oldState=$(shopt -po xtrace)
shopt -u -o xtrace
local value=${1,,} local value=${1,,}
result= result=
@@ -53,6 +57,7 @@ function isTrue() {
;; ;;
esac esac
eval "$oldState"
return ${result} return ${result}
} }
@@ -82,7 +87,18 @@ function logn() {
} }
function log() { function log() {
echo "[init] $*" local oldState
# The return status when listing options is zero if all optnames are enabled, non- zero otherwise.
oldState=$(shopt -po xtrace || true)
shopt -u -o xtrace
if isDebugging || isTrue "${LOG_TIMESTAMP:-false}"; then
ts=" $(date --rfc-3339=seconds)"
else
ts=
fi
echo "[init]${ts} $*"
eval "$oldState"
} }
function logAutopause() { function logAutopause() {
@@ -211,7 +227,7 @@ function extract() {
application/zip) application/zip)
unzip -q -d "${destDir}" "${src}" unzip -q -d "${destDir}" "${src}"
;; ;;
application/x-tar|application/gzip|application/x-gzip|application/x-bzip2|application/zstd) application/x-tar|application/gzip|application/x-gzip|application/x-bzip2|application/zstd|application/x-zstd)
tar -C "${destDir}" -xf "${src}" tar -C "${destDir}" -xf "${src}"
;; ;;
*) *)

View File

@@ -11,8 +11,14 @@ services:
image: ${IMAGE_TO_TEST:-itzg/minecraft-server} image: ${IMAGE_TO_TEST:-itzg/minecraft-server}
environment: environment:
EULA: "true" EULA: "true"
SETUP_ONLY: "TRUE" SETUP_ONLY: "true"
GENERIC_PACKS: http://web/configs.zip,/packs/testing.zip GENERIC_PACKS: http://web/configs.zip,/packs/testing.zip
LOG_TIMESTAMP: "true"
# the following are only used to speed up test execution
TYPE: CUSTOM
CUSTOM_SERVER: /servers/fake.jar
VERSION: 1.18.1
volumes: volumes:
- ./packs:/packs - ./packs:/packs
- ./data:/data - ./data:/data
- ./fake.jar:/servers/fake.jar