From 81e2e9124bd130f32855251003cc11c316003f19 Mon Sep 17 00:00:00 2001 From: Mitch Talmadge Date: Thu, 26 Nov 2020 22:58:35 -0700 Subject: [PATCH 01/43] Download & install ampinstmgr during image build --- AMPVersions.json | 11 ++++++++ Dockerfile | 46 +++++++++++++++++++++------------ entrypoint/main.sh | 4 --- entrypoint/update-ampinstmgr.sh | 40 ---------------------------- 4 files changed, 41 insertions(+), 60 deletions(-) create mode 100644 AMPVersions.json delete mode 100644 entrypoint/update-ampinstmgr.sh diff --git a/AMPVersions.json b/AMPVersions.json new file mode 100644 index 0000000..e3bd149 --- /dev/null +++ b/AMPVersions.json @@ -0,0 +1,11 @@ +{ + "InstanceManager": "2.0.6.0", + "InstanceManagerCLI": "2.0.8.6", + "AMPCoreMinimum": "2.0.0.0", + "AMPCore": "2.0.8.6", + "ReleaseNotes": "https://support.cubecoders.com/thread/amp-2-0-8-6-europa-release-notes/", + "ModuleVersions": { + "Minecraft": "1.0.0.3", + "SpaceEngineers": "1.0.0.2" + } +} \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 8b48d13..2b9d87e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,7 +9,7 @@ ENV LICENCE=notset ENV MODULE=ADS ARG DEBIAN_FRONTEND=noninteractive - +ARG AMPINSTMGR_VERSION=2.0.8.6 # Initialize RUN apt-get update && \ @@ -73,16 +73,31 @@ RUN wget -O /tmp/cacert.pem https://curl.haxx.se/ca/cacert.pem && \ cert-sync /tmp/cacert.pem -# Install dependencies for various game servers. +# Install AMP dependencies RUN ls -al /usr/local/bin/ RUN apt-get update && \ apt-get install -y \ + # -------------------- + # Dependencies for AMP: + tmux \ + git \ + socat \ + unzip \ + iputils-ping \ + procps \ + # -------------------- + # Dependencies for Minecraft: openjdk-8-jre-headless \ + # -------------------- + # Dependencies for srcds (TF2, GMod, ...) libcurl4 \ lib32gcc1 \ lib32stdc++6 \ lib32tinfo5 \ + # -------------------- + # Dependencies for Factorio: xz-utils && \ + # -------------------- apt-get -y clean && \ apt-get -y autoremove --purge && \ rm -rf \ @@ -90,16 +105,22 @@ RUN apt-get update && \ /var/lib/apt/lists/* \ /var/tmp/* - # Manually install AMP (Docker doesn't have systemctl and other things that AMP's deb postinst expects). RUN apt-get update && \ apt-get install -y --no-install-recommends \ - tmux \ - git \ - socat \ - unzip \ - iputils-ping \ - procps && \ + software-properties-common \ + dirmngr \ + apt-transport-https && \ + # Add CubeCoders repository and key + apt-key adv --fetch-keys http://repo.cubecoders.com/archive.key && \ + apt-add-repository "deb http://repo.cubecoders.com/ debian/" && \ + apt-get update && \ + # Just download (don't actually install) ampinstmgr + apt-get install -y --no-install-recommends --download-only ampinstmgr && \ + # Extract ampinstmgr from downloaded package + mkdir -p /tmp/ampinstmgr && \ + dpkg-dev -x /var/cache/apt/archives/ampinstmgr-*.deb /tmp/ampinstmgr && \ + mv /tmp/ampinstmgr/opt/cubecoders/amp/ampinstmgr /usr/local/bin/ampinstmgr && \ apt-get -y clean && \ apt-get -y autoremove --purge && \ rm -rf \ @@ -107,13 +128,6 @@ RUN apt-get update && \ /var/lib/apt/lists/* \ /var/tmp/* - -# Create ampinstmgr install directory. -# ampinstmgr will be downloaded later when the image is started for the first time. -RUN mkdir -p /home/amp/.ampdata/.bin && \ - ln -s /home/amp/.ampdata/.bin/ampinstmgr /usr/local/bin/ampinstmgr - - # Set up environment COPY entrypoint /opt/entrypoint RUN chmod -R +x /opt/entrypoint diff --git a/entrypoint/main.sh b/entrypoint/main.sh index 9f0de10..70780f4 100644 --- a/entrypoint/main.sh +++ b/entrypoint/main.sh @@ -43,10 +43,6 @@ if [ ${LICENCE} = "notset" ]; then exit 1 fi -# Update the instance manager. -echo "Checking for ampinstmgr updates..." -/bin/bash /opt/entrypoint/update-ampinstmgr.sh - # Create Main Instance if not exists echo "Making sure Main instance exists..." if [ ! $(su ${APP_USER} --command "ampinstmgr ShowInstancesList" | grep "Instance Name" | awk '{ print $4 }' | grep "Main") ]; then diff --git a/entrypoint/update-ampinstmgr.sh b/entrypoint/update-ampinstmgr.sh deleted file mode 100644 index a6f9241..0000000 --- a/entrypoint/update-ampinstmgr.sh +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/bash -e -set +o xtrace - -# Migrate bin dir -AMP_BIN_DIR=/home/amp/.ampdata/.bin -OLD_AMP_BIN_DIR=/home/amp/.ampdata/bin -mkdir -p ${AMP_BIN_DIR} -if [ -d ${OLD_AMP_BIN_DIR} ]; then - if [ ! -z "$(ls -A ${OLD_AMP_BIN_DIR})" ]; then - mv ${OLD_AMP_BIN_DIR}/* ${AMP_BIN_DIR} - fi - rm -r ${OLD_AMP_BIN_DIR} -fi - -CURRENT_VERSION_FILE=/home/amp/.ampdata/ampinstmgr-version.txt -VERSIONS_PATH=/tmp/AMPVersions.json - -wget -nv https://cubecoders.com/AMPVersions.json -O ${VERSIONS_PATH} -HEAD_VERSION=$(cat ${VERSIONS_PATH} | jq -r '.InstanceManagerCLI') -rm -irf ${VERSIONS_PATH} -echo "> Latest Version: ${HEAD_VERSION}" - -if [ -f ${CURRENT_VERSION_FILE} ]; then - CURRENT_VERSION=$(cat ${CURRENT_VERSION_FILE}) - echo "> Current Version: ${CURRENT_VERSION}" - if [ "${HEAD_VERSION}" = "${CURRENT_VERSION}" ]; then - echo "No updates needed." - exit - fi -else - echo "> Current Version: Unknown" -fi - -echo "Downloading latest ampinstmgr... (This can take ~5 minutes; CubeCoders limits their download speeds to a crawl.)" -wget -nv -c -P ${AMP_BIN_DIR}/ http://cubecoders.com/Downloads/ampinstmgr.zip -echo "Download complete. Updating ampinstmgr..." -unzip -o ${AMP_BIN_DIR}/ampinstmgr.zip -d ${AMP_BIN_DIR}/ -rm -rf ${AMP_BIN_DIR}/ampinstmgr.zip -echo ${HEAD_VERSION} >${CURRENT_VERSION_FILE} -echo "Update complete." From aebf3b95992c78e539be13df33ae290244fcba40 Mon Sep 17 00:00:00 2001 From: Mitch Talmadge Date: Thu, 26 Nov 2020 23:04:40 -0700 Subject: [PATCH 02/43] Fix a typo --- Dockerfile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 2b9d87e..097de54 100644 --- a/Dockerfile +++ b/Dockerfile @@ -96,8 +96,9 @@ RUN apt-get update && \ lib32tinfo5 \ # -------------------- # Dependencies for Factorio: - xz-utils && \ + xz-utils \ # -------------------- + && \ apt-get -y clean && \ apt-get -y autoremove --purge && \ rm -rf \ @@ -119,7 +120,7 @@ RUN apt-get update && \ apt-get install -y --no-install-recommends --download-only ampinstmgr && \ # Extract ampinstmgr from downloaded package mkdir -p /tmp/ampinstmgr && \ - dpkg-dev -x /var/cache/apt/archives/ampinstmgr-*.deb /tmp/ampinstmgr && \ + dpkg-deb -x /var/cache/apt/archives/ampinstmgr-*.deb /tmp/ampinstmgr && \ mv /tmp/ampinstmgr/opt/cubecoders/amp/ampinstmgr /usr/local/bin/ampinstmgr && \ apt-get -y clean && \ apt-get -y autoremove --purge && \ From fd7769c1662e20d79368fe5f0e4ddcf3777af683 Mon Sep 17 00:00:00 2001 From: Mitch Talmadge Date: Fri, 27 Nov 2020 00:33:24 -0700 Subject: [PATCH 03/43] Fix incorrect deb file path. --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 097de54..2c0ae6e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -120,7 +120,7 @@ RUN apt-get update && \ apt-get install -y --no-install-recommends --download-only ampinstmgr && \ # Extract ampinstmgr from downloaded package mkdir -p /tmp/ampinstmgr && \ - dpkg-deb -x /var/cache/apt/archives/ampinstmgr-*.deb /tmp/ampinstmgr && \ + dpkg-deb -x /var/cache/apt/archives/ampinstmgr_*.deb /tmp/ampinstmgr && \ mv /tmp/ampinstmgr/opt/cubecoders/amp/ampinstmgr /usr/local/bin/ampinstmgr && \ apt-get -y clean && \ apt-get -y autoremove --purge && \ From f482ac62c56fd9e2b1ed4f385987a47c5fc8cb3a Mon Sep 17 00:00:00 2001 From: Mitch Talmadge Date: Fri, 27 Nov 2020 01:36:48 -0700 Subject: [PATCH 04/43] Download AMP Core on build --- Dockerfile | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 2c0ae6e..3ded584 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,12 +9,12 @@ ENV LICENCE=notset ENV MODULE=ADS ARG DEBIAN_FRONTEND=noninteractive -ARG AMPINSTMGR_VERSION=2.0.8.6 # Initialize RUN apt-get update && \ apt-get install -y --no-install-recommends \ jq \ + sed \ wget && \ apt-get -y clean && \ apt-get -y autoremove --purge && \ @@ -106,7 +106,9 @@ RUN apt-get update && \ /var/lib/apt/lists/* \ /var/tmp/* -# Manually install AMP (Docker doesn't have systemctl and other things that AMP's deb postinst expects). +# Manually install ampinstmgr by extracting it from the deb package. +# Docker doesn't have systemctl and other things that AMP's deb postinst expects, +# so we can't use apt to install ampinstmgr. RUN apt-get update && \ apt-get install -y --no-install-recommends \ software-properties-common \ @@ -129,6 +131,10 @@ RUN apt-get update && \ /var/lib/apt/lists/* \ /var/tmp/* +# Get the latest AMP Core to pre-cache upgrades. +RUN wget https://cubecoders.com/AMPVersions.json -O /tmp/AMPVersions.json && \ + wget https://cubecoders.com/Downloads/AMP_Latest.zip -O /opt/AMPCache-$(cat /tmp/AMPVersions.json | jq -r '.AMPCore' | sed -e 's/\.//g').zip + # Set up environment COPY entrypoint /opt/entrypoint RUN chmod -R +x /opt/entrypoint From 009ae68d0fdb2fca915ed54eb2f457ae3e348d09 Mon Sep 17 00:00:00 2001 From: Mitch Talmadge Date: Fri, 27 Nov 2020 01:54:00 -0700 Subject: [PATCH 05/43] Copy cached AMP Core at runtime --- entrypoint/main.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/entrypoint/main.sh b/entrypoint/main.sh index 70780f4..8d8ed76 100644 --- a/entrypoint/main.sh +++ b/entrypoint/main.sh @@ -43,6 +43,12 @@ if [ ${LICENCE} = "notset" ]; then exit 1 fi +# Copy the pre-cached AMP Core from the image into the location AMP expects. +# This will allow upgrades to use the cache and not need to do any downloads. +echo "Copying AMP Core..." +mkdir -p /home/amp/.ampdata/instances/ +cp /opt/AMPCache* /home/amp/.ampdata/instances/ + # Create Main Instance if not exists echo "Making sure Main instance exists..." if [ ! $(su ${APP_USER} --command "ampinstmgr ShowInstancesList" | grep "Instance Name" | awk '{ print $4 }' | grep "Main") ]; then From f4bcc8c253ba666cd47aa72c41f5ff1802a17492 Mon Sep 17 00:00:00 2001 From: Mitch Talmadge Date: Fri, 27 Nov 2020 02:30:04 -0700 Subject: [PATCH 06/43] Change echo --- entrypoint/main.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entrypoint/main.sh b/entrypoint/main.sh index 8d8ed76..c694aa7 100644 --- a/entrypoint/main.sh +++ b/entrypoint/main.sh @@ -74,7 +74,7 @@ else fi # Upgrade instances -echo "Upgrading Instances... (This can take a while)" +echo "Upgrading Instances..." su ${APP_USER} --command "ampinstmgr UpgradeAll" | grep --line-buffered -v -E '\[[-#]+\]' # Set Main instance to start on boot if not already. From 0fbf432c15aa6fdfa70869809ff30eb14738ce4c Mon Sep 17 00:00:00 2001 From: Mitch Talmadge Date: Fri, 27 Nov 2020 16:29:16 -0700 Subject: [PATCH 07/43] Implement test version of auto deploy CI --- .github/workflows/auto-deploy.yml | 48 +++++++++++++++++++ .../workflows/data/AMPVersions.json | 0 .github/workflows/{main.yml => test.yml} | 2 +- .gitignore | 3 +- 4 files changed, 50 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/auto-deploy.yml rename AMPVersions.json => .github/workflows/data/AMPVersions.json (100%) rename .github/workflows/{main.yml => test.yml} (94%) diff --git a/.github/workflows/auto-deploy.yml b/.github/workflows/auto-deploy.yml new file mode 100644 index 0000000..ad32016 --- /dev/null +++ b/.github/workflows/auto-deploy.yml @@ -0,0 +1,48 @@ +name: Auto Deploy + +on: + workflow_dispatch: + schedule: + - cron: "0 21 * * *" # Every day at 2 PM MST (Releases tend to show up sometime around noon) + +jobs: + check-for-updates: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Install Dependencies + run: sudo apt-get install -y --no-install-recommends wget jq + + - name: Download AMP Versions + run: wget https://cubecoders.com/AMPVersions.json -O .github/workflows/data/AMPVersions.json + + - name: Compute Tag + run: | + echo "LATEST_RELEASE_VERSION=$(git tag -l --sort=-refname | grep '^[0-9]$' -m 1)" >> $GITHUB_ENV + echo "AMP_CORE_VERSION=$(jq -r '.AMPCore' .github/workflows/data/AMPVersions.json | sed -e 's/\.//g')" >> $GITHUB_ENV + echo "AMP_INST_MGR_VERSION=$(jq -r '.InstanceManagerCLI' .github/workflows/data/AMPVersions.json | sed -e 's/\.//g')" >> $GITHUB_ENV + echo "NEW_TAG=$LATEST_RELEASE_VERSION-ampcore$AMP_CORE_VERSION-ampinstmgr$AMP_INST_MGR_VERSION" >> $GITHUB_ENV + + - name: Compare and Tag + run: | + git diff-index --quiet HEAD -- && exit + git config user.name github-actions + git config user.email github-actions@github.com + git add . + git tag -a $NEW_TAG -m "Auto-Deploy Latest AMP Version" + + # git push + + # - name: Compare AMP Versions + # # Gracefully exit if the versions are not different. (The "are different" case flows through to the next rule). + # run: | + # ( \ + # test $(jq -r ".AMPCore" .github/workflows/data/AMPVersions.json) != $(jq -r ".AMPCore" /tmp/AMPVersions.json) || \ + # test $(jq -r ".InstanceManagerCLI" .github/workflows/data/AMPVersions.json) != $(jq -r ".InstanceManagerCLI" /tmp/AMPVersions.json) \ + # ) || exit + + - name: Tag New Release + run: | + mv /tmp/AMPVersions.json .github/workflows/data/AMPVersions.json + \ No newline at end of file diff --git a/AMPVersions.json b/.github/workflows/data/AMPVersions.json similarity index 100% rename from AMPVersions.json rename to .github/workflows/data/AMPVersions.json diff --git a/.github/workflows/main.yml b/.github/workflows/test.yml similarity index 94% rename from .github/workflows/main.yml rename to .github/workflows/test.yml index 0791fc3..83e846f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/test.yml @@ -1,4 +1,4 @@ -name: CI +name: Test on: [push, pull_request] diff --git a/.gitignore b/.gitignore index 2bec83e..ad5002f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,5 @@ .idea .vscode *.iml -data* docker-compose.yml -test \ No newline at end of file +test From 343d305fe083b71714861bd4c6dc55166c057968 Mon Sep 17 00:00:00 2001 From: Mitch Talmadge Date: Fri, 27 Nov 2020 16:34:00 -0700 Subject: [PATCH 08/43] Rename workflow, add debug trigger --- .github/workflows/{auto-deploy.yml => auto-release.yml} | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) rename .github/workflows/{auto-deploy.yml => auto-release.yml} (95%) diff --git a/.github/workflows/auto-deploy.yml b/.github/workflows/auto-release.yml similarity index 95% rename from .github/workflows/auto-deploy.yml rename to .github/workflows/auto-release.yml index ad32016..e1f708c 100644 --- a/.github/workflows/auto-deploy.yml +++ b/.github/workflows/auto-release.yml @@ -1,6 +1,7 @@ -name: Auto Deploy +name: Auto Release on: + push: workflow_dispatch: schedule: - cron: "0 21 * * *" # Every day at 2 PM MST (Releases tend to show up sometime around noon) @@ -30,7 +31,7 @@ jobs: git config user.name github-actions git config user.email github-actions@github.com git add . - git tag -a $NEW_TAG -m "Auto-Deploy Latest AMP Version" + git tag -a $NEW_TAG -m "Auto-Release Latest AMP Version" # git push From 1dfd46292c69947bce2ceb16da21356256c05569 Mon Sep 17 00:00:00 2001 From: Mitch Talmadge Date: Fri, 27 Nov 2020 16:43:02 -0700 Subject: [PATCH 09/43] Hopefully fix variable usage --- .github/workflows/auto-release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/auto-release.yml b/.github/workflows/auto-release.yml index e1f708c..bcc29eb 100644 --- a/.github/workflows/auto-release.yml +++ b/.github/workflows/auto-release.yml @@ -23,7 +23,7 @@ jobs: echo "LATEST_RELEASE_VERSION=$(git tag -l --sort=-refname | grep '^[0-9]$' -m 1)" >> $GITHUB_ENV echo "AMP_CORE_VERSION=$(jq -r '.AMPCore' .github/workflows/data/AMPVersions.json | sed -e 's/\.//g')" >> $GITHUB_ENV echo "AMP_INST_MGR_VERSION=$(jq -r '.InstanceManagerCLI' .github/workflows/data/AMPVersions.json | sed -e 's/\.//g')" >> $GITHUB_ENV - echo "NEW_TAG=$LATEST_RELEASE_VERSION-ampcore$AMP_CORE_VERSION-ampinstmgr$AMP_INST_MGR_VERSION" >> $GITHUB_ENV + echo "NEW_TAG=${LATEST_RELEASE_VERSION}-ampcore${AMP_CORE_VERSION}-ampinstmgr${AMP_INST_MGR_VERSION}" >> $GITHUB_ENV - name: Compare and Tag run: | @@ -31,7 +31,7 @@ jobs: git config user.name github-actions git config user.email github-actions@github.com git add . - git tag -a $NEW_TAG -m "Auto-Release Latest AMP Version" + git tag -m "Auto-Release Latest AMP Version" -a $NEW_TAG # git push From 71095fcd3b8a8e6885efbc66767af3229a3a51db Mon Sep 17 00:00:00 2001 From: Mitch Talmadge Date: Fri, 27 Nov 2020 16:45:33 -0700 Subject: [PATCH 10/43] Change where tag is defined --- .github/workflows/auto-release.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/auto-release.yml b/.github/workflows/auto-release.yml index bcc29eb..3234163 100644 --- a/.github/workflows/auto-release.yml +++ b/.github/workflows/auto-release.yml @@ -18,12 +18,11 @@ jobs: - name: Download AMP Versions run: wget https://cubecoders.com/AMPVersions.json -O .github/workflows/data/AMPVersions.json - - name: Compute Tag + - name: Parse Versions run: | echo "LATEST_RELEASE_VERSION=$(git tag -l --sort=-refname | grep '^[0-9]$' -m 1)" >> $GITHUB_ENV echo "AMP_CORE_VERSION=$(jq -r '.AMPCore' .github/workflows/data/AMPVersions.json | sed -e 's/\.//g')" >> $GITHUB_ENV echo "AMP_INST_MGR_VERSION=$(jq -r '.InstanceManagerCLI' .github/workflows/data/AMPVersions.json | sed -e 's/\.//g')" >> $GITHUB_ENV - echo "NEW_TAG=${LATEST_RELEASE_VERSION}-ampcore${AMP_CORE_VERSION}-ampinstmgr${AMP_INST_MGR_VERSION}" >> $GITHUB_ENV - name: Compare and Tag run: | @@ -31,7 +30,7 @@ jobs: git config user.name github-actions git config user.email github-actions@github.com git add . - git tag -m "Auto-Release Latest AMP Version" -a $NEW_TAG + git tag -m "Auto-Release Latest AMP Version" -a "$LATEST_RELEASE_VERSION-ampcore$AMP_CORE_VERSION-ampinstmgr$AMP_INST_MGR_VERSION" # git push From dcfb2e5168e7c3bee88d6561a077f4314ef87e23 Mon Sep 17 00:00:00 2001 From: Mitch Talmadge Date: Fri, 27 Nov 2020 16:49:22 -0700 Subject: [PATCH 11/43] Add debug print --- .github/workflows/auto-release.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/auto-release.yml b/.github/workflows/auto-release.yml index 3234163..2d16c05 100644 --- a/.github/workflows/auto-release.yml +++ b/.github/workflows/auto-release.yml @@ -20,6 +20,7 @@ jobs: - name: Parse Versions run: | + echo $(git tag -l --sort=-refname) echo "LATEST_RELEASE_VERSION=$(git tag -l --sort=-refname | grep '^[0-9]$' -m 1)" >> $GITHUB_ENV echo "AMP_CORE_VERSION=$(jq -r '.AMPCore' .github/workflows/data/AMPVersions.json | sed -e 's/\.//g')" >> $GITHUB_ENV echo "AMP_INST_MGR_VERSION=$(jq -r '.InstanceManagerCLI' .github/workflows/data/AMPVersions.json | sed -e 's/\.//g')" >> $GITHUB_ENV @@ -30,7 +31,7 @@ jobs: git config user.name github-actions git config user.email github-actions@github.com git add . - git tag -m "Auto-Release Latest AMP Version" -a "$LATEST_RELEASE_VERSION-ampcore$AMP_CORE_VERSION-ampinstmgr$AMP_INST_MGR_VERSION" + git tag -a "$LATEST_RELEASE_VERSION-ampcore$AMP_CORE_VERSION-ampinstmgr$AMP_INST_MGR_VERSION" -m "Auto-Release Latest AMP Version" # git push From bdc709e98f984818962434fc10dab6263cf0f9a4 Mon Sep 17 00:00:00 2001 From: Mitch Talmadge Date: Fri, 27 Nov 2020 16:52:31 -0700 Subject: [PATCH 12/43] Debug more --- .github/workflows/auto-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/auto-release.yml b/.github/workflows/auto-release.yml index 2d16c05..796eeeb 100644 --- a/.github/workflows/auto-release.yml +++ b/.github/workflows/auto-release.yml @@ -20,7 +20,7 @@ jobs: - name: Parse Versions run: | - echo $(git tag -l --sort=-refname) + echo "Releases: $(git tag -l --sort=-refname)" echo "LATEST_RELEASE_VERSION=$(git tag -l --sort=-refname | grep '^[0-9]$' -m 1)" >> $GITHUB_ENV echo "AMP_CORE_VERSION=$(jq -r '.AMPCore' .github/workflows/data/AMPVersions.json | sed -e 's/\.//g')" >> $GITHUB_ENV echo "AMP_INST_MGR_VERSION=$(jq -r '.InstanceManagerCLI' .github/workflows/data/AMPVersions.json | sed -e 's/\.//g')" >> $GITHUB_ENV From d704ead11fbdc8a86f56845fcf7542e2fdb4533a Mon Sep 17 00:00:00 2001 From: Mitch Talmadge Date: Fri, 27 Nov 2020 16:55:45 -0700 Subject: [PATCH 13/43] Set fetch depth to 0 --- .github/workflows/auto-release.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/auto-release.yml b/.github/workflows/auto-release.yml index 796eeeb..61741b7 100644 --- a/.github/workflows/auto-release.yml +++ b/.github/workflows/auto-release.yml @@ -10,7 +10,10 @@ jobs: check-for-updates: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 - name: Install Dependencies run: sudo apt-get install -y --no-install-recommends wget jq From 76bb725a32fc032dd506449693e9580f53048813 Mon Sep 17 00:00:00 2001 From: Mitch Talmadge Date: Fri, 27 Nov 2020 16:59:18 -0700 Subject: [PATCH 14/43] Remove forgotten step --- .github/workflows/auto-release.yml | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/.github/workflows/auto-release.yml b/.github/workflows/auto-release.yml index 61741b7..c486e1e 100644 --- a/.github/workflows/auto-release.yml +++ b/.github/workflows/auto-release.yml @@ -39,14 +39,9 @@ jobs: # git push # - name: Compare AMP Versions - # # Gracefully exit if the versions are not different. (The "are different" case flows through to the next rule). + # # Gracefully exit if the versions are not different. (The "are different" case flows through to the next step). # run: | # ( \ # test $(jq -r ".AMPCore" .github/workflows/data/AMPVersions.json) != $(jq -r ".AMPCore" /tmp/AMPVersions.json) || \ # test $(jq -r ".InstanceManagerCLI" .github/workflows/data/AMPVersions.json) != $(jq -r ".InstanceManagerCLI" /tmp/AMPVersions.json) \ - # ) || exit - - - name: Tag New Release - run: | - mv /tmp/AMPVersions.json .github/workflows/data/AMPVersions.json - \ No newline at end of file + # ) || exit \ No newline at end of file From a6aad5198df0af203c787fc561cf1050b90150f9 Mon Sep 17 00:00:00 2001 From: Mitch Talmadge Date: Fri, 27 Nov 2020 17:05:52 -0700 Subject: [PATCH 15/43] Move debug statement --- .github/workflows/auto-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/auto-release.yml b/.github/workflows/auto-release.yml index c486e1e..c0664e2 100644 --- a/.github/workflows/auto-release.yml +++ b/.github/workflows/auto-release.yml @@ -23,7 +23,6 @@ jobs: - name: Parse Versions run: | - echo "Releases: $(git tag -l --sort=-refname)" echo "LATEST_RELEASE_VERSION=$(git tag -l --sort=-refname | grep '^[0-9]$' -m 1)" >> $GITHUB_ENV echo "AMP_CORE_VERSION=$(jq -r '.AMPCore' .github/workflows/data/AMPVersions.json | sed -e 's/\.//g')" >> $GITHUB_ENV echo "AMP_INST_MGR_VERSION=$(jq -r '.InstanceManagerCLI' .github/workflows/data/AMPVersions.json | sed -e 's/\.//g')" >> $GITHUB_ENV @@ -35,6 +34,7 @@ jobs: git config user.email github-actions@github.com git add . git tag -a "$LATEST_RELEASE_VERSION-ampcore$AMP_CORE_VERSION-ampinstmgr$AMP_INST_MGR_VERSION" -m "Auto-Release Latest AMP Version" + echo "Releases: $(git tag -l --sort=-refname)" # git push From 072fcfd0ffb5049b8272b57f58c4476c6d594ffe Mon Sep 17 00:00:00 2001 From: Mitch Talmadge Date: Fri, 27 Nov 2020 17:16:09 -0700 Subject: [PATCH 16/43] Update AMPVersions.json. Remove debug statement. --- .github/workflows/auto-release.yml | 1 - .github/workflows/data/AMPVersions.json | 20 ++++++++++---------- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/.github/workflows/auto-release.yml b/.github/workflows/auto-release.yml index c0664e2..40e695e 100644 --- a/.github/workflows/auto-release.yml +++ b/.github/workflows/auto-release.yml @@ -34,7 +34,6 @@ jobs: git config user.email github-actions@github.com git add . git tag -a "$LATEST_RELEASE_VERSION-ampcore$AMP_CORE_VERSION-ampinstmgr$AMP_INST_MGR_VERSION" -m "Auto-Release Latest AMP Version" - echo "Releases: $(git tag -l --sort=-refname)" # git push diff --git a/.github/workflows/data/AMPVersions.json b/.github/workflows/data/AMPVersions.json index e3bd149..c960cb4 100644 --- a/.github/workflows/data/AMPVersions.json +++ b/.github/workflows/data/AMPVersions.json @@ -1,11 +1,11 @@ -{ - "InstanceManager": "2.0.6.0", - "InstanceManagerCLI": "2.0.8.6", - "AMPCoreMinimum": "2.0.0.0", - "AMPCore": "2.0.8.6", - "ReleaseNotes": "https://support.cubecoders.com/thread/amp-2-0-8-6-europa-release-notes/", - "ModuleVersions": { - "Minecraft": "1.0.0.3", - "SpaceEngineers": "1.0.0.2" - } +{ + "InstanceManager": "2.0.6.0", + "InstanceManagerCLI": "2.0.8.6", + "AMPCoreMinimum": "2.0.0.0", + "AMPCore": "2.0.8.6", + "ReleaseNotes": "https://support.cubecoders.com/thread/amp-2-0-8-6-europa-release-notes/", + "ModuleVersions": { + "Minecraft": "1.0.0.3", + "SpaceEngineers": "1.0.0.2" + } } \ No newline at end of file From 83e8bbeecd6abfe91467cef73f8a0d902a710fd5 Mon Sep 17 00:00:00 2001 From: Mitch Talmadge Date: Fri, 27 Nov 2020 17:20:16 -0700 Subject: [PATCH 17/43] Add exit message on already up-to-date check --- .github/workflows/auto-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/auto-release.yml b/.github/workflows/auto-release.yml index 40e695e..e380261 100644 --- a/.github/workflows/auto-release.yml +++ b/.github/workflows/auto-release.yml @@ -29,7 +29,7 @@ jobs: - name: Compare and Tag run: | - git diff-index --quiet HEAD -- && exit + git diff-index --quiet HEAD -- && {echo "Already up-to-date"; exit} git config user.name github-actions git config user.email github-actions@github.com git add . From 841e862f95e46ee17edb5cd71c5a6d7aa33a6ca8 Mon Sep 17 00:00:00 2001 From: Mitch Talmadge Date: Fri, 27 Nov 2020 17:21:44 -0700 Subject: [PATCH 18/43] Fix bash syntax --- .github/workflows/auto-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/auto-release.yml b/.github/workflows/auto-release.yml index e380261..1b62eb6 100644 --- a/.github/workflows/auto-release.yml +++ b/.github/workflows/auto-release.yml @@ -29,7 +29,7 @@ jobs: - name: Compare and Tag run: | - git diff-index --quiet HEAD -- && {echo "Already up-to-date"; exit} + git diff-index --quiet HEAD -- && { echo "Already up-to-date"; exit; } git config user.name github-actions git config user.email github-actions@github.com git add . From ea9fb3ebf6495367c9d09ce116e5950b91b016a3 Mon Sep 17 00:00:00 2001 From: Mitch Talmadge Date: Fri, 27 Nov 2020 17:25:58 -0700 Subject: [PATCH 19/43] Add debug line --- .github/workflows/auto-release.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/auto-release.yml b/.github/workflows/auto-release.yml index 1b62eb6..f4a58ad 100644 --- a/.github/workflows/auto-release.yml +++ b/.github/workflows/auto-release.yml @@ -30,6 +30,7 @@ jobs: - name: Compare and Tag run: | git diff-index --quiet HEAD -- && { echo "Already up-to-date"; exit; } + git --no-pager diff git config user.name github-actions git config user.email github-actions@github.com git add . From b631c2b07ac69fbb8153798c10e72f855893643c Mon Sep 17 00:00:00 2001 From: Mitch Talmadge Date: Fri, 27 Nov 2020 17:29:37 -0700 Subject: [PATCH 20/43] Update versions --- .github/workflows/data/AMPVersions.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/data/AMPVersions.json b/.github/workflows/data/AMPVersions.json index c960cb4..bca07e7 100644 --- a/.github/workflows/data/AMPVersions.json +++ b/.github/workflows/data/AMPVersions.json @@ -1,4 +1,4 @@ -{ +{ "InstanceManager": "2.0.6.0", "InstanceManagerCLI": "2.0.8.6", "AMPCoreMinimum": "2.0.0.0", From caf4b2b569945dad745b6169b5d9ab5cd3ed7e86 Mon Sep 17 00:00:00 2001 From: Mitch Talmadge Date: Fri, 27 Nov 2020 17:32:22 -0700 Subject: [PATCH 21/43] Allow push --- .github/workflows/auto-release.yml | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/.github/workflows/auto-release.yml b/.github/workflows/auto-release.yml index f4a58ad..a594721 100644 --- a/.github/workflows/auto-release.yml +++ b/.github/workflows/auto-release.yml @@ -35,13 +35,4 @@ jobs: git config user.email github-actions@github.com git add . git tag -a "$LATEST_RELEASE_VERSION-ampcore$AMP_CORE_VERSION-ampinstmgr$AMP_INST_MGR_VERSION" -m "Auto-Release Latest AMP Version" - - # git push - - # - name: Compare AMP Versions - # # Gracefully exit if the versions are not different. (The "are different" case flows through to the next step). - # run: | - # ( \ - # test $(jq -r ".AMPCore" .github/workflows/data/AMPVersions.json) != $(jq -r ".AMPCore" /tmp/AMPVersions.json) || \ - # test $(jq -r ".InstanceManagerCLI" .github/workflows/data/AMPVersions.json) != $(jq -r ".InstanceManagerCLI" /tmp/AMPVersions.json) \ - # ) || exit \ No newline at end of file + git push \ No newline at end of file From 0740f29f6c469daa08bcdb43b6490d1a07ec5f94 Mon Sep 17 00:00:00 2001 From: Mitch Talmadge Date: Fri, 27 Nov 2020 17:33:57 -0700 Subject: [PATCH 22/43] Push with tags --- .github/workflows/auto-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/auto-release.yml b/.github/workflows/auto-release.yml index a594721..332ca33 100644 --- a/.github/workflows/auto-release.yml +++ b/.github/workflows/auto-release.yml @@ -35,4 +35,4 @@ jobs: git config user.email github-actions@github.com git add . git tag -a "$LATEST_RELEASE_VERSION-ampcore$AMP_CORE_VERSION-ampinstmgr$AMP_INST_MGR_VERSION" -m "Auto-Release Latest AMP Version" - git push \ No newline at end of file + git push --follow-tags \ No newline at end of file From 81cd14a4bb27f6b6a2e42210a32ecbf526d1db7a Mon Sep 17 00:00:00 2001 From: Mitch Talmadge Date: Fri, 27 Nov 2020 17:37:57 -0700 Subject: [PATCH 23/43] Add commit when releasing --- .github/workflows/auto-release.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/auto-release.yml b/.github/workflows/auto-release.yml index 332ca33..6b375dd 100644 --- a/.github/workflows/auto-release.yml +++ b/.github/workflows/auto-release.yml @@ -34,5 +34,6 @@ jobs: git config user.name github-actions git config user.email github-actions@github.com git add . - git tag -a "$LATEST_RELEASE_VERSION-ampcore$AMP_CORE_VERSION-ampinstmgr$AMP_INST_MGR_VERSION" -m "Auto-Release Latest AMP Version" + git commit -am "Auto Update AMP Versions" + git tag -a "$LATEST_RELEASE_VERSION-ampcore$AMP_CORE_VERSION-ampinstmgr$AMP_INST_MGR_VERSION" -m "Auto Release Latest AMP Version" git push --follow-tags \ No newline at end of file From 50175f6ffc058872da6f01cae0238f9b5fe26169 Mon Sep 17 00:00:00 2001 From: Mitch Talmadge Date: Fri, 27 Nov 2020 17:45:33 -0700 Subject: [PATCH 24/43] Change AMPVersions.json location --- .github/workflows/auto-release.yml | 6 +++--- .github/workflows/data/AMPVersions.json => AMPVersions.json | 0 2 files changed, 3 insertions(+), 3 deletions(-) rename .github/workflows/data/AMPVersions.json => AMPVersions.json (100%) diff --git a/.github/workflows/auto-release.yml b/.github/workflows/auto-release.yml index 6b375dd..1b72298 100644 --- a/.github/workflows/auto-release.yml +++ b/.github/workflows/auto-release.yml @@ -19,13 +19,13 @@ jobs: run: sudo apt-get install -y --no-install-recommends wget jq - name: Download AMP Versions - run: wget https://cubecoders.com/AMPVersions.json -O .github/workflows/data/AMPVersions.json + run: wget https://cubecoders.com/AMPVersions.json -O AMPVersions.json - name: Parse Versions run: | echo "LATEST_RELEASE_VERSION=$(git tag -l --sort=-refname | grep '^[0-9]$' -m 1)" >> $GITHUB_ENV - echo "AMP_CORE_VERSION=$(jq -r '.AMPCore' .github/workflows/data/AMPVersions.json | sed -e 's/\.//g')" >> $GITHUB_ENV - echo "AMP_INST_MGR_VERSION=$(jq -r '.InstanceManagerCLI' .github/workflows/data/AMPVersions.json | sed -e 's/\.//g')" >> $GITHUB_ENV + echo "AMP_CORE_VERSION=$(jq -r '.AMPCore' AMPVersions.json | sed -e 's/\.//g')" >> $GITHUB_ENV + echo "AMP_INST_MGR_VERSION=$(jq -r '.InstanceManagerCLI' AMPVersions.json | sed -e 's/\.//g')" >> $GITHUB_ENV - name: Compare and Tag run: | diff --git a/.github/workflows/data/AMPVersions.json b/AMPVersions.json similarity index 100% rename from .github/workflows/data/AMPVersions.json rename to AMPVersions.json From cc16d5cc2a0f1b64646cd369a20a49f6e280b128 Mon Sep 17 00:00:00 2001 From: github-actions Date: Sat, 28 Nov 2020 00:45:56 +0000 Subject: [PATCH 25/43] Auto Update AMP Versions --- AMPVersions.json | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/AMPVersions.json b/AMPVersions.json index bca07e7..a1fcdaf 100644 --- a/AMPVersions.json +++ b/AMPVersions.json @@ -1,11 +1,11 @@ -{ - "InstanceManager": "2.0.6.0", - "InstanceManagerCLI": "2.0.8.6", - "AMPCoreMinimum": "2.0.0.0", - "AMPCore": "2.0.8.6", - "ReleaseNotes": "https://support.cubecoders.com/thread/amp-2-0-8-6-europa-release-notes/", - "ModuleVersions": { - "Minecraft": "1.0.0.3", - "SpaceEngineers": "1.0.0.2" - } +{ + "InstanceManager": "2.0.6.0", + "InstanceManagerCLI": "2.0.8.6", + "AMPCoreMinimum": "2.0.0.0", + "AMPCore": "2.0.8.6", + "ReleaseNotes": "https://support.cubecoders.com/thread/amp-2-0-8-6-europa-release-notes/", + "ModuleVersions": { + "Minecraft": "1.0.0.3", + "SpaceEngineers": "1.0.0.2" + } } \ No newline at end of file From 3a23c6526a4af61243874a0983d74bf60b56731a Mon Sep 17 00:00:00 2001 From: Mitch Talmadge Date: Fri, 27 Nov 2020 17:50:34 -0700 Subject: [PATCH 26/43] Test commit --- .github/workflows/auto-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/auto-release.yml b/.github/workflows/auto-release.yml index 1b72298..0278598 100644 --- a/.github/workflows/auto-release.yml +++ b/.github/workflows/auto-release.yml @@ -2,7 +2,7 @@ name: Auto Release on: push: - workflow_dispatch: + workflow_dispatch: schedule: - cron: "0 21 * * *" # Every day at 2 PM MST (Releases tend to show up sometime around noon) From 4bd635c1a689dc59d8d4e3a68f825eb609771a60 Mon Sep 17 00:00:00 2001 From: Mitch Talmadge Date: Fri, 27 Nov 2020 17:54:11 -0700 Subject: [PATCH 27/43] Change dirty tree detection algo --- .github/workflows/auto-release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/auto-release.yml b/.github/workflows/auto-release.yml index 0278598..a4803a8 100644 --- a/.github/workflows/auto-release.yml +++ b/.github/workflows/auto-release.yml @@ -29,11 +29,11 @@ jobs: - name: Compare and Tag run: | - git diff-index --quiet HEAD -- && { echo "Already up-to-date"; exit; } - git --no-pager diff git config user.name github-actions git config user.email github-actions@github.com git add . + test $(git diff --stat) = '' && { echo "Already up-to-date"; exit; } + git --no-pager diff git commit -am "Auto Update AMP Versions" git tag -a "$LATEST_RELEASE_VERSION-ampcore$AMP_CORE_VERSION-ampinstmgr$AMP_INST_MGR_VERSION" -m "Auto Release Latest AMP Version" git push --follow-tags \ No newline at end of file From 57606924f60869db0609b1e86b0e675d05d769ae Mon Sep 17 00:00:00 2001 From: Mitch Talmadge Date: Fri, 27 Nov 2020 17:57:04 -0700 Subject: [PATCH 28/43] Replace test with [[ ]] --- .github/workflows/auto-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/auto-release.yml b/.github/workflows/auto-release.yml index a4803a8..68fcddb 100644 --- a/.github/workflows/auto-release.yml +++ b/.github/workflows/auto-release.yml @@ -32,7 +32,7 @@ jobs: git config user.name github-actions git config user.email github-actions@github.com git add . - test $(git diff --stat) = '' && { echo "Already up-to-date"; exit; } + [[ $(git diff --stat) = '' ]] && { echo "Already up-to-date"; exit; } git --no-pager diff git commit -am "Auto Update AMP Versions" git tag -a "$LATEST_RELEASE_VERSION-ampcore$AMP_CORE_VERSION-ampinstmgr$AMP_INST_MGR_VERSION" -m "Auto Release Latest AMP Version" From 27acbcf8279820e51cebcfc544de0ebc077e027d Mon Sep 17 00:00:00 2001 From: Mitch Talmadge Date: Fri, 27 Nov 2020 18:00:36 -0700 Subject: [PATCH 29/43] Test fake update --- AMPVersions.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/AMPVersions.json b/AMPVersions.json index a1fcdaf..bc24390 100644 --- a/AMPVersions.json +++ b/AMPVersions.json @@ -1,7 +1,7 @@ { "InstanceManager": "2.0.6.0", - "InstanceManagerCLI": "2.0.8.6", - "AMPCoreMinimum": "2.0.0.0", + "InstanceManagerCLI": "2.0.8.5", + "AMPCoreMinimum": "2.0.0.0", "AMPCore": "2.0.8.6", "ReleaseNotes": "https://support.cubecoders.com/thread/amp-2-0-8-6-europa-release-notes/", "ModuleVersions": { From 4ccb16a4e075abb52dd216eb09bbb08563b11327 Mon Sep 17 00:00:00 2001 From: Mitch Talmadge Date: Fri, 27 Nov 2020 18:02:45 -0700 Subject: [PATCH 30/43] Fix incorrect up-to-date check --- .github/workflows/auto-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/auto-release.yml b/.github/workflows/auto-release.yml index 68fcddb..45cfcee 100644 --- a/.github/workflows/auto-release.yml +++ b/.github/workflows/auto-release.yml @@ -32,7 +32,7 @@ jobs: git config user.name github-actions git config user.email github-actions@github.com git add . - [[ $(git diff --stat) = '' ]] && { echo "Already up-to-date"; exit; } + git diff --quiet && { echo "Already up-to-date"; exit; } git --no-pager diff git commit -am "Auto Update AMP Versions" git tag -a "$LATEST_RELEASE_VERSION-ampcore$AMP_CORE_VERSION-ampinstmgr$AMP_INST_MGR_VERSION" -m "Auto Release Latest AMP Version" From dbabfdf336e777b1baa27d54d53c8d00396a6d71 Mon Sep 17 00:00:00 2001 From: Mitch Talmadge Date: Fri, 27 Nov 2020 18:06:21 -0700 Subject: [PATCH 31/43] Move debug line --- .github/workflows/auto-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/auto-release.yml b/.github/workflows/auto-release.yml index 45cfcee..07f38ca 100644 --- a/.github/workflows/auto-release.yml +++ b/.github/workflows/auto-release.yml @@ -32,8 +32,8 @@ jobs: git config user.name github-actions git config user.email github-actions@github.com git add . - git diff --quiet && { echo "Already up-to-date"; exit; } git --no-pager diff + git diff --quiet && { echo "Already up-to-date"; exit; } git commit -am "Auto Update AMP Versions" git tag -a "$LATEST_RELEASE_VERSION-ampcore$AMP_CORE_VERSION-ampinstmgr$AMP_INST_MGR_VERSION" -m "Auto Release Latest AMP Version" git push --follow-tags \ No newline at end of file From 4c5e21db63cc57ae4e6c5a57fc4746115f97ac02 Mon Sep 17 00:00:00 2001 From: Mitch Talmadge Date: Fri, 27 Nov 2020 18:09:14 -0700 Subject: [PATCH 32/43] Diff on cached --- .github/workflows/auto-release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/auto-release.yml b/.github/workflows/auto-release.yml index 07f38ca..a0deb2c 100644 --- a/.github/workflows/auto-release.yml +++ b/.github/workflows/auto-release.yml @@ -32,8 +32,8 @@ jobs: git config user.name github-actions git config user.email github-actions@github.com git add . - git --no-pager diff - git diff --quiet && { echo "Already up-to-date"; exit; } + git --no-pager diff --cached + git diff --cached --quiet && { echo "Already up-to-date"; exit; } git commit -am "Auto Update AMP Versions" git tag -a "$LATEST_RELEASE_VERSION-ampcore$AMP_CORE_VERSION-ampinstmgr$AMP_INST_MGR_VERSION" -m "Auto Release Latest AMP Version" git push --follow-tags \ No newline at end of file From 895d151416f1c2c5c026b668c8b8e24e87fe312e Mon Sep 17 00:00:00 2001 From: github-actions Date: Sat, 28 Nov 2020 01:09:38 +0000 Subject: [PATCH 33/43] Auto Update AMP Versions --- AMPVersions.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/AMPVersions.json b/AMPVersions.json index bc24390..a1fcdaf 100644 --- a/AMPVersions.json +++ b/AMPVersions.json @@ -1,7 +1,7 @@ { "InstanceManager": "2.0.6.0", - "InstanceManagerCLI": "2.0.8.5", - "AMPCoreMinimum": "2.0.0.0", + "InstanceManagerCLI": "2.0.8.6", + "AMPCoreMinimum": "2.0.0.0", "AMPCore": "2.0.8.6", "ReleaseNotes": "https://support.cubecoders.com/thread/amp-2-0-8-6-europa-release-notes/", "ModuleVersions": { From c8b1b9db932f082fccc902eed44207ddefc9eb1d Mon Sep 17 00:00:00 2001 From: Mitch Talmadge Date: Fri, 27 Nov 2020 18:10:44 -0700 Subject: [PATCH 34/43] Test commit --- .github/workflows/auto-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/auto-release.yml b/.github/workflows/auto-release.yml index a0deb2c..0e6c32e 100644 --- a/.github/workflows/auto-release.yml +++ b/.github/workflows/auto-release.yml @@ -13,7 +13,7 @@ jobs: - name: Checkout uses: actions/checkout@v2 with: - fetch-depth: 0 + fetch-depth: 0 - name: Install Dependencies run: sudo apt-get install -y --no-install-recommends wget jq From 970b9e42e4ed71aac4db40abd743c85d5a9e1d6e Mon Sep 17 00:00:00 2001 From: Mitch Talmadge Date: Fri, 27 Nov 2020 18:13:07 -0700 Subject: [PATCH 35/43] Set fake amp version as test --- AMPVersions.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/AMPVersions.json b/AMPVersions.json index a1fcdaf..43aec4d 100644 --- a/AMPVersions.json +++ b/AMPVersions.json @@ -1,8 +1,8 @@ { "InstanceManager": "2.0.6.0", "InstanceManagerCLI": "2.0.8.6", - "AMPCoreMinimum": "2.0.0.0", - "AMPCore": "2.0.8.6", + "AMPCoreMinimum": "2.0.0.0", + "AMPCore": "2.0.8.5", "ReleaseNotes": "https://support.cubecoders.com/thread/amp-2-0-8-6-europa-release-notes/", "ModuleVersions": { "Minecraft": "1.0.0.3", From 32633f65512b1e67f687b8c4f09c80015e1a411e Mon Sep 17 00:00:00 2001 From: Mitch Talmadge Date: Fri, 27 Nov 2020 18:15:33 -0700 Subject: [PATCH 36/43] Allow "v" prefix on release tags. --- .github/workflows/auto-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/auto-release.yml b/.github/workflows/auto-release.yml index 0e6c32e..eccfa54 100644 --- a/.github/workflows/auto-release.yml +++ b/.github/workflows/auto-release.yml @@ -23,7 +23,7 @@ jobs: - name: Parse Versions run: | - echo "LATEST_RELEASE_VERSION=$(git tag -l --sort=-refname | grep '^[0-9]$' -m 1)" >> $GITHUB_ENV + echo "LATEST_RELEASE_VERSION=$(git tag -l --sort=-refname | grep '^v?[0-9]$' -m 1)" >> $GITHUB_ENV echo "AMP_CORE_VERSION=$(jq -r '.AMPCore' AMPVersions.json | sed -e 's/\.//g')" >> $GITHUB_ENV echo "AMP_INST_MGR_VERSION=$(jq -r '.InstanceManagerCLI' AMPVersions.json | sed -e 's/\.//g')" >> $GITHUB_ENV From 995f7da7c339eb018e3f5df63aad20713a105a29 Mon Sep 17 00:00:00 2001 From: Mitch Talmadge Date: Fri, 27 Nov 2020 18:18:09 -0700 Subject: [PATCH 37/43] Use extended regex --- .github/workflows/auto-release.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/auto-release.yml b/.github/workflows/auto-release.yml index eccfa54..0e87926 100644 --- a/.github/workflows/auto-release.yml +++ b/.github/workflows/auto-release.yml @@ -15,15 +15,12 @@ jobs: with: fetch-depth: 0 - - name: Install Dependencies - run: sudo apt-get install -y --no-install-recommends wget jq - - name: Download AMP Versions run: wget https://cubecoders.com/AMPVersions.json -O AMPVersions.json - name: Parse Versions run: | - echo "LATEST_RELEASE_VERSION=$(git tag -l --sort=-refname | grep '^v?[0-9]$' -m 1)" >> $GITHUB_ENV + echo "LATEST_RELEASE_VERSION=$(git tag -l --sort=-refname | grep -E '^v?[0-9]$' -m 1)" >> $GITHUB_ENV echo "AMP_CORE_VERSION=$(jq -r '.AMPCore' AMPVersions.json | sed -e 's/\.//g')" >> $GITHUB_ENV echo "AMP_INST_MGR_VERSION=$(jq -r '.InstanceManagerCLI' AMPVersions.json | sed -e 's/\.//g')" >> $GITHUB_ENV From e54477b19e98f75f7cf6532cc736ee233afbdb07 Mon Sep 17 00:00:00 2001 From: github-actions Date: Sat, 28 Nov 2020 01:18:28 +0000 Subject: [PATCH 38/43] Auto Update AMP Versions --- AMPVersions.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/AMPVersions.json b/AMPVersions.json index 43aec4d..a1fcdaf 100644 --- a/AMPVersions.json +++ b/AMPVersions.json @@ -1,8 +1,8 @@ { "InstanceManager": "2.0.6.0", "InstanceManagerCLI": "2.0.8.6", - "AMPCoreMinimum": "2.0.0.0", - "AMPCore": "2.0.8.5", + "AMPCoreMinimum": "2.0.0.0", + "AMPCore": "2.0.8.6", "ReleaseNotes": "https://support.cubecoders.com/thread/amp-2-0-8-6-europa-release-notes/", "ModuleVersions": { "Minecraft": "1.0.0.3", From 5c9cae317b4e9e512ba12b89b9dc25714f10ed20 Mon Sep 17 00:00:00 2001 From: Mitch Talmadge Date: Fri, 27 Nov 2020 18:55:15 -0700 Subject: [PATCH 39/43] Simplify auto release workflow --- .github/workflows/auto-release.yml | 17 ++++++++--------- AMPVersions.json | 11 ----------- 2 files changed, 8 insertions(+), 20 deletions(-) delete mode 100644 AMPVersions.json diff --git a/.github/workflows/auto-release.yml b/.github/workflows/auto-release.yml index 0e87926..3444641 100644 --- a/.github/workflows/auto-release.yml +++ b/.github/workflows/auto-release.yml @@ -5,6 +5,9 @@ on: workflow_dispatch: schedule: - cron: "0 21 * * *" # Every day at 2 PM MST (Releases tend to show up sometime around noon) + release: + types: + - created jobs: check-for-updates: @@ -16,21 +19,17 @@ jobs: fetch-depth: 0 - name: Download AMP Versions - run: wget https://cubecoders.com/AMPVersions.json -O AMPVersions.json + run: wget https://cubecoders.com/AMPVersions.json -O /tmp/AMPVersions.json - name: Parse Versions run: | echo "LATEST_RELEASE_VERSION=$(git tag -l --sort=-refname | grep -E '^v?[0-9]$' -m 1)" >> $GITHUB_ENV - echo "AMP_CORE_VERSION=$(jq -r '.AMPCore' AMPVersions.json | sed -e 's/\.//g')" >> $GITHUB_ENV - echo "AMP_INST_MGR_VERSION=$(jq -r '.InstanceManagerCLI' AMPVersions.json | sed -e 's/\.//g')" >> $GITHUB_ENV + echo "AMP_CORE_VERSION=$(jq -r '.AMPCore' /tmp/AMPVersions.json | sed -e 's/\.//g')" >> $GITHUB_ENV + echo "AMP_INST_MGR_VERSION=$(jq -r '.InstanceManagerCLI' /tmp/AMPVersions.json | sed -e 's/\.//g')" >> $GITHUB_ENV - - name: Compare and Tag + - name: Create Tag run: | git config user.name github-actions git config user.email github-actions@github.com - git add . - git --no-pager diff --cached - git diff --cached --quiet && { echo "Already up-to-date"; exit; } - git commit -am "Auto Update AMP Versions" - git tag -a "$LATEST_RELEASE_VERSION-ampcore$AMP_CORE_VERSION-ampinstmgr$AMP_INST_MGR_VERSION" -m "Auto Release Latest AMP Version" + git tag -a "$LATEST_RELEASE_VERSION-ampcore$AMP_CORE_VERSION-ampinstmgr$AMP_INST_MGR_VERSION" -m "Auto Release Latest AMP Version" || { echo "Already up-to-date"; exit; } git push --follow-tags \ No newline at end of file diff --git a/AMPVersions.json b/AMPVersions.json deleted file mode 100644 index 43aec4d..0000000 --- a/AMPVersions.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "InstanceManager": "2.0.6.0", - "InstanceManagerCLI": "2.0.8.6", - "AMPCoreMinimum": "2.0.0.0", - "AMPCore": "2.0.8.5", - "ReleaseNotes": "https://support.cubecoders.com/thread/amp-2-0-8-6-europa-release-notes/", - "ModuleVersions": { - "Minecraft": "1.0.0.3", - "SpaceEngineers": "1.0.0.2" - } -} \ No newline at end of file From 0cbe1e647b2d1eb55dc19dd327dc24a12085ce89 Mon Sep 17 00:00:00 2001 From: Mitch Talmadge Date: Fri, 27 Nov 2020 18:57:45 -0700 Subject: [PATCH 40/43] Test commit --- .github/workflows/auto-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/auto-release.yml b/.github/workflows/auto-release.yml index 3444641..527bfaf 100644 --- a/.github/workflows/auto-release.yml +++ b/.github/workflows/auto-release.yml @@ -7,7 +7,7 @@ on: - cron: "0 21 * * *" # Every day at 2 PM MST (Releases tend to show up sometime around noon) release: types: - - created + - created jobs: check-for-updates: From 97581d53b2feed098a015ed2a74665984cbf5704 Mon Sep 17 00:00:00 2001 From: Mitch Talmadge Date: Fri, 27 Nov 2020 23:01:41 -0700 Subject: [PATCH 41/43] Do not run auto-release on push. --- .github/workflows/auto-release.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/auto-release.yml b/.github/workflows/auto-release.yml index 527bfaf..9c6c33a 100644 --- a/.github/workflows/auto-release.yml +++ b/.github/workflows/auto-release.yml @@ -1,7 +1,6 @@ name: Auto Release on: - push: workflow_dispatch: schedule: - cron: "0 21 * * *" # Every day at 2 PM MST (Releases tend to show up sometime around noon) From 1f06127ba2ca04daa313d14e5dae456be9193ff6 Mon Sep 17 00:00:00 2001 From: Mitch Talmadge Date: Fri, 27 Nov 2020 23:29:05 -0700 Subject: [PATCH 42/43] Change auto release to hourly schedule. --- .github/workflows/auto-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/auto-release.yml b/.github/workflows/auto-release.yml index 9c6c33a..1e7c555 100644 --- a/.github/workflows/auto-release.yml +++ b/.github/workflows/auto-release.yml @@ -3,7 +3,7 @@ name: Auto Release on: workflow_dispatch: schedule: - - cron: "0 21 * * *" # Every day at 2 PM MST (Releases tend to show up sometime around noon) + - cron: "0 * * * *" # Every hour release: types: - created From 1263b7dd816fe140f4f6b9af25db707c877cb08f Mon Sep 17 00:00:00 2001 From: Mitch Talmadge Date: Fri, 27 Nov 2020 23:29:10 -0700 Subject: [PATCH 43/43] Update README. --- README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 68f913a..cd2760f 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,14 @@ # AMP-dockerized [![Docker Cloud Build Status](https://img.shields.io/docker/cloud/build/mitchtalmadge/amp-dockerized)](https://hub.docker.com/r/mitchtalmadge/amp-dockerized) -This repository bundles [CubeCoders AMP](https://cubecoders.com/AMP) into a Debian-based [Docker image.](https://hub.docker.com/r/mitchtalmadge/amp-dockerized) -(`mitchtalmadge/amp-dockerized:latest`) +This repository bundles [CubeCoders AMP](https://cubecoders.com/AMP) into a Debian-based [Docker image.](https://hub.docker.com/r/mitchtalmadge/amp-dockerized) +(`mitchtalmadge/amp-dockerized:latest`) so that you can set up game servers with ease! -In a nutshell, AMP (Application Management Panel) allows you to manage one or more game servers from a web UI. +In a nutshell, AMP (Application Management Panel) allows you to manage one or more game servers from a web UI. You need a [CubeCoders AMP Licence](https://cubecoders.com/AMP#buyAMP) to use this image. -*Disclaimer:* I (Mitch Talmadge) did not create AMP and am not associated with CubeCoders. I simply made it work with Docker because - I hate installing things. +Updates to AMP are automatically bundled into new Docker images. We check for updates hourly. + +*Please note:* This is a community-made unofficial image, and is not endorsed by CubeCoders. # Getting Help @@ -173,8 +174,7 @@ Or, just put [CloudFlare](https://www.cloudflare.com/) and its free SSL cert in # Upgrading AMP -AMP is automatically upgraded to the latest version when the container is restarted. If a newer version of AMP exists -than the one that is running, it will be downloaded and installed before the instances are started. :D Yay +To upgrade, all you have to do is pull our latest Docker image! We automatically check for AMP updates every hour. When a new version is released, we build and publish an image both as a standalone tag and on `:latest`. # Contributing