mirror of
https://github.com/itzg/docker-minecraft-server.git
synced 2026-02-17 15:13:55 +00:00
Compare commits
188 Commits
2021.3.0-j
...
java15
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
68ccc1c36d | ||
|
|
9ff04f8637 | ||
|
|
dd7953ab4c | ||
|
|
23fde3387a | ||
|
|
3aa3e77c27 | ||
|
|
ecbdb2b18d | ||
|
|
5d162d6c19 | ||
|
|
373921777a | ||
|
|
2f489b04ae | ||
|
|
a2c393ccc5 | ||
|
|
73a11c91d2 | ||
|
|
8673f919fd | ||
|
|
1e32161652 | ||
|
|
38eb769c1b | ||
|
|
5e372ed9f4 | ||
|
|
e027a81317 | ||
|
|
0a51713bd7 | ||
|
|
d5cde03db1 | ||
|
|
cf6829001e | ||
|
|
af77b29509 | ||
|
|
449f2bfa09 | ||
|
|
c9815e2ccb | ||
|
|
9bd6bc64b0 | ||
|
|
a5fe016854 | ||
|
|
93cd299c77 | ||
|
|
e8f8d8b4d4 | ||
|
|
b806ea6871 | ||
|
|
cb17180dea | ||
|
|
78ec4ba2a7 | ||
|
|
317104de30 | ||
|
|
63412975c3 | ||
|
|
9c87f8749d | ||
|
|
5fc36516f4 | ||
|
|
c608c8a57e | ||
|
|
853a9884d7 | ||
|
|
ecafaf4ea1 | ||
|
|
eb490e92c3 | ||
|
|
98c7e43927 | ||
|
|
d8786d4785 | ||
|
|
521099b733 | ||
|
|
02181021ce | ||
|
|
fa60f8c16e | ||
|
|
3084a2f409 | ||
|
|
f473cfc6f2 | ||
|
|
8a34aa5c45 | ||
|
|
f297654bb6 | ||
|
|
cc204c297f | ||
|
|
bb210ff59e | ||
|
|
01bd8f5860 | ||
|
|
671e84bec9 | ||
|
|
fc2ba2df32 | ||
|
|
e5bee8e79b | ||
|
|
1b13ddcf32 | ||
|
|
de707049d4 | ||
|
|
e95ae2dbbb | ||
|
|
4606c27cdc | ||
|
|
ba88bf72ce | ||
|
|
75967cec02 | ||
|
|
0a35f661bd | ||
|
|
f141806fb4 | ||
|
|
d80f40075c | ||
|
|
44dbe80096 | ||
|
|
c7546ef08a | ||
|
|
6fe5bb4aa8 | ||
|
|
589a9aa3db | ||
|
|
2c8d1a9255 | ||
|
|
a8c11c0cdb | ||
|
|
34ae93f379 | ||
|
|
bd57d291c1 | ||
|
|
7310daf51d | ||
|
|
78d9d888db | ||
|
|
bccdc7f5e8 | ||
|
|
3854526389 | ||
|
|
74072847ca | ||
|
|
c5857bfc0b | ||
|
|
8b380894f9 | ||
|
|
b090737162 | ||
|
|
476abc9dad | ||
|
|
a2cbf07b6d | ||
|
|
2a67344b93 | ||
|
|
9ecb617d2e | ||
|
|
9381776345 | ||
|
|
5a47bb11ba | ||
|
|
4be4fc4808 | ||
|
|
d939be28e6 | ||
|
|
bb8c7756c7 | ||
|
|
3261fbd7e9 | ||
|
|
7164d2b885 | ||
|
|
185fccf712 | ||
|
|
0c860ade12 | ||
|
|
cfb2739cd9 | ||
|
|
b1bb3f38f3 | ||
|
|
0f0017b02d | ||
|
|
a99f7a494b | ||
|
|
65b3997e72 | ||
|
|
5e8f947ce5 | ||
|
|
3e9308d315 | ||
|
|
5f48a4e5e5 | ||
|
|
e593ca4bda | ||
|
|
b731eaaffb | ||
|
|
75f5a430e4 | ||
|
|
e0c721585e | ||
|
|
da21c2e0a7 | ||
|
|
2b989e4c39 | ||
|
|
7d6c80b941 | ||
|
|
a3039eea12 | ||
|
|
cbf9577a24 | ||
|
|
70ea32e89d | ||
|
|
10a3037ab3 | ||
|
|
9ccfca5061 | ||
|
|
52cbf1fb64 | ||
|
|
190e401452 | ||
|
|
b881a27c8d | ||
|
|
6fab527eed | ||
|
|
9690832247 | ||
|
|
60a68963a8 | ||
|
|
e5948081a7 | ||
|
|
7aa47e2a60 | ||
|
|
327538a98f | ||
|
|
f6c71e27d8 | ||
|
|
4628da7ea2 | ||
|
|
02ba96c421 | ||
|
|
87f6fe6b20 | ||
|
|
8049bd5b80 | ||
|
|
5225ba06c8 | ||
|
|
d695fc3fbc | ||
|
|
a2132292ac | ||
|
|
c31b191b96 | ||
|
|
c4b573f608 | ||
|
|
28810fcba3 | ||
|
|
8d1989a595 | ||
|
|
d022956e24 | ||
|
|
2bdaa4dc4e | ||
|
|
46bfbaada1 | ||
|
|
e659343821 | ||
|
|
44138564b0 | ||
|
|
3c77abbbab | ||
|
|
209c6e6dab | ||
|
|
6fa827e9a1 | ||
|
|
cd3ea7fd2e | ||
|
|
d3bd697cb2 | ||
|
|
6c6bf030c5 | ||
|
|
6e2b3ae0c7 | ||
|
|
9915929340 | ||
|
|
298bf5fb0a | ||
|
|
6ae431b2f0 | ||
|
|
44769b6001 | ||
|
|
ebabfeb669 | ||
|
|
5c1f176848 | ||
|
|
4186cfd91c | ||
|
|
457e9b53c7 | ||
|
|
861aec6bd6 | ||
|
|
21572d3547 | ||
|
|
89afba7437 | ||
|
|
53f5fbb77f | ||
|
|
9299f00d20 | ||
|
|
e5e97a3560 | ||
|
|
32bc0382d6 | ||
|
|
fa53abdfb7 | ||
|
|
0cbfb81b4c | ||
|
|
d47c801b18 | ||
|
|
c056b9d2dd | ||
|
|
92a15ea85d | ||
|
|
6fe022ccc8 | ||
|
|
f397dd71a9 | ||
|
|
b71eb666a7 | ||
|
|
02e0a47a52 | ||
|
|
b176be942d | ||
|
|
a2ab0d75ed | ||
|
|
60809fe5ad | ||
|
|
51c5902db0 | ||
|
|
c48f6c31ce | ||
|
|
b2d23edf6d | ||
|
|
31f25cfd1b | ||
|
|
7d4e4c167e | ||
|
|
4a8e416fe1 | ||
|
|
090e624ebc | ||
|
|
eb12030975 | ||
|
|
e46af9d54c | ||
|
|
861faaa285 | ||
|
|
8312233a93 | ||
|
|
959bf73485 | ||
|
|
ce4efd0b70 | ||
|
|
f856276d71 | ||
|
|
0300854c46 | ||
|
|
f06e9f5ede | ||
|
|
8d3ca813ed | ||
|
|
e97a00e61d |
7
.github/dependabot.yml
vendored
Normal file
7
.github/dependabot.yml
vendored
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
version: 2
|
||||||
|
updates:
|
||||||
|
# Maintain dependencies for GitHub Actions
|
||||||
|
- package-ecosystem: "github-actions"
|
||||||
|
directory: "/"
|
||||||
|
schedule:
|
||||||
|
interval: "weekly"
|
||||||
80
.github/workflows/build-multiarch.yml
vendored
80
.github/workflows/build-multiarch.yml
vendored
@@ -2,56 +2,63 @@ name: Build and publish multiarch
|
|||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- multiarch
|
- master
|
||||||
- java8-multiarch
|
- "*-multiarch"
|
||||||
- multiarch-latest
|
- "multiarch*"
|
||||||
- java15
|
- java8-openj9
|
||||||
|
- java11*
|
||||||
|
- java15*
|
||||||
|
- java16*
|
||||||
- test/multiarch/*
|
- test/multiarch/*
|
||||||
tags:
|
tags:
|
||||||
- "[0-9]+.[0-9]+.[0-9]+-multiarch"
|
- "[0-9]+.[0-9]+.[0-9]+"
|
||||||
- "[0-9]+.[0-9]+.[0-9]+-multiarch-latest"
|
- "[0-9]+.[0-9]+.[0-9]+-multiarch*"
|
||||||
|
- "[0-9]+.[0-9]+.[0-9]+-*multiarch"
|
||||||
|
- "[0-9]+.[0-9]+.[0-9]+-java8-openj9"
|
||||||
|
- "[0-9]+.[0-9]+.[0-9]+-java11*"
|
||||||
- "[0-9]+.[0-9]+.[0-9]+-java15"
|
- "[0-9]+.[0-9]+.[0-9]+-java15"
|
||||||
|
- "[0-9]+.[0-9]+.[0-9]+-java16*"
|
||||||
|
paths-ignore:
|
||||||
|
- "*.md"
|
||||||
|
- "docs/**"
|
||||||
|
- "examples/**"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
docker-buildx:
|
docker-buildx:
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
|
env:
|
||||||
|
CACHE_NAME: java15
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v2.2.0
|
uses: actions/checkout@v2.3.4
|
||||||
|
|
||||||
- name: Prepare
|
- name: Docker meta
|
||||||
id: prep
|
id: meta
|
||||||
run: |
|
uses: docker/metadata-action@v3
|
||||||
DOCKER_IMAGE=itzg/minecraft-server
|
with:
|
||||||
VERSION=edge
|
images: |
|
||||||
if [[ $GITHUB_REF == refs/tags/* ]]; then
|
itzg/minecraft-server
|
||||||
VERSION=${GITHUB_REF#refs/tags/}
|
tags: |
|
||||||
fi
|
type=ref,event=branch
|
||||||
if [[ $GITHUB_REF == refs/heads/* ]]; then
|
type=ref,event=tag
|
||||||
VERSION=${GITHUB_REF#refs/heads/}
|
type=edge,branch=master
|
||||||
if [[ $VERSION == master ]]; then
|
flavor: |
|
||||||
VERSION=latest
|
latest=false
|
||||||
fi
|
|
||||||
fi
|
|
||||||
TAGS="${DOCKER_IMAGE}:${VERSION//\//-}"
|
|
||||||
echo ::set-output name=tags::${TAGS}
|
|
||||||
echo ::set-output name=cache_from::${TAGS}
|
|
||||||
echo ::set-output name=version::${VERSION//\//-}
|
|
||||||
echo ::set-output name=cache_version::${VERSION//\//-}
|
|
||||||
|
|
||||||
- name: Setup Docker Buildx
|
- name: Setup Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v1
|
uses: docker/setup-buildx-action@v1
|
||||||
|
|
||||||
- name: Cache Docker layers
|
- name: Cache Docker layers
|
||||||
uses: actions/cache@v2
|
uses: actions/cache@v2.1.5
|
||||||
with:
|
with:
|
||||||
path: /tmp/.buildx-cache
|
path: /tmp/.buildx-cache
|
||||||
key: ${{ runner.os }}-buildx-${{ steps.prep.outputs.cache_version }}-${{ github.sha }}
|
key: ${{ runner.os }}-buildx-${{ env.CACHE_NAME }}-${{ github.sha }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-buildx-${{ steps.prep.outputs.cache_version }}-
|
${{ runner.os }}-buildx-${{ env.CACHE_NAME }}-
|
||||||
|
${{ runner.os }}-buildx-
|
||||||
|
|
||||||
- name: Set up QEMU
|
- name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@v1
|
uses: docker/setup-qemu-action@v1.1.0
|
||||||
|
|
||||||
- name: Login to DockerHub
|
- name: Login to DockerHub
|
||||||
uses: docker/login-action@v1
|
uses: docker/login-action@v1
|
||||||
@@ -61,20 +68,17 @@ jobs:
|
|||||||
|
|
||||||
- name: Build and push
|
- name: Build and push
|
||||||
id: docker_build
|
id: docker_build
|
||||||
uses: docker/build-push-action@v2
|
uses: docker/build-push-action@v2.4.0
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
file: ./Dockerfile
|
|
||||||
platforms: linux/amd64,linux/arm/v7,linux/arm64
|
platforms: linux/amd64,linux/arm/v7,linux/arm64
|
||||||
push: ${{ github.event_name != 'pull_request' }}
|
push: ${{ github.event_name != 'pull_request' }}
|
||||||
tags: ${{ steps.prep.outputs.tags }}
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
|
# ensure latest base image is used
|
||||||
|
pull: true
|
||||||
cache-from: type=local,src=/tmp/.buildx-cache
|
cache-from: type=local,src=/tmp/.buildx-cache
|
||||||
cache-to: type=local,dest=/tmp/.buildx-cache
|
cache-to: type=local,dest=/tmp/.buildx-cache
|
||||||
labels: |
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
org.opencontainers.image.documentation=https://github.com/itzg/docker-minecraft-server
|
|
||||||
org.opencontainers.image.source=https://github.com/itzg/docker-minecraft-server
|
|
||||||
org.opencontainers.image.version=${{ steps.prep.outputs.version }}
|
|
||||||
org.opencontainers.image.revision=${{ github.sha }}
|
|
||||||
|
|
||||||
- name: Image digest
|
- name: Image digest
|
||||||
run: echo ${{ steps.docker_build.outputs.digest }}
|
run: echo ${{ steps.docker_build.outputs.digest }}
|
||||||
|
|||||||
20
.github/workflows/generate-toc.yml
vendored
Normal file
20
.github/workflows/generate-toc.yml
vendored
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
name: Generate README table of contents
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
paths:
|
||||||
|
- README.md
|
||||||
|
jobs:
|
||||||
|
generate:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
timeout-minutes: 5
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2.3.4
|
||||||
|
- run: |
|
||||||
|
curl https://raw.githubusercontent.com/ekalinin/github-markdown-toc/master/gh-md-toc -o gh-md-toc
|
||||||
|
chmod a+x gh-md-toc
|
||||||
|
./gh-md-toc --insert --no-backup README.md
|
||||||
|
- uses: stefanzweifel/git-auto-commit-action@v4.11.0
|
||||||
|
with:
|
||||||
|
commit_message: "docs: Auto update markdown TOC"
|
||||||
16
.github/workflows/main.yml
vendored
16
.github/workflows/main.yml
vendored
@@ -3,14 +3,12 @@ name: Build and Publish
|
|||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- master
|
|
||||||
- java8
|
- java8
|
||||||
- openj9
|
- openj9
|
||||||
- openj9-11
|
- openj9-11
|
||||||
- adopt11
|
- adopt11
|
||||||
- test/*
|
- test/*
|
||||||
tags:
|
tags:
|
||||||
- "[0-9]+.[0-9]+.[0-9]+"
|
|
||||||
- "[0-9]+.[0-9]+.[0-9]+-java8"
|
- "[0-9]+.[0-9]+.[0-9]+-java8"
|
||||||
- "[0-9]+.[0-9]+.[0-9]+-openj9"
|
- "[0-9]+.[0-9]+.[0-9]+-openj9"
|
||||||
- "[0-9]+.[0-9]+.[0-9]+-openj9-11"
|
- "[0-9]+.[0-9]+.[0-9]+-openj9-11"
|
||||||
@@ -22,7 +20,7 @@ jobs:
|
|||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2.3.4
|
||||||
|
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: |
|
run: |
|
||||||
@@ -31,9 +29,11 @@ jobs:
|
|||||||
needs:
|
needs:
|
||||||
- test
|
- test
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
|
env:
|
||||||
|
CACHE_NAME: java15
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2.3.4
|
||||||
|
|
||||||
- name: Prepare
|
- name: Prepare
|
||||||
id: prep
|
id: prep
|
||||||
@@ -59,12 +59,12 @@ jobs:
|
|||||||
uses: docker/setup-buildx-action@v1
|
uses: docker/setup-buildx-action@v1
|
||||||
|
|
||||||
- name: Cache Docker layers
|
- name: Cache Docker layers
|
||||||
uses: actions/cache@v2
|
uses: actions/cache@v2.1.5
|
||||||
with:
|
with:
|
||||||
path: /tmp/.buildx-cache
|
path: /tmp/.buildx-cache
|
||||||
key: ${{ runner.os }}-buildx-${{ steps.prep.outputs.cache_version }}-${{ github.sha }}
|
key: ${{ runner.os }}-buildx-${{ env.CACHE_NAME }}-${{ github.sha }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-buildx-${{ steps.prep.outputs.cache_version }}-
|
${{ runner.os }}-buildx-${{ env.CACHE_NAME }}-
|
||||||
${{ runner.os }}-buildx-
|
${{ runner.os }}-buildx-
|
||||||
|
|
||||||
- name: Login to DockerHub
|
- name: Login to DockerHub
|
||||||
@@ -75,7 +75,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Build and push
|
- name: Build and push
|
||||||
id: docker_build
|
id: docker_build
|
||||||
uses: docker/build-push-action@v2
|
uses: docker/build-push-action@v2.4.0
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
file: ./Dockerfile
|
file: ./Dockerfile
|
||||||
|
|||||||
2
.github/workflows/pr.yml
vendored
2
.github/workflows/pr.yml
vendored
@@ -9,7 +9,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2.3.4
|
||||||
|
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,3 +1,4 @@
|
|||||||
/data/
|
/data/
|
||||||
/.idea/
|
/.idea/
|
||||||
*.iml
|
*.iml
|
||||||
|
/gh-md-toc
|
||||||
12
Dockerfile
12
Dockerfile
@@ -10,6 +10,7 @@ RUN apt-get update \
|
|||||||
sudo \
|
sudo \
|
||||||
net-tools \
|
net-tools \
|
||||||
curl wget \
|
curl wget \
|
||||||
|
git \
|
||||||
jq \
|
jq \
|
||||||
dos2unix \
|
dos2unix \
|
||||||
mysql-client \
|
mysql-client \
|
||||||
@@ -47,7 +48,7 @@ RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \
|
|||||||
--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
|
||||||
|
|
||||||
RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \
|
RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \
|
||||||
--var version=0.1.7 --var app=mc-monitor --file {{.app}} \
|
--var version=0.7.1 --var app=mc-monitor --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
|
||||||
|
|
||||||
RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \
|
RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \
|
||||||
@@ -65,11 +66,13 @@ COPY server.properties /tmp/server.properties
|
|||||||
COPY log4j2.xml /tmp/log4j2.xml
|
COPY log4j2.xml /tmp/log4j2.xml
|
||||||
WORKDIR /data
|
WORKDIR /data
|
||||||
|
|
||||||
|
STOPSIGNAL SIGTERM
|
||||||
|
|
||||||
ENV UID=1000 GID=1000 \
|
ENV UID=1000 GID=1000 \
|
||||||
MEMORY="1G" \
|
MEMORY="1G" \
|
||||||
TYPE=VANILLA VERSION=LATEST FORGEVERSION=RECOMMENDED SPONGEBRANCH=STABLE SPONGEVERSION= FABRICVERSION=LATEST LEVEL=world \
|
TYPE=VANILLA VERSION=LATEST \
|
||||||
PVP=true DIFFICULTY=easy ENABLE_RCON=true RCON_PORT=25575 RCON_PASSWORD=minecraft \
|
ENABLE_RCON=true RCON_PORT=25575 RCON_PASSWORD=minecraft \
|
||||||
LEVEL_TYPE=DEFAULT SERVER_PORT=25565 ONLINE_MODE=TRUE SERVER_NAME="Dedicated Server" \
|
SERVER_PORT=25565 ONLINE_MODE=TRUE SERVER_NAME="Dedicated Server" \
|
||||||
ENABLE_AUTOPAUSE=false AUTOPAUSE_TIMEOUT_EST=3600 AUTOPAUSE_TIMEOUT_KN=120 AUTOPAUSE_TIMEOUT_INIT=600 \
|
ENABLE_AUTOPAUSE=false AUTOPAUSE_TIMEOUT_EST=3600 AUTOPAUSE_TIMEOUT_KN=120 AUTOPAUSE_TIMEOUT_INIT=600 \
|
||||||
AUTOPAUSE_PERIOD=10 AUTOPAUSE_KNOCK_INTERFACE=eth0
|
AUTOPAUSE_PERIOD=10 AUTOPAUSE_KNOCK_INTERFACE=eth0
|
||||||
|
|
||||||
@@ -81,5 +84,6 @@ RUN dos2unix /start* && chmod +x /start*
|
|||||||
RUN dos2unix /health.sh && chmod +x /health.sh
|
RUN dos2unix /health.sh && chmod +x /health.sh
|
||||||
RUN dos2unix /autopause/* && chmod +x /autopause/*.sh
|
RUN dos2unix /autopause/* && chmod +x /autopause/*.sh
|
||||||
|
|
||||||
|
|
||||||
ENTRYPOINT [ "/start" ]
|
ENTRYPOINT [ "/start" ]
|
||||||
HEALTHCHECK --start-period=1m CMD /health.sh
|
HEALTHCHECK --start-period=1m CMD /health.sh
|
||||||
|
|||||||
@@ -1,7 +1,17 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
#set -x
|
#set -x
|
||||||
# Use this variable to indicate a list of branches that docker hub is watching
|
# Use this variable to indicate a list of branches that docker hub is watching
|
||||||
branches_list=('java8' 'java8-multiarch' 'openj9' 'openj9-11' 'adopt11' 'java15' 'multiarch' 'multiarch-latest')
|
branches_list=(
|
||||||
|
'java8'
|
||||||
|
'java8-multiarch'
|
||||||
|
'java8-openj9'
|
||||||
|
'java11'
|
||||||
|
'java11-openj9'
|
||||||
|
'java15'
|
||||||
|
'java16'
|
||||||
|
'java16-openj9'
|
||||||
|
'multiarch-latest'
|
||||||
|
)
|
||||||
|
|
||||||
function TrapExit {
|
function TrapExit {
|
||||||
echo "Checking out back in master"
|
echo "Checking out back in master"
|
||||||
|
|||||||
BIN
docs/level-vs-world.drawio.png
Normal file
BIN
docs/level-vs-world.drawio.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 32 KiB |
BIN
docs/world-copy-compose-project.drawio.png
Normal file
BIN
docs/world-copy-compose-project.drawio.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 65 KiB |
@@ -1,4 +1,4 @@
|
|||||||
version: '3'
|
version: '3.8'
|
||||||
|
|
||||||
services:
|
services:
|
||||||
minecraft:
|
minecraft:
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
version: '3.2'
|
version: '3.8'
|
||||||
|
|
||||||
services:
|
services:
|
||||||
mc:
|
mc:
|
||||||
image: itzg/minecraft-server
|
image: itzg/minecraft-server:java8
|
||||||
volumes:
|
volumes:
|
||||||
- ./modpacks:/modpacks:ro
|
- ./modpacks:/modpacks:ro
|
||||||
environment:
|
environment:
|
||||||
|
|||||||
@@ -1,20 +0,0 @@
|
|||||||
version: "3.7"
|
|
||||||
|
|
||||||
services:
|
|
||||||
mc:
|
|
||||||
image: itzg/minecraft-server
|
|
||||||
ports:
|
|
||||||
- 25565:25565
|
|
||||||
volumes:
|
|
||||||
# Attach .../Curse/Minecraft/Instances for use at /instances
|
|
||||||
- ./Instances:/instances:ro
|
|
||||||
# Attach /data as usual
|
|
||||||
- ./ServerData:/data
|
|
||||||
environment:
|
|
||||||
EULA: "TRUE"
|
|
||||||
# Modpacks generally need more memory, so let's give at 2 GB
|
|
||||||
MEMORY: 2G
|
|
||||||
# Use new CURSE_INSTANCE type
|
|
||||||
TYPE: CURSE_INSTANCE
|
|
||||||
# Reference directory of or full path to minecraftinstance.json
|
|
||||||
CURSE_INSTANCE_JSON: /instances/FTB Presents SkyFactory 3
|
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
version: "3.7"
|
version: "3.8"
|
||||||
|
|
||||||
services:
|
services:
|
||||||
mc:
|
mc:
|
||||||
image: itzg/minecraft-server
|
image: itzg/minecraft-server:java8
|
||||||
ports:
|
ports:
|
||||||
# expose the Minecraft server port outside of container
|
# expose the Minecraft server port outside of container
|
||||||
- 25565:25565
|
- 25565:25565
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
version: "3.7"
|
version: "3.8"
|
||||||
|
|
||||||
services:
|
services:
|
||||||
mc:
|
mc:
|
||||||
# FTBA support is only available in multiarch image tag
|
# FTBA support is only available in non-Alpine images
|
||||||
image: itzg/minecraft-server:multiarch
|
image: itzg/minecraft-server:java8-multiarch
|
||||||
ports:
|
ports:
|
||||||
# expose the Minecraft server port outside of container
|
# expose the Minecraft server port outside of container
|
||||||
- 25565:25565
|
- 25565:25565
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
version: '3.7'
|
version: '3.8'
|
||||||
|
|
||||||
services:
|
services:
|
||||||
mc:
|
mc:
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
version: '3'
|
version: '3.8'
|
||||||
|
|
||||||
services:
|
services:
|
||||||
mc:
|
mc:
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
version: "3"
|
version: "3.8"
|
||||||
|
|
||||||
services:
|
services:
|
||||||
mc:
|
mc:
|
||||||
@@ -9,4 +9,4 @@ services:
|
|||||||
EULA: "TRUE"
|
EULA: "TRUE"
|
||||||
volumes:
|
volumes:
|
||||||
# attach the relative directory 'data' to the container's /data path
|
# attach the relative directory 'data' to the container's /data path
|
||||||
./data:/data
|
- ./data:/data
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
version: '3'
|
version: '3.8'
|
||||||
# Forge with Sponge API support. THIS REQUIRES DOWNLOADING SPONGEFORGE.
|
# Forge with Sponge API support. THIS REQUIRES DOWNLOADING SPONGEFORGE.
|
||||||
# Place the SpongeForge jar file in /data/mods. Other Forge mods go here as well.
|
# Place the SpongeForge jar file in /data/mods. Other Forge mods go here as well.
|
||||||
# Place Sponge mods in /data/mods/plugins. Yes, this is a directory inside the Forge mod directory. Do NOT use /data/plugins.
|
# Place Sponge mods in /data/mods/plugins. Yes, this is a directory inside the Forge mod directory. Do NOT use /data/plugins.
|
||||||
|
|
||||||
services:
|
services:
|
||||||
minecraft:
|
minecraft:
|
||||||
image: itzg/minecraft-server
|
image: itzg/minecraft-server:java8
|
||||||
ports:
|
ports:
|
||||||
- "25565:25565"
|
- "25565:25565"
|
||||||
volumes:
|
volumes:
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
version: "3.7"
|
version: "3.8"
|
||||||
|
|
||||||
services:
|
services:
|
||||||
mc:
|
mc:
|
||||||
|
|||||||
2
start
2
start
@@ -5,7 +5,7 @@
|
|||||||
umask 0002
|
umask 0002
|
||||||
chmod g+w /data
|
chmod g+w /data
|
||||||
|
|
||||||
if [ $(id -u) = 0 ]; then
|
if ! isTrue "${SKIP_SUDO:-false}" && [ $(id -u) = 0 ]; then
|
||||||
runAsUser=minecraft
|
runAsUser=minecraft
|
||||||
runAsGroup=minecraft
|
runAsGroup=minecraft
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,13 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
set -euo pipefail
|
||||||
|
IFS=$'\n\t'
|
||||||
|
|
||||||
. ${SCRIPTS:-/}start-utils
|
. ${SCRIPTS:-/}start-utils
|
||||||
|
|
||||||
|
: ${EULA:=}
|
||||||
|
: ${PROXY:=}
|
||||||
|
: ${RCON_PASSWORD_FILE:=}
|
||||||
|
|
||||||
shopt -s nullglob
|
shopt -s nullglob
|
||||||
|
|
||||||
#umask 002
|
#umask 002
|
||||||
@@ -48,7 +54,11 @@ if [[ $RCON_PASSWORD_FILE ]]; then
|
|||||||
log ""
|
log ""
|
||||||
fi
|
fi
|
||||||
|
|
||||||
export SERVER_PROPERTIES=/data/server.properties
|
if ! which java > /dev/null; then
|
||||||
|
log "Fixing PATH to include java"
|
||||||
|
PATH="${PATH}:/opt/java/openjdk/bin"
|
||||||
|
fi
|
||||||
|
|
||||||
export VERSIONS_JSON=https://launchermeta.mojang.com/mc/game/version_manifest.json
|
export VERSIONS_JSON=https://launchermeta.mojang.com/mc/game/version_manifest.json
|
||||||
|
|
||||||
case "X$VERSION" in
|
case "X$VERSION" in
|
||||||
@@ -91,6 +101,8 @@ case "${TYPE^^}" in
|
|||||||
log "**********************************************************************"
|
log "**********************************************************************"
|
||||||
log "WARNING: The image tag itzg/minecraft-server:java8 is recommended"
|
log "WARNING: The image tag itzg/minecraft-server:java8 is recommended"
|
||||||
log " since some mods require Java 8"
|
log " since some mods require Java 8"
|
||||||
|
log " Exception traces reporting ClassCastException: class jdk.internal.loader.ClassLoaders\$AppClassLoader"
|
||||||
|
log " can be fixed with java8"
|
||||||
log "**********************************************************************"
|
log "**********************************************************************"
|
||||||
exec ${SCRIPTS:-/}start-deployForge "$@"
|
exec ${SCRIPTS:-/}start-deployForge "$@"
|
||||||
;;
|
;;
|
||||||
@@ -103,7 +115,13 @@ case "${TYPE^^}" in
|
|||||||
exec ${SCRIPTS:-/}start-deployFTBA "$@"
|
exec ${SCRIPTS:-/}start-deployFTBA "$@"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
CURSEFORGE|FTB)
|
FTB|CURSEFORGE)
|
||||||
|
log "**********************************************************************"
|
||||||
|
log "WARNING: The image tag itzg/minecraft-server:java8 is recommended"
|
||||||
|
log " since some mods require Java 8"
|
||||||
|
log " Exception traces reporting ClassCastException: class jdk.internal.loader.ClassLoaders\$AppClassLoader"
|
||||||
|
log " can be fixed with java8"
|
||||||
|
log "**********************************************************************"
|
||||||
exec ${SCRIPTS:-/}start-deployCF "$@"
|
exec ${SCRIPTS:-/}start-deployCF "$@"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
@@ -135,11 +153,27 @@ case "${TYPE^^}" in
|
|||||||
exec ${SCRIPTS:-/}start-deployCatserver "$@"
|
exec ${SCRIPTS:-/}start-deployCatserver "$@"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
PURPUR)
|
||||||
|
exec ${SCRIPTS:-/}start-deployPurpur "$@"
|
||||||
|
;;
|
||||||
|
|
||||||
|
YATOPIA)
|
||||||
|
exec ${SCRIPTS:-/}start-deployYatopia "$@"
|
||||||
|
;;
|
||||||
|
|
||||||
|
AIRPLANE)
|
||||||
|
exec ${SCRIPTS:-/}start-deployAirplane "$@"
|
||||||
|
;;
|
||||||
|
|
||||||
|
CANYON)
|
||||||
|
exec ${SCRIPTS:-/}start-deployCanyon "$@"
|
||||||
|
;;
|
||||||
|
|
||||||
*)
|
*)
|
||||||
log "Invalid type: '$TYPE'"
|
log "Invalid type: '$TYPE'"
|
||||||
log "Must be: VANILLA, FORGE, BUKKIT, SPIGOT, PAPER, FTBA (multiarch-only),"
|
log "Must be: VANILLA, FORGE, BUKKIT, SPIGOT, PAPER, FTBA (multiarch-only),"
|
||||||
log " CURSE_INSTANCE, CURSEFORGE, SPONGEVANILLA,"
|
log " CURSE_INSTANCE, CURSEFORGE, SPONGEVANILLA, TUINITY, PURPUR"
|
||||||
log " CUSTOM, MAGMA, MOHIST, CATSERVER"
|
log " CUSTOM, MAGMA, MOHIST, CATSERVER, YATOPIA, AIRPLANE, CANYON"
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
|||||||
36
start-deployAirplane
Normal file
36
start-deployAirplane
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -euo pipefail
|
||||||
|
IFS=$'\n\t'
|
||||||
|
|
||||||
|
. ${SCRIPTS:-/}start-utils
|
||||||
|
isDebugging && set -x
|
||||||
|
|
||||||
|
JAVA_VER=$(java -version 2>&1 | head -1 | cut -d'"' -f2 | sed '/^1\./s///' | cut -d'.' -f1)
|
||||||
|
|
||||||
|
if [ "${JAVA_VER}" != "8" ] && [ "${JAVA_VER}" != "11" ]; then
|
||||||
|
log "ERROR: Airplane server type only supports Java versions 8 and 11"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "${VERSION}" != "LATEST" ]; then
|
||||||
|
log "ERROR: Airplane server type only supports VERSION=LATEST"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
export SERVER=airplane-${VANILLA_VERSION}-jdk${JAVA_VER}.jar
|
||||||
|
|
||||||
|
if [ ! -f "$SERVER" ] || isTrue "$FORCE_REDOWNLOAD"; then
|
||||||
|
downloadUrl="https://dl.airplane.gg/latest/Airplane-JDK${JAVA_VER}/launcher-airplane.jar"
|
||||||
|
log "Downloading Airplane from $downloadUrl ..."
|
||||||
|
curl -fsSL -o "$SERVER" "$downloadUrl"
|
||||||
|
if [ ! -f "$SERVER" ]; then
|
||||||
|
log "ERROR: failed to download from $downloadUrl (status=$?)"
|
||||||
|
exit 3
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Normalize on Spigot for later operations
|
||||||
|
export TYPE=SPIGOT
|
||||||
|
export SKIP_LOG4J_CONFIG=true
|
||||||
|
|
||||||
|
exec ${SCRIPTS:-/}start-spiget "$@"
|
||||||
@@ -82,7 +82,9 @@ function downloadSpigot {
|
|||||||
|
|
||||||
ERROR: failed to download from $downloadUrl
|
ERROR: failed to download from $downloadUrl
|
||||||
Visit https://getbukkit.org/download/${getbukkitFlavor} to lookup the
|
Visit https://getbukkit.org/download/${getbukkitFlavor} to lookup the
|
||||||
exact version, such as 1.4.6-R0.4-SNAPSHOT or 1.8-R0.1-SNAPSHOT-LATEST
|
exact version, such as 1.4.6-R0.4-SNAPSHOT or 1.8-R0.1-SNAPSHOT-latest.
|
||||||
|
Click into the version entry to find the **exact** version, because something
|
||||||
|
like "1.8" is not sufficient according to their download naming.
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
@@ -123,5 +125,4 @@ fi
|
|||||||
export TYPE=SPIGOT
|
export TYPE=SPIGOT
|
||||||
export SKIP_LOG4J_CONFIG=true
|
export SKIP_LOG4J_CONFIG=true
|
||||||
|
|
||||||
# Continue to Final Setup
|
exec ${SCRIPTS:-/}start-spiget "$@"
|
||||||
exec ${SCRIPTS:-/}start-finalSetupWorld $@
|
|
||||||
|
|||||||
@@ -3,6 +3,24 @@
|
|||||||
set -e
|
set -e
|
||||||
|
|
||||||
. ${SCRIPTS:-/}start-utils
|
. ${SCRIPTS:-/}start-utils
|
||||||
|
|
||||||
|
loadForgeVars() {
|
||||||
|
cfgFile=${1?}
|
||||||
|
pat='^([^#;][^=]+)=[:space:]*([^;]*)'
|
||||||
|
while read -r line || [[ -n "$line" ]] ; do
|
||||||
|
if [[ $line =~ $pat ]]; then
|
||||||
|
#echo "MATCHED $line"
|
||||||
|
k=${BASH_REMATCH[1]}
|
||||||
|
v=${BASH_REMATCH[2]}
|
||||||
|
case $k in
|
||||||
|
FORGEURL)
|
||||||
|
forgeInstallerUrl="$v"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
done < "$cfgFile"
|
||||||
|
}
|
||||||
|
|
||||||
isDebugging && set -x
|
isDebugging && set -x
|
||||||
|
|
||||||
: ${FTB_BASE_DIR:=${CF_BASE_DIR:-/data/FeedTheBeast}}
|
: ${FTB_BASE_DIR:=${CF_BASE_DIR:-/data/FeedTheBeast}}
|
||||||
@@ -42,23 +60,38 @@ if ! isTrue ${USE_MODPACK_START_SCRIPT:-true}; then
|
|||||||
mkdir -p ${FTB_BASE_DIR}
|
mkdir -p ${FTB_BASE_DIR}
|
||||||
unzip -o "${FTB_SERVER_MOD}" -d ${FTB_BASE_DIR} | awk '{printf "."} END {print ""}'
|
unzip -o "${FTB_SERVER_MOD}" -d ${FTB_BASE_DIR} | awk '{printf "."} END {print ""}'
|
||||||
|
|
||||||
serverJar=$(find ${FTB_BASE_DIR} -path "*/libraries/*" -prune -type f -o -not -name "forge*installer.jar" -name "forge*.jar")
|
serverJar=$(find ${FTB_BASE_DIR} -type f \( -path "*/libraries/*" -o -path "*/mods/*" \) -prune -o -name "forge*.jar" -not -name "forge*installer.jar" -print)
|
||||||
if [[ -z "$serverJar" ]]; then
|
if [[ -z "$serverJar" ]]; then
|
||||||
forgeInstallerJar=$(find ${FTB_BASE_DIR} -name "forge*installer.jar")
|
|
||||||
|
if [ -f "${FTB_BASE_DIR}/settings.cfg" ]; then
|
||||||
|
loadForgeVars "${FTB_BASE_DIR}/settings.cfg"
|
||||||
|
|
||||||
|
if [[ $forgeInstallerUrl ]]; then
|
||||||
|
forgeInstallerJar="${FTB_BASE_DIR}/forge-installer.jar"
|
||||||
|
if ! curl -fsSL -o "$forgeInstallerJar" "$forgeInstallerUrl" ; then
|
||||||
|
log "ERROR failed to download Forge installer from $forgeInstallerUrl"
|
||||||
|
exit 2
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
forgeInstallerJar=$(find "${FTB_BASE_DIR}" -name "forge*installer.jar")
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ -z "${forgeInstallerJar}" ]]; then
|
if [[ -z "${forgeInstallerJar}" ]]; then
|
||||||
log "ERROR Unable to find forge installer in modpack."
|
log "ERROR Unable to find forge installer in modpack"
|
||||||
|
log " or download using modpack config."
|
||||||
log " Make sure you downloaded the server files."
|
log " Make sure you downloaded the server files."
|
||||||
exit 2
|
exit 2
|
||||||
fi
|
fi
|
||||||
|
|
||||||
log "Installing forge server"
|
log "Installing forge server"
|
||||||
(cd $(dirname "${forgeInstallerJar}"); java -jar $(basename "${forgeInstallerJar}") --installServer) | awk '{printf "."} END {print ""}'
|
(cd $(dirname "${forgeInstallerJar}"); java -jar $(basename "${forgeInstallerJar}") --installServer)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "${FTB_SERVER_MOD}" > $installMarker
|
echo "${FTB_SERVER_MOD}" > $installMarker
|
||||||
fi
|
fi
|
||||||
|
|
||||||
export SERVER=$(find ${FTB_BASE_DIR} -path "*/libraries/*" -prune -type f -o -not -name "forge*installer.jar" -name "forge*.jar")
|
export SERVER=$(find ${FTB_BASE_DIR} -type f \( -path "*/libraries/*" -o -path "*/mods/*" \) -prune -o -name "forge*.jar" -not -name "forge*installer.jar" -print)
|
||||||
if [[ -z "${SERVER}" || ! -f "${SERVER}" ]]; then
|
if [[ -z "${SERVER}" || ! -f "${SERVER}" ]]; then
|
||||||
log "ERROR unable to locate installed forge server jar"
|
log "ERROR unable to locate installed forge server jar"
|
||||||
isDebugging && find ${FTB_BASE_DIR} -name "forge*.jar"
|
isDebugging && find ${FTB_BASE_DIR} -name "forge*.jar"
|
||||||
@@ -76,6 +109,7 @@ entryScriptExpr="
|
|||||||
-o -name ServerStartLinux.sh
|
-o -name ServerStartLinux.sh
|
||||||
-o -name LaunchServer.sh
|
-o -name LaunchServer.sh
|
||||||
-o -name server-start.sh
|
-o -name server-start.sh
|
||||||
|
-o -name start-server.sh
|
||||||
-o -name startserver.sh
|
-o -name startserver.sh
|
||||||
-o -name StartServer.sh
|
-o -name StartServer.sh
|
||||||
"
|
"
|
||||||
@@ -134,6 +168,16 @@ if [[ $startScriptCount = 0 ]]; then
|
|||||||
log "Unpacking FTB server modpack ${srv_modpack} ..."
|
log "Unpacking FTB server modpack ${srv_modpack} ..."
|
||||||
mkdir -p ${FTB_BASE_DIR}
|
mkdir -p ${FTB_BASE_DIR}
|
||||||
unzip -o "${srv_modpack}" -d ${FTB_BASE_DIR} | awk '{printf "."} END {print ""}'
|
unzip -o "${srv_modpack}" -d ${FTB_BASE_DIR} | awk '{printf "."} END {print ""}'
|
||||||
|
|
||||||
|
installScript=$(find "${FTB_BASE_DIR}" -maxdepth 2 -type f -name install.sh)
|
||||||
|
if [[ "$installScript" ]]; then
|
||||||
|
(
|
||||||
|
cd "$(dirname "${installScript}")"
|
||||||
|
chmod +x ./install.sh
|
||||||
|
log "Running included install.sh"
|
||||||
|
./install.sh
|
||||||
|
)
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ $(find ${FTB_BASE_DIR} $entryScriptExpr | wc -l) = 0 ]]; then
|
if [[ $(find ${FTB_BASE_DIR} $entryScriptExpr | wc -l) = 0 ]]; then
|
||||||
|
|||||||
54
start-deployCanyon
Normal file
54
start-deployCanyon
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -euo pipefail
|
||||||
|
IFS=$'\n\t'
|
||||||
|
|
||||||
|
. ${SCRIPTS:-/}start-utils
|
||||||
|
isDebugging && set -x
|
||||||
|
|
||||||
|
: ${CANYON_BUILD:=lastSuccessfulBuild}
|
||||||
|
JAVA_VER=$(java -version 2>&1 | head -1 | cut -d'"' -f2 | sed '/^1\./s///' | cut -d'.' -f1)
|
||||||
|
|
||||||
|
if [ "${JAVA_VER}" != "8" ]; then
|
||||||
|
log "ERROR: Canyon server type only supports Java version 8"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "${VERSION}" != "b1.7.3" ]; then
|
||||||
|
log "ERROR: Canyon server type only supports VERSION=b1.7.3"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
canyonJob="https://ci.velocitypowered.com/job/Canyon"
|
||||||
|
|
||||||
|
buildRelPath=$(
|
||||||
|
curl -fsSL "${canyonJob}/${CANYON_BUILD}/api/json" |
|
||||||
|
jq -r '.artifacts[0].relativePath'
|
||||||
|
)
|
||||||
|
buildNumber=$(
|
||||||
|
curl -fsSL "${canyonJob}/${CANYON_BUILD}/api/json" |
|
||||||
|
jq -r '.number'
|
||||||
|
)
|
||||||
|
baseName=$(basename "${buildRelPath}")
|
||||||
|
|
||||||
|
# Add build tag to non-tagged builds for version detection
|
||||||
|
if [ ${baseName%.*} = 'canyon-server' ]; then
|
||||||
|
export SERVER=${baseName%.*}_build${buildNumber}.jar
|
||||||
|
else
|
||||||
|
export SERVER="${baseName}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -f "$SERVER" ]; then
|
||||||
|
downloadUrl="${canyonJob}/${CANYON_BUILD}/artifact/${buildRelPath}"
|
||||||
|
log "Downloading Canyon build ${buildNumber} from $downloadUrl ..."
|
||||||
|
curl -fsSL -o "$SERVER" "$downloadUrl"
|
||||||
|
if [ ! -f "$SERVER" ]; then
|
||||||
|
log "ERROR: failed to download from $downloadUrl (status=$?)"
|
||||||
|
exit 3
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Normalize on Spigot for later operations
|
||||||
|
export TYPE=SPIGOT
|
||||||
|
export SKIP_LOG4J_CONFIG=true
|
||||||
|
|
||||||
|
exec ${SCRIPTS:-/}start-spiget "$@"
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
. ${SCRIPTS:-/}start-utils
|
. ${SCRIPTS:-/}start-utils
|
||||||
|
isDebugging && set -x
|
||||||
|
|
||||||
if isURL ${CUSTOM_SERVER}; then
|
if isURL ${CUSTOM_SERVER}; then
|
||||||
filename=$(basename ${CUSTOM_SERVER})
|
filename=$(basename ${CUSTOM_SERVER})
|
||||||
|
|||||||
@@ -43,6 +43,9 @@ if ! [ -f "${ftbInstallMarker}" ] || [ $(cat "${ftbInstallMarker}") != "${FTB_MO
|
|||||||
echo "${FTB_MODPACK_ID}=${FTB_MODPACK_VERSION_ID}" > ${ftbInstallMarker}
|
echo "${FTB_MODPACK_ID}=${FTB_MODPACK_VERSION_ID}" > ${ftbInstallMarker}
|
||||||
|
|
||||||
writeEula
|
writeEula
|
||||||
|
|
||||||
|
# some modpacks result in --w----r-- permissions
|
||||||
|
chmod a+r version.json
|
||||||
else
|
else
|
||||||
log "FTB modpack ID ${FTB_MODPACK_ID}, version ID ${FTB_MODPACK_VERSION_ID} is ready to go"
|
log "FTB modpack ID ${FTB_MODPACK_ID}, version ID ${FTB_MODPACK_VERSION_ID} is ready to go"
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -54,7 +54,10 @@ if [[ ! -e $installMarker ]]; then
|
|||||||
tries=3
|
tries=3
|
||||||
set +e
|
set +e
|
||||||
while ((--tries >= 0)); do
|
while ((--tries >= 0)); do
|
||||||
java -jar $FABRIC_INSTALLER server -mcversion $VANILLA_VERSION -downloadMinecraft
|
java -jar $FABRIC_INSTALLER server \
|
||||||
|
-mcversion $VANILLA_VERSION \
|
||||||
|
-downloadMinecraft \
|
||||||
|
-dir /data
|
||||||
if [[ $? == 0 ]]; then
|
if [[ $? == 0 ]]; then
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
. ${SCRIPTS:-/}start-utils
|
. ${SCRIPTS:-/}start-utils
|
||||||
|
|
||||||
export TYPE=FORGE
|
export TYPE=FORGE
|
||||||
|
: ${FORGEVERSION:=RECOMMENDED}
|
||||||
|
isDebugging && set -x
|
||||||
|
|
||||||
if [[ -z $FORGE_INSTALLER && -z $FORGE_INSTALLER_URL ]]; then
|
if [[ -z $FORGE_INSTALLER && -z $FORGE_INSTALLER_URL ]]; then
|
||||||
norm=$VANILLA_VERSION
|
norm=$VANILLA_VERSION
|
||||||
@@ -45,6 +46,8 @@ elif [[ -z $FORGE_INSTALLER ]]; then
|
|||||||
elif [[ ! -e $FORGE_INSTALLER ]]; then
|
elif [[ ! -e $FORGE_INSTALLER ]]; then
|
||||||
log "ERROR: the given Forge installer doesn't exist : $FORGE_INSTALLER"
|
log "ERROR: the given Forge installer doesn't exist : $FORGE_INSTALLER"
|
||||||
exit 2
|
exit 2
|
||||||
|
else
|
||||||
|
shortForgeVersion=$VANILLA_VERSION-custom
|
||||||
fi
|
fi
|
||||||
|
|
||||||
installMarker="/data/.forge-installed-$shortForgeVersion"
|
installMarker="/data/.forge-installed-$shortForgeVersion"
|
||||||
@@ -97,7 +100,11 @@ if [ ! -e $installMarker ]; then
|
|||||||
log "Finding installed server jar..."
|
log "Finding installed server jar..."
|
||||||
unset -v latest
|
unset -v latest
|
||||||
for file in *forge*.jar; do
|
for file in *forge*.jar; do
|
||||||
[[ $file =~ installer ]] || [[ $file -nt $latest ]] && latest=$file
|
if ! [[ $file =~ installer ]]; then
|
||||||
|
if [[ -z $latest ]] || [[ $file -nt $latest ]]; then
|
||||||
|
latest=$file
|
||||||
|
fi
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
if [[ -z $latest ]]; then
|
if [[ -z $latest ]]; then
|
||||||
log "Unable to derive server jar for Forge"
|
log "Unable to derive server jar for Forge"
|
||||||
|
|||||||
@@ -6,26 +6,27 @@ set -e
|
|||||||
isDebugging && set -x
|
isDebugging && set -x
|
||||||
|
|
||||||
requireVar VANILLA_VERSION
|
requireVar VANILLA_VERSION
|
||||||
|
: ${MOHIST_BUILD:=lastSuccessfulBuild}
|
||||||
|
|
||||||
mohistJobs=https://ci.codemc.io/job/Mohist-Community/job/
|
mohistJobs=https://ci.codemc.io/job/MohistMC/job/
|
||||||
mohistJob=${mohistJobs}Mohist-${VANILLA_VERSION}/
|
mohistJob=${mohistJobs}Mohist-${VANILLA_VERSION}/
|
||||||
|
|
||||||
if ! curl -X HEAD -o /dev/null -fsSL "${mohistJob}"; then
|
if ! curl -X HEAD -o /dev/null -fsSL "${mohistJob}"; then
|
||||||
log "ERROR: mohist builds do not exist for ${VANILLA_VERSION}"
|
log "ERROR: mohist builds do not exist for ${VANILLA_VERSION}"
|
||||||
log " check https://ci.codemc.io/job/Mohist-Community/ for available versions"
|
log " check https://ci.codemc.io/job/MohistMC/ for available versions"
|
||||||
log " and set VERSION accordingly"
|
log " and set VERSION accordingly"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
latestBuildRelPath=$(
|
buildRelPath=$(
|
||||||
curl -fsSL "${mohistJob}lastSuccessfulBuild/api/json" |
|
curl -fsSL "${mohistJob}${MOHIST_BUILD}/api/json" |
|
||||||
jq -r '.artifacts[0].relativePath'
|
jq -r '.artifacts[0].relativePath'
|
||||||
)
|
)
|
||||||
|
|
||||||
baseName=$(basename "${latestBuildRelPath}")
|
baseName=$(basename "${buildRelPath}")
|
||||||
if [[ ${baseName} != *-server.jar* ]]; then
|
if [[ ${baseName} != *-server.jar* ]]; then
|
||||||
log "ERROR: mohist build for ${VANILLA_VERSION} is not a valid server jar, found ${baseName}"
|
log "ERROR: mohist build for ${VANILLA_VERSION} is not a valid server jar, found ${baseName}"
|
||||||
log " check https://ci.codemc.io/job/Mohist-Community/ for available versions"
|
log " check https://ci.codemc.io/job/MohistMC/ for available versions"
|
||||||
log " and set VERSION accordingly"
|
log " and set VERSION accordingly"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
@@ -34,7 +35,7 @@ export SERVER="/data/${baseName}"
|
|||||||
|
|
||||||
if [ ! -f ${SERVER} ]; then
|
if [ ! -f ${SERVER} ]; then
|
||||||
log "Downloading ${baseName}"
|
log "Downloading ${baseName}"
|
||||||
curl -o "${SERVER}" -fsSL "${mohistJob}lastSuccessfulBuild/artifact/${latestBuildRelPath}"
|
curl -o "${SERVER}" -fsSL "${mohistJob}${MOHIST_BUILD}/artifact/${buildRelPath}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
export SKIP_LOG4J_CONFIG=true
|
export SKIP_LOG4J_CONFIG=true
|
||||||
|
|||||||
@@ -57,8 +57,10 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
log "Removing old PaperMC versions ..."
|
log "Removing old PaperMC versions ..."
|
||||||
paperJarSearchString=${SERVER/$build/[0-9]*}
|
shopt -s nullglob
|
||||||
find . -name "$paperJarSearchString" ! -name "$SERVER" -delete -print
|
for f in paper-*.jar; do
|
||||||
|
[[ $f != $SERVER ]] && rm $f
|
||||||
|
done
|
||||||
|
|
||||||
log "Downloading PaperMC $VANILLA_VERSION (build $build) ..."
|
log "Downloading PaperMC $VANILLA_VERSION (build $build) ..."
|
||||||
curl -fsSL -o "$SERVER" "${zarg[@]}" \
|
curl -fsSL -o "$SERVER" "${zarg[@]}" \
|
||||||
@@ -74,5 +76,4 @@ fi
|
|||||||
export TYPE=SPIGOT
|
export TYPE=SPIGOT
|
||||||
export SKIP_LOG4J_CONFIG=true
|
export SKIP_LOG4J_CONFIG=true
|
||||||
|
|
||||||
# Continue to Final Setup
|
exec ${SCRIPTS:-/}start-spiget "$@"
|
||||||
exec ${SCRIPTS:-/}start-finalSetupWorld "$@"
|
|
||||||
|
|||||||
37
start-deployPurpur
Executable file
37
start-deployPurpur
Executable file
@@ -0,0 +1,37 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -euo pipefail
|
||||||
|
IFS=$'\n\t'
|
||||||
|
|
||||||
|
. ${SCRIPTS:-/}start-utils
|
||||||
|
isDebugging && set -x
|
||||||
|
|
||||||
|
: ${VANILLA_VERSION:?}
|
||||||
|
: ${PURPUR_BUILD:=LATEST}
|
||||||
|
: ${FORCE_REDOWNLOAD:=false}
|
||||||
|
|
||||||
|
if [[ ${PURPUR_BUILD} == LATEST ]]; then
|
||||||
|
PURPUR_BUILD=$(curl -fsSL "https://purpur.pl3x.net/api/v1/purpur/${VANILLA_VERSION}" |
|
||||||
|
jq -r '.builds.latest' || echo "")
|
||||||
|
if [[ -z ${PURPUR_BUILD} ]]; then
|
||||||
|
log "ERROR: Failed to locate a Purpur build for ${VANILLA_VERSION}."
|
||||||
|
log " Please check if a download is available at https://purpur.pl3x.net/downloads/"
|
||||||
|
exit 3
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
export SERVER="purpur-${VANILLA_VERSION}-${PURPUR_BUILD}.jar"
|
||||||
|
|
||||||
|
if [ ! -f "$SERVER" ] || isTrue "$FORCE_REDOWNLOAD"; then
|
||||||
|
downloadUrl="https://purpur.pl3x.net/api/v1/purpur/${VANILLA_VERSION}/${PURPUR_BUILD}/download"
|
||||||
|
log "Downloading Purpur from $downloadUrl ..."
|
||||||
|
if ! curl -fsSL -o "$SERVER" "$downloadUrl"; then
|
||||||
|
log "ERROR: failed to download from $downloadUrl (status=$?)"
|
||||||
|
exit 3
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Normalize on Spigot for later operations
|
||||||
|
export TYPE=SPIGOT
|
||||||
|
export SKIP_LOG4J_CONFIG=true
|
||||||
|
|
||||||
|
exec ${SCRIPTS:-/}start-spiget "$@"
|
||||||
@@ -3,6 +3,8 @@
|
|||||||
. ${SCRIPTS:-/}start-utils
|
. ${SCRIPTS:-/}start-utils
|
||||||
|
|
||||||
export TYPE=spongevanilla
|
export TYPE=spongevanilla
|
||||||
|
: ${SPONGEBRANCH:=STABLE}
|
||||||
|
: ${SPONGEVERSION:=}
|
||||||
|
|
||||||
# Parse branch
|
# Parse branch
|
||||||
log "Choosing branch for Sponge"
|
log "Choosing branch for Sponge"
|
||||||
|
|||||||
@@ -20,8 +20,7 @@ if [ ! -f "$SERVER" ] || [ -n "$FORCE_REDOWNLOAD" ]; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Normalize on Spigot for operations below
|
# Normalize on Spigot for later operations
|
||||||
export TYPE=SPIGOT
|
export TYPE=SPIGOT
|
||||||
|
|
||||||
# Continue to Final Setup
|
exec ${SCRIPTS:-/}start-spiget "$@"
|
||||||
exec ${SCRIPTS:-/}start-finalSetupWorld $@
|
|
||||||
|
|||||||
30
start-deployYatopia
Normal file
30
start-deployYatopia
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -euo pipefail
|
||||||
|
IFS=$'\n\t'
|
||||||
|
|
||||||
|
. ${SCRIPTS:-/}start-utils
|
||||||
|
isDebugging && set -x
|
||||||
|
|
||||||
|
: ${VANILLA_VERSION:?}
|
||||||
|
: ${RELEASE:=stable}
|
||||||
|
: ${FORCE_REDOWNLOAD:=false}
|
||||||
|
|
||||||
|
requireEnum RELEASE stable latest
|
||||||
|
|
||||||
|
export SERVER="yatopia-${RELEASE}-${VANILLA_VERSION}.jar"
|
||||||
|
|
||||||
|
if [ ! -f "$SERVER" ] || isTrue "$FORCE_REDOWNLOAD"; then
|
||||||
|
downloadUrl="https://api.yatopiamc.org/v2/${RELEASE}Build/download?branch=ver/${VANILLA_VERSION}"
|
||||||
|
log "Downloading Yatopia from $downloadUrl ..."
|
||||||
|
if ! curl -fsSL -o "$SERVER" "$downloadUrl"; then
|
||||||
|
log "ERROR: failed to download from $downloadUrl (status=$?)"
|
||||||
|
exit 3
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Normalize on Spigot for later operations
|
||||||
|
export TYPE=SPIGOT
|
||||||
|
export SKIP_LOG4J_CONFIG=true
|
||||||
|
|
||||||
|
# Continue to Final Setup
|
||||||
|
exec ${SCRIPTS:-/}start-finalSetupWorld $@
|
||||||
@@ -5,7 +5,7 @@
|
|||||||
: ${ENV_VARIABLE_PREFIX:=CFG_}
|
: ${ENV_VARIABLE_PREFIX:=CFG_}
|
||||||
|
|
||||||
if isTrue "${REPLACE_ENV_VARIABLES}"; then
|
if isTrue "${REPLACE_ENV_VARIABLES}"; then
|
||||||
log "Replacing env variables in configs that match the prefix $ENV_VARIABLE_PREFIX..."
|
log "Replacing env variables in configs that match the prefix $ENV_VARIABLE_PREFIX ..."
|
||||||
|
|
||||||
# File excludes
|
# File excludes
|
||||||
fileExcludes=
|
fileExcludes=
|
||||||
@@ -22,28 +22,30 @@ if isTrue "${REPLACE_ENV_VARIABLES}"; then
|
|||||||
isDebugging && echo "Using find file exclusions: $fileExcludes"
|
isDebugging && echo "Using find file exclusions: $fileExcludes"
|
||||||
isDebugging && echo "Using find directory exclusions: $dirExcludes"
|
isDebugging && echo "Using find directory exclusions: $dirExcludes"
|
||||||
|
|
||||||
while IFS='=' read -r name value ; do
|
for name in $(compgen -v $ENV_VARIABLE_PREFIX); do
|
||||||
# check if name of env variable matches the prefix
|
# check if name of env variable matches the prefix
|
||||||
# sanity check environment variables to avoid code injections
|
# sanity check environment variables to avoid code injections
|
||||||
if [[ "$name" = $ENV_VARIABLE_PREFIX* ]] \
|
# Read content from file environment
|
||||||
&& [[ $value =~ ^[0-9a-zA-Z_:/=?.+\-]*$ ]] \
|
if [[ $name = *"_FILE" ]]; then
|
||||||
&& [[ $name =~ ^[0-9a-zA-Z_\-]*$ ]]; then
|
value=$(<${!name})
|
||||||
# Read content from file environment
|
name="${name%_FILE}"
|
||||||
if [[ $name = *"_FILE" ]] && [[ -f $value ]]; then
|
else
|
||||||
name="${name/_FILE/}"
|
value=${!name}
|
||||||
value=$(<$value)
|
|
||||||
fi
|
|
||||||
|
|
||||||
log "Replacing $name with $value ..."
|
|
||||||
find /data/ \
|
|
||||||
$dirExcludes \
|
|
||||||
-type f \
|
|
||||||
\( -name "*.yml" -or -name "*.yaml" -or -name "*.txt" -or -name "*.cfg" \
|
|
||||||
-or -name "*.conf" -or -name "*.properties" \) \
|
|
||||||
$fileExcludes \
|
|
||||||
-exec sed -i 's#${'"$name"'}#'"$value"'#g' {} \;
|
|
||||||
fi
|
fi
|
||||||
done < <(env)
|
|
||||||
|
log "Replacing $name with $value ..."
|
||||||
|
|
||||||
|
value=${value//\\/\\\\}
|
||||||
|
value=${value//#/\\#}
|
||||||
|
|
||||||
|
find /data/ \
|
||||||
|
$dirExcludes \
|
||||||
|
-type f \
|
||||||
|
\( -name "*.yml" -or -name "*.yaml" -or -name "*.txt" -or -name "*.cfg" \
|
||||||
|
-or -name "*.conf" -or -name "*.properties" -or -name "*.hjson" -or -name "*.json" \) \
|
||||||
|
$fileExcludes \
|
||||||
|
-exec sed -i 's#${'"$name"'}#'"$value"'#g' {} \;
|
||||||
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
exec ${SCRIPTS:-/}start-minecraftFinalSetup $@
|
exec ${SCRIPTS:-/}start-minecraftFinalSetup $@
|
||||||
|
|||||||
@@ -11,21 +11,9 @@ fi
|
|||||||
CURSE_URL_BASE=${CURSE_URL_BASE:-https://minecraft.curseforge.com/projects}
|
CURSE_URL_BASE=${CURSE_URL_BASE:-https://minecraft.curseforge.com/projects}
|
||||||
|
|
||||||
# Remove old mods/plugins
|
# Remove old mods/plugins
|
||||||
if isTrue ${REMOVE_OLD_MODS}; then
|
if isTrue ${REMOVE_OLD_MODS:-false}; then
|
||||||
remove_mods_dest="/data/mods"
|
removeOldMods /data/mods
|
||||||
case ${TYPE} in
|
removeOldMods /data/plugins
|
||||||
SPIGOT|BUKKIT|PAPER)
|
|
||||||
remove_mods_dest="/data/plugins"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
# only try to remove existing mods dir
|
|
||||||
if [ -d "$remove_mods_dest" ]; then
|
|
||||||
log "Removing old mods in $remove_mods_dest..."
|
|
||||||
find $remove_mods_dest -mindepth 1 -maxdepth ${REMOVE_OLD_MODS_DEPTH:-16} -wholename "${REMOVE_OLD_MODS_INCLUDE:-*}" -not -wholename "${REMOVE_OLD_MODS_EXCLUDE}" -delete
|
|
||||||
else
|
|
||||||
log "Directory $remove_mods_dest does not exist; removing nothing."
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# If supplied with a URL for a modpack (simple zip of jars), download it and unpack
|
# If supplied with a URL for a modpack (simple zip of jars), download it and unpack
|
||||||
@@ -37,35 +25,39 @@ if [[ "$MODPACK" ]]; then
|
|||||||
downloadUrl=$(curl -Ls -o /dev/null -w %{effective_url} $MODPACK)
|
downloadUrl=$(curl -Ls -o /dev/null -w %{effective_url} $MODPACK)
|
||||||
if ! [[ $downloadUrl == *.zip ]]; then
|
if ! [[ $downloadUrl == *.zip ]]; then
|
||||||
log "ERROR Invalid URL given for MODPACK: $downloadUrl resolved from $MODPACK"
|
log "ERROR Invalid URL given for MODPACK: $downloadUrl resolved from $MODPACK"
|
||||||
log " Must be HTTP or HTTPS and a ZIP file"
|
log " Must be HTTP, HTTPS or FTP and a ZIP file"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
log "Downloading mod/plugin pack via HTTP"
|
log "Downloading mod/plugin pack"
|
||||||
log " from $downloadUrl ..."
|
log " from $downloadUrl ..."
|
||||||
if ! curl -sSL -o /tmp/modpack.zip "$downloadUrl"; then
|
if ! curl -sSL -o /tmp/modpack.zip "$downloadUrl"; then
|
||||||
log "ERROR: failed to download from $downloadUrl"
|
log "ERROR: failed to download from $downloadUrl"
|
||||||
exit 2
|
exit 2
|
||||||
fi
|
fi
|
||||||
|
elif [[ "$MODPACK" =~ .*\.zip ]]; then
|
||||||
if [ "$TYPE" = "SPIGOT" ]; then
|
if ! cp $MODPACK /tmp/modpack.zip; then
|
||||||
mkdir -p /data/plugins
|
log "ERROR: failed to copy from $MODPACK"
|
||||||
if ! unzip -o -d /data/plugins /tmp/modpack.zip; then
|
exit 2
|
||||||
log "ERROR: failed to unzip the modpack from $downloadUrl"
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
mkdir -p /data/mods
|
|
||||||
if ! unzip -o -d /data/mods /tmp/modpack.zip; then
|
|
||||||
log "ERROR: failed to unzip the modpack from $downloadUrl"
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
rm -f /tmp/modpack.zip
|
|
||||||
|
|
||||||
else
|
else
|
||||||
log "ERROR Invalid URL given for MODPACK: $MODPACK"
|
log "ERROR Invalid URL or Path given for MODPACK: $MODPACK"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ "$TYPE" = "SPIGOT" ]; then
|
||||||
|
mkdir -p /data/plugins
|
||||||
|
if ! unzip -o -d /data/plugins /tmp/modpack.zip; then
|
||||||
|
log "ERROR: failed to unzip the modpack from $downloadUrl"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
mkdir -p /data/mods
|
||||||
|
if ! unzip -o -d /data/mods /tmp/modpack.zip; then
|
||||||
|
log "ERROR: failed to unzip the modpack from $downloadUrl"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
rm -f /tmp/modpack.zip
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# If supplied with a URL for a plugin download it.
|
# If supplied with a URL for a plugin download it.
|
||||||
@@ -99,8 +91,18 @@ if [[ "$MODS" ]]; then
|
|||||||
exit 2
|
exit 2
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
elif [[ -f "$i" && "$i" =~ .*\.jar ]]; then
|
||||||
|
log "Copying plugin located at $i ..."
|
||||||
|
out_file=$(basename "$i")
|
||||||
|
if ! cp "$i" "${out_dir}/$out_file"; then
|
||||||
|
log "ERROR: failed to copy from $i into $out_dir"
|
||||||
|
exit 2
|
||||||
|
fi
|
||||||
|
elif [[ -d "$i" ]]; then
|
||||||
|
log "Copying plugin jars from $i ..."
|
||||||
|
cp "$i"/*.jar "${out_dir}"
|
||||||
else
|
else
|
||||||
log "ERROR Invalid URL given in MODS: $i"
|
log "ERROR Invalid URL or path given in MODS: $i"
|
||||||
exit 2
|
exit 2
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|||||||
@@ -21,10 +21,12 @@ if [ -d /plugins ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# If any modules have been provided, copy them over
|
# If any modules have been provided, copy them over
|
||||||
|
: ${COPY_MODS_DEST:="/data/mods"}
|
||||||
|
|
||||||
if [ -d /mods ]; then
|
if [ -d /mods ]; then
|
||||||
log "Copying any mods over..."
|
log "Copying any mods over..."
|
||||||
mkdir -p /data/mods
|
mkdir -p $COPY_MODS_DEST
|
||||||
rsync -a --out-format="update:%f:Last Modified %M" "${rsyncArgs[@]}" --prune-empty-dirs --update /mods /data
|
rsync -a --out-format="update:%f:Last Modified %M" "${rsyncArgs[@]}" --prune-empty-dirs --update /mods/ $COPY_MODS_DEST
|
||||||
fi
|
fi
|
||||||
|
|
||||||
: ${COPY_CONFIG_DEST:="/data/config"}
|
: ${COPY_CONFIG_DEST:="/data/config"}
|
||||||
|
|||||||
@@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
. ${SCRIPTS:-/}start-utils
|
. ${SCRIPTS:-/}start-utils
|
||||||
|
|
||||||
|
: ${SERVER_PROPERTIES:=/data/server.properties}
|
||||||
|
|
||||||
# FUNCTIONS
|
# FUNCTIONS
|
||||||
function setServerProp {
|
function setServerProp {
|
||||||
local prop=$1
|
local prop=$1
|
||||||
@@ -12,10 +14,15 @@ function setServerProp {
|
|||||||
TRUE|FALSE)
|
TRUE|FALSE)
|
||||||
var=${var,,} ;;
|
var=${var,,} ;;
|
||||||
esac
|
esac
|
||||||
log "Setting ${prop} to '${var}' in ${SERVER_PROPERTIES}"
|
if grep "${prop}" "$SERVER_PROPERTIES" > /dev/null; then
|
||||||
sed -i "/^${prop}\s*=/ c ${prop}=${var//\\/\\\\}" "$SERVER_PROPERTIES"
|
log "Setting ${prop} to '${var}' in ${SERVER_PROPERTIES}"
|
||||||
|
sed -i "/^${prop}\s*=/ c ${prop}=${var//\\/\\\\}" "$SERVER_PROPERTIES"
|
||||||
|
else
|
||||||
|
log "Adding ${prop} with '${var}' in ${SERVER_PROPERTIES}"
|
||||||
|
echo "${prop}=${var//\\/\\\\}" >> "$SERVER_PROPERTIES"
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
log "Skip setting ${prop}"
|
isDebugging && log "Skip setting ${prop}"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -24,6 +31,10 @@ function customizeServerProps {
|
|||||||
log "Creating whitelist"
|
log "Creating whitelist"
|
||||||
setServerProp "whitelist" "true"
|
setServerProp "whitelist" "true"
|
||||||
setServerProp "white-list" "true"
|
setServerProp "white-list" "true"
|
||||||
|
else
|
||||||
|
log "Disabling whitelist"
|
||||||
|
setServerProp "whitelist" "false"
|
||||||
|
setServerProp "white-list" "false"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# If not provided, generate a reasonable default message-of-the-day,
|
# If not provided, generate a reasonable default message-of-the-day,
|
||||||
@@ -69,7 +80,7 @@ function customizeServerProps {
|
|||||||
setServerProp "max-world-size" "$MAX_WORLD_SIZE"
|
setServerProp "max-world-size" "$MAX_WORLD_SIZE"
|
||||||
setServerProp "level-name" "$LEVEL"
|
setServerProp "level-name" "$LEVEL"
|
||||||
setServerProp "level-seed" "$SEED"
|
setServerProp "level-seed" "$SEED"
|
||||||
setServerProp "pvp" "$PVP"
|
setServerProp "pvp" "${PVP}"
|
||||||
setServerProp "generator-settings" "$GENERATOR_SETTINGS"
|
setServerProp "generator-settings" "$GENERATOR_SETTINGS"
|
||||||
setServerProp "online-mode" "$ONLINE_MODE"
|
setServerProp "online-mode" "$ONLINE_MODE"
|
||||||
setServerProp "allow-flight" "$ALLOW_FLIGHT"
|
setServerProp "allow-flight" "$ALLOW_FLIGHT"
|
||||||
@@ -170,8 +181,8 @@ function customizeServerProps {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Deploy server.properties file
|
# Deploy server.properties file
|
||||||
if [[ ${TYPE} == "FEED-THE-BEAST" ]]; then
|
if [[ ${TYPE} == "CURSEFORGE" ]]; then
|
||||||
export SERVER_PROPERTIES=${FTB_DIR}/server.properties
|
export SERVER_PROPERTIES="${FTB_DIR}/server.properties"
|
||||||
log "detected FTB, changing properties path to ${SERVER_PROPERTIES}"
|
log "detected FTB, changing properties path to ${SERVER_PROPERTIES}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -203,7 +214,7 @@ fi
|
|||||||
|
|
||||||
if isDebugging; then
|
if isDebugging; then
|
||||||
log "DEBUG Dumping server.properties"
|
log "DEBUG Dumping server.properties"
|
||||||
cat /data/server.properties
|
cat "${SERVER_PROPERTIES}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
exec ${SCRIPTS:-/}start-finalSetupEnvVariables $@
|
exec ${SCRIPTS:-/}start-finalSetupEnvVariables $@
|
||||||
|
|||||||
@@ -4,13 +4,23 @@
|
|||||||
set -e
|
set -e
|
||||||
isDebugging && set -x
|
isDebugging && set -x
|
||||||
|
|
||||||
if [ $TYPE = "FEED-THE-BEAST" ]; then
|
: ${LEVEL:=world}
|
||||||
|
export LEVEL
|
||||||
|
|
||||||
|
if [ $TYPE = "CURSEFORGE" ]; then
|
||||||
worldDest=$FTB_DIR/$LEVEL
|
worldDest=$FTB_DIR/$LEVEL
|
||||||
else
|
else
|
||||||
worldDest=/data/$LEVEL
|
worldDest=/data/$LEVEL
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "$WORLD" ]] && ( isTrue "${FORCE_WORLD_COPY}" || [ ! -d "$worldDest" ] ); then
|
if [[ "$WORLD" ]] && ( isTrue "${FORCE_WORLD_COPY}" || [ ! -d "$worldDest" ] ); then
|
||||||
|
if isTrue "${FORCE_WORLD_COPY}"; then
|
||||||
|
log "Removing existing world data in $worldDest ${worldDest}_nether ${worldDest}_the_end"
|
||||||
|
rm -rf "$worldDest" \
|
||||||
|
"${worldDest}_nether" \
|
||||||
|
"${worldDest}_the_end"
|
||||||
|
fi
|
||||||
|
|
||||||
if isURL $WORLD; then
|
if isURL $WORLD; then
|
||||||
curl -fsSL "$WORLD" -o /tmp/world.zip
|
curl -fsSL "$WORLD" -o /tmp/world.zip
|
||||||
zipSrc=/tmp/world.zip
|
zipSrc=/tmp/world.zip
|
||||||
@@ -56,8 +66,8 @@ if [[ "$WORLD" ]] && ( isTrue "${FORCE_WORLD_COPY}" || [ ! -d "$worldDest" ] );
|
|||||||
if [ "$TYPE" = "SPIGOT" ]; then
|
if [ "$TYPE" = "SPIGOT" ]; then
|
||||||
# Reorganise if a Spigot server
|
# Reorganise if a Spigot server
|
||||||
log "Moving End and Nether maps to Spigot location"
|
log "Moving End and Nether maps to Spigot location"
|
||||||
[ -d "$worldDest/DIM1" ] && mv -f "$worldDest/DIM1" "/data/${LEVEL}_the_end"
|
[ -d "$worldDest/DIM1" ] && mv -f "$worldDest/DIM1" "${worldDest}_the_end"
|
||||||
[ -d "$worldDest/DIM-1" ] && mv -f "$worldDest/DIM-1" "/data/${LEVEL}_nether"
|
[ -d "$worldDest/DIM-1" ] && mv -f "$worldDest/DIM-1" "${worldDest}_nether"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@@ -1,27 +1,26 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
. ${SCRIPTS:-/}start-utils
|
. ${SCRIPTS:-/}start-utils
|
||||||
|
isDebugging && set -x
|
||||||
|
|
||||||
if [ -n "$OPS" ]; then
|
if [ -n "$OPS" ]; then
|
||||||
log "Updating ops"
|
log "Updating ops"
|
||||||
rm -f /data/ops.txt.converted
|
rm -f /data/ops.txt.converted
|
||||||
echo $OPS | awk -v RS=, '{print}' > /data/ops.txt
|
echo $OPS | awk -v RS=, '{print}' > /data/ops.txt
|
||||||
|
fi
|
||||||
if isTrue "${OVERRIDE_OPS}"; then
|
if isTrue "${OVERRIDE_OPS}"; then
|
||||||
log "Recreating ops.json file at server startup"
|
log "Recreating ops.json file at server startup"
|
||||||
rm -f /data/ops.json
|
rm -f /data/ops.json
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "$WHITELIST" ]; then
|
if [ -n "$WHITELIST" ]; then
|
||||||
log "Updating whitelist"
|
log "Updating whitelist"
|
||||||
rm -f /data/white-list.txt.converted
|
rm -f /data/white-list.txt.converted
|
||||||
echo $WHITELIST | awk -v RS=, '{print}' > /data/white-list.txt
|
echo $WHITELIST | awk -v RS=, '{print}' > /data/white-list.txt
|
||||||
|
fi
|
||||||
if isTrue "${OVERRIDE_WHITELIST}"; then
|
if isTrue "${OVERRIDE_WHITELIST}"; then
|
||||||
log "Recreating whitelist.json file at server startup"
|
log "Recreating whitelist.json file at server startup"
|
||||||
rm -f /data/whitelist.json
|
rm -f /data/whitelist.json
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "$ICON" ]; then
|
if [ -n "$ICON" ]; then
|
||||||
@@ -39,16 +38,16 @@ if [ -n "$ICON" ]; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if ! isTrue ${SKIP_LOG4J_CONFIG}; then
|
if isTrue ${ENABLE_ROLLING_LOGS:-false}; then
|
||||||
# Set up log configuration
|
# Set up log configuration
|
||||||
LOGFILE="/data/log4j2.xml"
|
LOGFILE="/data/log4j2.xml"
|
||||||
if [ ! -e "$LOGFILE" ]; then
|
if [ ! -e "$LOGFILE" ]; then
|
||||||
log "Creating log4j2.xml in ${LOGFILE}"
|
log "Creating log4j2.xml in ${LOGFILE}"
|
||||||
cp /tmp/log4j2.xml "$LOGFILE"
|
cp /tmp/log4j2.xml "$LOGFILE"
|
||||||
else
|
else
|
||||||
log "log4j2.xml already created, skipping"
|
log "log4j2.xml already created, skipping"
|
||||||
fi
|
fi
|
||||||
JVM_OPTS="-Dlog4j.configurationFile=/data/log4j2.xml ${JVM_OPTS}"
|
JVM_OPTS="-Dlog4j.configurationFile=/data/log4j2.xml ${JVM_OPTS}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Make sure files exist and are valid JSON (for pre-1.12 to 1.12 upgrades)
|
# Make sure files exist and are valid JSON (for pre-1.12 to 1.12 upgrades)
|
||||||
@@ -61,15 +60,14 @@ for j in $JSON_FILES; do
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
EXTRA_ARGS=""
|
|
||||||
# Optional disable console
|
# Optional disable console
|
||||||
if versionLessThan 1.14 && [[ ${CONSOLE,,} = false ]]; then
|
if versionLessThan 1.14 && [[ ${CONSOLE,,} = false ]]; then
|
||||||
EXTRA_ARGS+="--noconsole"
|
EXTRA_ARGS+=" --noconsole"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Optional disable GUI for headless servers
|
# Optional disable GUI for headless servers
|
||||||
if [[ ${GUI} = false || ${GUI} = FALSE ]]; then
|
if [[ ${GUI} = false || ${GUI} = FALSE ]]; then
|
||||||
EXTRA_ARGS="${EXTRA_ARGS} nogui"
|
EXTRA_ARGS+=" nogui"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# put these prior JVM_OPTS at the end to give any memory settings there higher precedence
|
# put these prior JVM_OPTS at the end to give any memory settings there higher precedence
|
||||||
@@ -84,7 +82,6 @@ if [ -n "$JVM_DD_OPTS" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if isTrue ${ENABLE_JMX}; then
|
if isTrue ${ENABLE_JMX}; then
|
||||||
: ${JMX_HOST:=0.0.0.0}
|
|
||||||
: ${JMX_PORT:=7091}
|
: ${JMX_PORT:=7091}
|
||||||
JVM_OPTS="${JVM_OPTS}
|
JVM_OPTS="${JVM_OPTS}
|
||||||
-Dcom.sun.management.jmxremote.local.only=false
|
-Dcom.sun.management.jmxremote.local.only=false
|
||||||
@@ -92,8 +89,8 @@ if isTrue ${ENABLE_JMX}; then
|
|||||||
-Dcom.sun.management.jmxremote.rmi.port=${JMX_PORT}
|
-Dcom.sun.management.jmxremote.rmi.port=${JMX_PORT}
|
||||||
-Dcom.sun.management.jmxremote.authenticate=false
|
-Dcom.sun.management.jmxremote.authenticate=false
|
||||||
-Dcom.sun.management.jmxremote.ssl=false
|
-Dcom.sun.management.jmxremote.ssl=false
|
||||||
-Dcom.sun.management.jmxremote.host=${JMX_HOST}
|
-Dcom.sun.management.jmxremote.host=${JMX_BINDING:-0.0.0.0}
|
||||||
-Djava.rmi.server.hostname=${JMX_HOST}"
|
-Djava.rmi.server.hostname=${JMX_HOST:-localhost}"
|
||||||
|
|
||||||
log "JMX is enabled. Make sure you have port forwarding for ${JMX_PORT}"
|
log "JMX is enabled. Make sure you have port forwarding for ${JMX_PORT}"
|
||||||
fi
|
fi
|
||||||
@@ -147,6 +144,13 @@ if isTrue "${USE_LARGE_PAGES}"; then
|
|||||||
"
|
"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if isTrue "${USE_FLARE_FLAGS}"; then
|
||||||
|
JVM_XX_OPTS="${JVM_XX_OPTS}
|
||||||
|
-XX:+UnlockDiagnosticVMOptions
|
||||||
|
-XX:+DebugNonSafepoints
|
||||||
|
"
|
||||||
|
fi
|
||||||
|
|
||||||
if isTrue "${DEBUG_MEMORY}"; then
|
if isTrue "${DEBUG_MEMORY}"; then
|
||||||
log "Memory usage and availability (in MB)"
|
log "Memory usage and availability (in MB)"
|
||||||
uname -a
|
uname -a
|
||||||
@@ -203,10 +207,19 @@ EOF
|
|||||||
|
|
||||||
cd "${FTB_DIR}"
|
cd "${FTB_DIR}"
|
||||||
log "Running FTB ${FTB_SERVER_START} in ${FTB_DIR} ..."
|
log "Running FTB ${FTB_SERVER_START} in ${FTB_DIR} ..."
|
||||||
|
|
||||||
|
finalArgs=(
|
||||||
|
"${FTB_SERVER_START}"
|
||||||
|
)
|
||||||
|
|
||||||
if isTrue ${DEBUG_EXEC}; then
|
if isTrue ${DEBUG_EXEC}; then
|
||||||
set -x
|
set -x
|
||||||
fi
|
fi
|
||||||
exec mc-server-runner ${mcServerRunnerArgs} "${FTB_SERVER_START}"
|
if isTrue ${EXEC_DIRECTLY:-false}; then
|
||||||
|
"${finalArgs[@]}"
|
||||||
|
else
|
||||||
|
exec mc-server-runner ${mcServerRunnerArgs} "${finalArgs[@]}"
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
# If we have a bootstrap.txt file... feed that in to the server stdin
|
# If we have a bootstrap.txt file... feed that in to the server stdin
|
||||||
if [ -f /data/bootstrap.txt ]; then
|
if [ -f /data/bootstrap.txt ]; then
|
||||||
@@ -214,8 +227,23 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
log "Starting the Minecraft server..."
|
log "Starting the Minecraft server..."
|
||||||
|
|
||||||
|
finalArgs=(
|
||||||
|
$JVM_XX_OPTS
|
||||||
|
$JVM_OPTS
|
||||||
|
$expandedDOpts
|
||||||
|
-jar $SERVER
|
||||||
|
"$@" $EXTRA_ARGS
|
||||||
|
)
|
||||||
|
|
||||||
if isTrue ${DEBUG_EXEC}; then
|
if isTrue ${DEBUG_EXEC}; then
|
||||||
set -x
|
set -x
|
||||||
fi
|
fi
|
||||||
exec mc-server-runner ${bootstrapArgs} ${mcServerRunnerArgs} java $JVM_XX_OPTS $JVM_OPTS $expandedDOpts -jar $SERVER "$@" $EXTRA_ARGS
|
|
||||||
|
if isTrue ${EXEC_DIRECTLY:-false}; then
|
||||||
|
exec java "${finalArgs[@]}"
|
||||||
|
else
|
||||||
|
exec mc-server-runner ${bootstrapArgs} ${mcServerRunnerArgs} java "${finalArgs[@]}"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
62
start-spiget
Normal file
62
start-spiget
Normal file
@@ -0,0 +1,62 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -euo pipefail
|
||||||
|
IFS=$'\n\t'
|
||||||
|
|
||||||
|
. ${SCRIPTS:-/}start-utils
|
||||||
|
handleDebugMode
|
||||||
|
|
||||||
|
: ${SPIGET_RESOURCES:=}
|
||||||
|
|
||||||
|
containsJars() {
|
||||||
|
file=${1?}
|
||||||
|
|
||||||
|
pat='\.jar$'
|
||||||
|
|
||||||
|
while read -r line; do
|
||||||
|
if [[ $line =~ $pat ]]; then
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
done <<<$(unzip -l "$file")
|
||||||
|
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
|
||||||
|
getResourceFromSpiget() {
|
||||||
|
resource=${1?}
|
||||||
|
|
||||||
|
log "Downloading resource ${resource} ..."
|
||||||
|
|
||||||
|
tmpfile="/tmp/${resource}.zip"
|
||||||
|
url="https://api.spiget.org/v2/resources/${resource}/download"
|
||||||
|
if ! curl -o "${tmpfile}" -fsSL -H "User-Agent: itzg/minecraft-server" "${extraCurlArgs[@]}" "${url}"; then
|
||||||
|
log "ERROR failed to download resource '${resource}' from ${url}"
|
||||||
|
exit 2
|
||||||
|
fi
|
||||||
|
|
||||||
|
mkdir -p /data/plugins
|
||||||
|
if containsJars "${tmpfile}"; then
|
||||||
|
log "Extracting contents of resource ${resource} into plugins"
|
||||||
|
unzip -o -q -d /data/plugins "${tmpfile}"
|
||||||
|
rm "${tmpfile}"
|
||||||
|
else
|
||||||
|
log "Moving resource ${resource} into plugins"
|
||||||
|
mv "${tmpfile}" "/data/plugins/${resource}.jar"
|
||||||
|
fi
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if [[ ${SPIGET_RESOURCES} ]]; then
|
||||||
|
if isTrue ${REMOVE_OLD_MODS:-false}; then
|
||||||
|
removeOldMods /data/plugins
|
||||||
|
REMOVE_OLD_MODS=false
|
||||||
|
fi
|
||||||
|
|
||||||
|
log "Getting plugins via Spiget"
|
||||||
|
IFS=',' read -r -a resources <<<"${SPIGET_RESOURCES}"
|
||||||
|
for resource in "${resources[@]}"; do
|
||||||
|
getResourceFromSpiget "${resource}"
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Continue to Final Setup
|
||||||
|
exec ${SCRIPTS:-/}start-finalSetupWorld $@
|
||||||
31
start-utils
31
start-utils
@@ -11,7 +11,7 @@ function join_by() {
|
|||||||
function isURL() {
|
function isURL() {
|
||||||
local value=$1
|
local value=$1
|
||||||
|
|
||||||
if [[ ${value:0:8} == "https://" || ${value:0:7} == "http://" ]]; then
|
if [[ ${value:0:8} == "https://" || ${value:0:7} == "http://" || ${value:0:6} == "ftp://" ]]; then
|
||||||
return 0
|
return 0
|
||||||
else
|
else
|
||||||
return 1
|
return 1
|
||||||
@@ -57,13 +57,20 @@ function isTrue() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function isDebugging() {
|
function isDebugging() {
|
||||||
if [[ -v DEBUG ]] && [[ ${DEBUG^^} == TRUE ]]; then
|
if isTrue "${DEBUG:-false}"; then
|
||||||
return 0
|
return 0
|
||||||
else
|
else
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function handleDebugMode() {
|
||||||
|
if isDebugging; then
|
||||||
|
set -x
|
||||||
|
extraCurlArgs=(-v)
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
function debug() {
|
function debug() {
|
||||||
if isDebugging; then
|
if isDebugging; then
|
||||||
log "DEBUG: $*"
|
log "DEBUG: $*"
|
||||||
@@ -144,6 +151,20 @@ requireVar() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
requireEnum() {
|
||||||
|
var=${1?}
|
||||||
|
shift
|
||||||
|
|
||||||
|
for allowed in $*; do
|
||||||
|
if [[ ${!var} = $allowed ]]; then
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
log "ERROR: $var must be set to one of $@"
|
||||||
|
# exit 1
|
||||||
|
}
|
||||||
|
|
||||||
function writeEula() {
|
function writeEula() {
|
||||||
if ! echo "# Generated via Docker
|
if ! echo "# Generated via Docker
|
||||||
# $(date)
|
# $(date)
|
||||||
@@ -153,3 +174,9 @@ eula=${EULA,,}
|
|||||||
exit 2
|
exit 2
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function removeOldMods {
|
||||||
|
if [ -d "$1" ]; then
|
||||||
|
find "$1" -mindepth 1 -maxdepth ${REMOVE_OLD_MODS_DEPTH:-16} -wholename "${REMOVE_OLD_MODS_INCLUDE:-*}" -not -wholename "${REMOVE_OLD_MODS_EXCLUDE:-}" -delete
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|||||||
@@ -10,6 +10,9 @@ services:
|
|||||||
restart: "no"
|
restart: "no"
|
||||||
build:
|
build:
|
||||||
context: ..
|
context: ..
|
||||||
|
args:
|
||||||
|
TARGETOS: linux
|
||||||
|
TARGETARCH: amd64
|
||||||
cache_from:
|
cache_from:
|
||||||
- itzg/minecraft-server:latest
|
- itzg/minecraft-server:latest
|
||||||
environment:
|
environment:
|
||||||
|
|||||||
Reference in New Issue
Block a user