fix: add libbpf-dev for xdp clang headers, update papermc download API to fill.papermc.io/v3
This commit is contained in:
parent
c828915560
commit
997da7fbd3
3 changed files with 26 additions and 15 deletions
2
.github/workflows/ci.yml
vendored
2
.github/workflows/ci.yml
vendored
|
|
@ -21,7 +21,7 @@ jobs:
|
||||||
with:
|
with:
|
||||||
components: clippy, rustfmt
|
components: clippy, rustfmt
|
||||||
- uses: Swatinem/rust-cache@v2
|
- uses: Swatinem/rust-cache@v2
|
||||||
- run: sudo apt-get update && sudo apt-get install -y libelf-dev
|
- run: sudo apt-get update && sudo apt-get install -y libelf-dev libbpf-dev
|
||||||
- run: cargo fmt --all --check
|
- run: cargo fmt --all --check
|
||||||
- run: cargo clippy --all-targets --all-features -- -D warnings
|
- run: cargo clippy --all-targets --all-features -- -D warnings
|
||||||
- run: cargo check --all-features
|
- run: cargo check --all-features
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,20 @@
|
||||||
FROM eclipse-temurin:21-jre-noble
|
FROM eclipse-temurin:21-jre-noble
|
||||||
|
|
||||||
ARG PAPER_VERSION=1.21.4
|
ARG PAPER_VERSION=1.21
|
||||||
ARG PAPER_BUILD=latest
|
ARG PAPER_BUILD=latest
|
||||||
|
|
||||||
RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/*
|
RUN apt-get update && apt-get install -y curl jq && rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
# Download Paper
|
# Download Paper
|
||||||
RUN curl -fsSLo /opt/paper.jar \
|
RUN VERSION="${PAPER_VERSION}" && \
|
||||||
"https://api.papermc.io/v2/projects/paper/versions/${PAPER_VERSION}/builds/${PAPER_BUILD}/downloads/paper-${PAPER_VERSION}-${PAPER_BUILD}.jar" || \
|
BUILD="${PAPER_BUILD}" && \
|
||||||
echo "Falling back to direct download..." && \
|
BUILDS_JSON=$(curl -s -H "User-Agent: rampart/1.0.0 (https://github.com/loki5512344/rampart)" \
|
||||||
curl -fsSLo /opt/paper.jar \
|
"https://fill.papermc.io/v3/projects/paper/versions/${VERSION}/builds") && \
|
||||||
"https://papermc.io/api/v2/projects/paper/versions/${PAPER_VERSION}/builds/${PAPER_BUILD}/downloads/paper-${PAPER_VERSION}-${PAPER_BUILD}.jar"
|
if [ "${BUILD}" = "latest" ]; then \
|
||||||
|
BUILD=$(echo "${BUILDS_JSON}" | jq -r 'first(.[] | select(.channel == "STABLE") | .id) // empty'); \
|
||||||
|
fi && \
|
||||||
|
URL=$(echo "${BUILDS_JSON}" | jq -r --arg b "${BUILD}" 'first(.[] | select(.id == ($b | tonumber)) | .downloads."server:default".url) // empty') && \
|
||||||
|
curl -fsSLo /opt/paper.jar "${URL}"
|
||||||
|
|
||||||
COPY deploy/config/server.properties /opt/server.properties
|
COPY deploy/config/server.properties /opt/server.properties
|
||||||
COPY deploy/config/paper-global.yml /opt/paper-global.yml
|
COPY deploy/config/paper-global.yml /opt/paper-global.yml
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,22 @@
|
||||||
FROM eclipse-temurin:21-jre-noble
|
FROM eclipse-temurin:21-jre-noble
|
||||||
|
|
||||||
ARG VELOCITY_VERSION=3.4.0-SNAPSHOT
|
ARG VELOCITY_VERSION=4.0.0
|
||||||
ARG VELOCITY_BUILD=latest
|
ARG VELOCITY_BUILD=6
|
||||||
|
|
||||||
RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/*
|
RUN apt-get update && apt-get install -y curl jq && rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
# Download Velocity
|
# Download Velocity
|
||||||
RUN curl -fsSLo /opt/velocity.jar \
|
RUN VERSION="${VELOCITY_VERSION}" && \
|
||||||
"https://api.papermc.io/v2/projects/velocity/versions/${VELOCITY_VERSION}/builds/${VELOCITY_BUILD}/downloads/velocity-${VELOCITY_VERSION}-${VELOCITY_BUILD}.jar" || \
|
BUILD="${VELOCITY_BUILD}" && \
|
||||||
curl -fsSLo /opt/velocity.jar \
|
if [ "${BUILD}" = "latest" ]; then \
|
||||||
"https://versions.velocitypowered.com/download/${VELOCITY_VERSION}.jar"
|
BUILD=$(curl -s -H "User-Agent: rampart/1.0.0 (https://github.com/loki5512344/rampart)" \
|
||||||
|
"https://fill.papermc.io/v3/projects/velocity/versions/${VERSION}/builds" | \
|
||||||
|
jq -r 'first(.[] | select(.channel == "STABLE") | .id) // empty'); \
|
||||||
|
fi && \
|
||||||
|
URL=$(curl -s -H "User-Agent: rampart/1.0.0 (https://github.com/loki5512344/rampart)" \
|
||||||
|
"https://fill.papermc.io/v3/projects/velocity/versions/${VERSION}/builds" | \
|
||||||
|
jq -r --arg b "${BUILD}" 'first(.[] | select(.id == ($b | tonumber)) | .downloads."server:default".url) // empty') && \
|
||||||
|
curl -fsSLo /opt/velocity.jar "${URL}"
|
||||||
|
|
||||||
COPY deploy/config/velocity.toml /opt/velocity.toml
|
COPY deploy/config/velocity.toml /opt/velocity.toml
|
||||||
COPY plugins/velocity/build/libs/rampart-velocity-*.jar /opt/plugins/
|
COPY plugins/velocity/build/libs/rampart-velocity-*.jar /opt/plugins/
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue