From 9560903c800065e1925f18bee41b6680d6f2fa06 Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Sun, 26 Jan 2020 16:57:14 -0600 Subject: [PATCH 1/9] Replaced mcstatus with mc-monitor, so removed python --- Dockerfile | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index 8d900364..5e3ea3e6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,12 +15,9 @@ RUN apk add --no-cache -U \ mysql-client \ tzdata \ rsync \ - nano \ - python python-dev py2-pip + nano -RUN pip install mcstatus yq - -HEALTHCHECK --start-period=1m CMD mcstatus localhost:$SERVER_PORT ping +HEALTHCHECK --start-period=1m CMD mc-monitor status --host localhost --port $SERVER_PORT RUN addgroup -g 1000 minecraft \ && adduser -Ss /bin/false -u 1000 -G minecraft -h /home/minecraft minecraft \ @@ -41,11 +38,13 @@ RUN easy-add --file restify --from https://github.com/itzg/restify/releases/down ARG RCON_CLI_VER=1.4.7 RUN easy-add --file rcon-cli --from https://github.com/itzg/rcon-cli/releases/download/${RCON_CLI_VER}/rcon-cli_${RCON_CLI_VER}_linux_${ARCH}.tar.gz +ARG MC_MONITOR_VER=0.1.6 +RUN easy-add --file mc-monitor --from https://github.com/itzg/mc-monitor/releases/download/v${MC_MONITOR_VER}/mc-monitor_${MC_MONITOR_VER}_Linux_${ARCH}.tar.gz + ARG MC_RUN_VER=1.3.3 RUN easy-add --file mc-server-runner --from https://github.com/itzg/mc-server-runner/releases/download/${MC_RUN_VER}/mc-server-runner_${MC_RUN_VER}_linux_${ARCH}.tar.gz COPY mcadmin.jq /usr/share -RUN chmod +x /usr/local/bin/* VOLUME ["/data","/mods","/config"] COPY server.properties /tmp/server.properties From 8afb1651fdf5f7ef07b8e17840ac01d545d8b049 Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Mon, 27 Jan 2020 07:16:22 -0600 Subject: [PATCH 2/9] Added shim for mcstatus For #426 --- Dockerfile | 1 + mcstatus | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100755 mcstatus diff --git a/Dockerfile b/Dockerfile index 5e3ea3e6..44e79ffc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -45,6 +45,7 @@ ARG MC_RUN_VER=1.3.3 RUN easy-add --file mc-server-runner --from https://github.com/itzg/mc-server-runner/releases/download/${MC_RUN_VER}/mc-server-runner_${MC_RUN_VER}_linux_${ARCH}.tar.gz COPY mcadmin.jq /usr/share +COPY mcstatus /usr/local/bin VOLUME ["/data","/mods","/config"] COPY server.properties /tmp/server.properties diff --git a/mcstatus b/mcstatus new file mode 100755 index 00000000..7e712039 --- /dev/null +++ b/mcstatus @@ -0,0 +1,19 @@ +#!/bin/bash + +##### mcstatus shim for mc-monitor + +addr="$1" +cmd="$2" + +if [[ ${cmd} == "ping" ]]; then + IFS=':' + read -a parts <<< "${addr}" + if [[ ${#parts[*]} -gt 1 ]]; then + echo mc-monitor status --host ${parts[0]} --port ${parts[1]} + else + echo mc-monitor status --host ${parts[0]} + fi +else + echo "ERROR can only shim the 'ping' command" + exit 1 +fi \ No newline at end of file From c8380daee583264267c8b4570f75dc98b888994f Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Mon, 27 Jan 2020 08:30:54 -0600 Subject: [PATCH 3/9] Fixed mcstatus shim to actually call mc-monitor For #426 --- mcstatus | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mcstatus b/mcstatus index 7e712039..02bf395b 100755 --- a/mcstatus +++ b/mcstatus @@ -9,9 +9,9 @@ if [[ ${cmd} == "ping" ]]; then IFS=':' read -a parts <<< "${addr}" if [[ ${#parts[*]} -gt 1 ]]; then - echo mc-monitor status --host ${parts[0]} --port ${parts[1]} + exec mc-monitor status --host ${parts[0]} --port ${parts[1]} else - echo mc-monitor status --host ${parts[0]} + exec mc-monitor status --host ${parts[0]} fi else echo "ERROR can only shim the 'ping' command" From 30ba3a4b78f8df9fb2345a54b85d8591cddcb1ca Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Mon, 27 Jan 2020 14:24:09 -0600 Subject: [PATCH 4/9] Restored python temporarily until jq usage can replace it For #427 --- Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 44e79ffc..a2e6d5b0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,7 +15,8 @@ RUN apk add --no-cache -U \ mysql-client \ tzdata \ rsync \ - nano + nano \ + python python-dev py2-pip HEALTHCHECK --start-period=1m CMD mc-monitor status --host localhost --port $SERVER_PORT From 88ed017ca7cfe3bc6299c99ceddd5c3b5b9adb81 Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Wed, 29 Jan 2020 08:57:31 -0600 Subject: [PATCH 5/9] Simplified mcstatus shim to allow for any command Fixes #426 --- mcstatus | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/mcstatus b/mcstatus index 02bf395b..89c62d78 100755 --- a/mcstatus +++ b/mcstatus @@ -1,19 +1,16 @@ #!/bin/bash ##### mcstatus shim for mc-monitor +# handles translating calls to +# mcstatus (host:port) (command) +# where the actual command is ignore, but is typically ping or status addr="$1" -cmd="$2" -if [[ ${cmd} == "ping" ]]; then - IFS=':' - read -a parts <<< "${addr}" - if [[ ${#parts[*]} -gt 1 ]]; then - exec mc-monitor status --host ${parts[0]} --port ${parts[1]} - else - exec mc-monitor status --host ${parts[0]} - fi +IFS=':' +read -a parts <<< "${addr}" +if [[ ${#parts[*]} -gt 1 ]]; then + exec mc-monitor status --host ${parts[0]} --port ${parts[1]} else - echo "ERROR can only shim the 'ping' command" - exit 1 -fi \ No newline at end of file + exec mc-monitor status --host ${parts[0]} +fi From efd3427fc0add8b63f5846265ca1b55b604926dc Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Wed, 29 Jan 2020 18:02:19 -0600 Subject: [PATCH 6/9] Added back yq/xq pip package until full conversion can be done For #428 --- Dockerfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Dockerfile b/Dockerfile index a2e6d5b0..a4516d8a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,6 +18,8 @@ RUN apk add --no-cache -U \ nano \ python python-dev py2-pip +RUN pip install yq + HEALTHCHECK --start-period=1m CMD mc-monitor status --host localhost --port $SERVER_PORT RUN addgroup -g 1000 minecraft \ From c449a31b37242d42d53033aca7efb38cfb94d057 Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Thu, 30 Jan 2020 21:24:36 -0600 Subject: [PATCH 7/9] Removed the need for xq --- Dockerfile | 5 +++-- start-deployFabric | 3 +-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index a4516d8a..93892e1a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,8 +18,6 @@ RUN apk add --no-cache -U \ nano \ python python-dev py2-pip -RUN pip install yq - HEALTHCHECK --start-period=1m CMD mc-monitor status --host localhost --port $SERVER_PORT RUN addgroup -g 1000 minecraft \ @@ -47,6 +45,9 @@ RUN easy-add --file mc-monitor --from https://github.com/itzg/mc-monitor/release ARG MC_RUN_VER=1.3.3 RUN easy-add --file mc-server-runner --from https://github.com/itzg/mc-server-runner/releases/download/${MC_RUN_VER}/mc-server-runner_${MC_RUN_VER}_linux_${ARCH}.tar.gz +ARG MVN_META_REL_VER=0.1.0 +RUN easy-add --file maven-metadata-release --from https://github.com/itzg/maven-metadata-release/releases/download/v${MVN_META_REL_VER}/maven-metadata-release_${MVN_META_REL_VER}_linux_${ARCH}.tar.gz + COPY mcadmin.jq /usr/share COPY mcstatus /usr/local/bin diff --git a/start-deployFabric b/start-deployFabric index 13ace55b..ad6e1d7b 100644 --- a/start-deployFabric +++ b/start-deployFabric @@ -12,8 +12,7 @@ if [[ -z $FABRIC_INSTALLER && -z $FABRIC_INSTALLER_URL ]]; then echo "Checking Fabric version information." case $FABRICVERSION in LATEST) - curl -fsSL https://maven.fabricmc.net/net/fabricmc/fabric-installer/maven-metadata.xml | xq -c . > /tmp/fabric.json - FABRIC_VERSION=$(< /tmp/fabric.json jq -r ".metadata.versioning.release") + FABRIC_VERSION=$(maven-metadata-release https://maven.fabricmc.net/net/fabricmc/fabric-installer/maven-metadata.xml) ;; *) From 9d67dceff37c42ce75b124d10f8da8b124aab308 Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Thu, 30 Jan 2020 21:39:35 -0600 Subject: [PATCH 8/9] Removed the remaining use of python --- Dockerfile | 3 +-- start-minecraftFinalSetup | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 93892e1a..3196cd28 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,8 +15,7 @@ RUN apk add --no-cache -U \ mysql-client \ tzdata \ rsync \ - nano \ - python python-dev py2-pip + nano HEALTHCHECK --start-period=1m CMD mc-monitor status --host localhost --port $SERVER_PORT diff --git a/start-minecraftFinalSetup b/start-minecraftFinalSetup index 4d0df79e..5ab6fa2a 100644 --- a/start-minecraftFinalSetup +++ b/start-minecraftFinalSetup @@ -31,7 +31,7 @@ fi echo "Checking for JSON files." JSON_FILES=$(find . -maxdepth 1 -name '*.json') for j in $JSON_FILES; do - if [[ $(python -c "print open('$j').read().strip()==''") = True ]]; then + if [[ $(cat $j | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//') == "" ]]; then echo "Fixing JSON $j" echo '[]' > $j fi From 2ffc1641a08582d0e4bf5293899a7a27b45638e5 Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Sat, 1 Feb 2020 08:52:00 -0600 Subject: [PATCH 9/9] Added a git pull when docker-versions-create.sh starts with each branch --- docker-versions-create.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docker-versions-create.sh b/docker-versions-create.sh index da0fcff1..3c3ad353 100755 --- a/docker-versions-create.sh +++ b/docker-versions-create.sh @@ -47,6 +47,9 @@ for branch in "${branches_list[@]}"; do exit 1; } proceed='False' while [[ "$proceed" == "False" ]]; do + # Ensure local branch is aligned with remote since docker-versions-create may have been run elsewhere + git pull + if git merge -m 'Auto-merging via docker-versions-create' master; then proceed="True" echo "Branch $branch updated to current master successfully"