Add Dockerfile (#1504)

* feat: Add Dockerfile
* fix: Download latest version and not a fixed one

Using jq we can query the appvoyor api to get the latest jobId
This commit is contained in:
Tan to the Dashi 2021-03-14 11:14:13 +01:00 committed by GitHub
parent 90505dbc4c
commit fd7a84bc91
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 41 additions and 0 deletions

10
Docker/Dockerfile Normal file
View file

@ -0,0 +1,10 @@
FROM mono:6.12.0
COPY start-latest.sh /opt/start-latest.sh
RUN apt-get update && \
apt-get install -y jq && \
mkdir /opt/data && \
chmod +x /opt/start-latest.sh
ENTRYPOINT ["/bin/sh", "-c", "/opt/start-latest.sh"]

12
Docker/start-latest.sh Normal file
View file

@ -0,0 +1,12 @@
#!/bin/sh
cd /opt/data || exit 1
# Get latest Job ID
JOB_ID=$(curl -L https://ci.appveyor.com/api/projects/ORelio/minecraft-console-client | jq -r .build.jobs[0].jobId)
# Download latest version
curl -L https://ci.appveyor.com/api/buildjobs/"$JOB_ID"/artifacts/MinecraftClient%2Fbin%2FRelease%2FMinecraftClient.exe --output MinecraftClient.exe
# Start Client
mono MinecraftClient.exe