Skip to content

Commit

Permalink
Upgrade to Decadeus build process
Browse files Browse the repository at this point in the history
  • Loading branch information
MitchTalmadge committed Jul 17, 2023
1 parent 8d62094 commit d34b6ed
Show file tree
Hide file tree
Showing 7 changed files with 90 additions and 205 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ jobs:
- name: "Build Docker Image"
uses: docker/build-push-action@v2
with:
build-args: |
"CACHE_AMP_UPGRADE=${{ inputs.for_deploy == true }}"
context: .
platforms: linux/${{ matrix.arch }}
tags: amp-dockerized:latest
Expand Down
87 changes: 0 additions & 87 deletions .github/workflows/check-for-updates.yml

This file was deleted.

66 changes: 28 additions & 38 deletions .github/workflows/deploy-prod.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,17 @@
name: "Deploy Production"

# Run when a tag is pushed starting with "v"
on:
workflow_call:
inputs:
git_release_version:
required: true
type: string
amp_core_version:
required: true
type: string
amp_instmgr_version:
required: true
type: string
amp_last_modified:
required: true
type: string
secrets:
DOCKERHUB_USERNAME:
required: true
DOCKERHUB_TOKEN:
required: true
push:
tags:
- v*

jobs:
build:
uses: MitchTalmadge/AMP-dockerized/.github/workflows/build.yml
with:
for_deploy: true

deploy:
name: "Deploy"
runs-on: ubuntu-latest
Expand All @@ -30,33 +20,33 @@ jobs:
uses: actions/download-artifact@v2
with:
path: /tmp
- name: "Load Docker Image"
- name: "Get Tag Name"
id: get_tag_name
run: echo "TAG_NAME=$(echo ${GITHUB_REF#refs/tags/})" >> $GITHUB_ENV
- name: "Load Docker Images"
id: load_images
run: |
for f in $(find /tmp -type f -iname 'docker-image*.tar' -print); do
TAGS=""
for f in $(find /tmp -type f -iname 'docker-image-*.tar' -print); do
ARCH=$(echo ${f} | sed -E 's/.*docker-image-(.*).tar/\1/')
docker load --input ${f}
TAG="mitchtalmadge/amp-dockerized:${{ steps.get_tag_name.outputs.TAG_NAME }}-${ARCH}"
TAGS="${TAGS} ${TAG}"
docker tag amp-dockerized:latest ${TAG}
done
echo "TAGS=${TAGS}" >> $GITHUB_OUTPUT
docker image ls -a
- name: "Tag Docker Images"
run: |
docker tag amp-dockerized:latest mitchtalmadge/amp-dockerized:latest
docker tag amp-dockerized:latest mitchtalmadge/amp-dockerized:${{inputs.git_release_version}}
docker tag amp-dockerized:latest mitchtalmadge/amp-dockerized:${{inputs.git_release_version}}-ampcore${{inputs.amp_core_version}}-ampinstmgr${{inputs.amp_instmgr_version}}
docker tag amp-dockerized:latest mitchtalmadge/amp-dockerized:${{inputs.git_release_version}}-ampcore${{inputs.amp_core_version}}-ampinstmgr${{inputs.amp_instmgr_version}}-${{inputs.amp_last_modified}}
- name: "Checkout Git Repo"
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: "Commit Git Tag"
run: |
git config user.name github-actions
git config user.email github-actions@github.com
TAG=${{inputs.git_release_version}}-ampcore${{inputs.amp_core_version}}-ampinstmgr${{inputs.amp_instmgr_version}}-${{inputs.amp_last_modified}}
git tag -a "${TAG}" -m "Auto Release Latest AMP Version" || { echo "Tag already exists"; exit; }
git push --follow-tags
- name: "Login to Docker Hub"
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: "Deploy to Docker Hub"
run: docker image push --all-tags mitchtalmadge/amp-dockerized
- name: "Deploy Multi-Arch Manifests"
run: |
MANIFESTS="mitchtalmadge/amp-dockerized:latest mitchtalmadge/amp-dockerized:${{ steps.get_tag_name.outputs.TAG_NAME }}"
for m in ${MANIFESTS}; do
docker manifest create ${m} ${{ steps.load_images.outputs.TAGS }}
docker manifest push ${m}
done
20 changes: 14 additions & 6 deletions .github/workflows/deploy-staging.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,22 @@
name: "Deploy Staging"

on:
workflow_call:
secrets:
DOCKERHUB_USERNAME:
required: true
DOCKERHUB_TOKEN:
required: true
push:
branches:
- "staging*"
paths:
- Dockerfile
- .dockerignore
- entrypoint/**
- .github/workflows/**.yml

jobs:
build:
if: ${{ startsWith(github.ref, 'refs/heads/staging') }}
uses: MitchTalmadge/AMP-dockerized/.github/workflows/build.yml@staging
with:
for_deploy: true

deploy:
name: "Deploy Staging"
runs-on: ubuntu-latest
Expand Down
22 changes: 5 additions & 17 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
FROM ubuntu:20.04

# Set to false to skip downloading the AMP cache which is used for faster upgrades.
ARG CACHE_AMP_UPGRADE=true
ARG TARGETPLATFORM
ARG TARGETPLATFORM # Set by Docker, see https://docs.docker.com/engine/reference/builder/#automatic-platform-args-in-the-global-scope

ENV UID=1000
ENV GID=1000
ENV TZ=Etc/UTC
ENV PORT=8080
ENV USERNAME=admin
ENV PASSWORD=password
ENV LICENCE=notset
ENV MODULE=ADS
ENV IPBINDING=0.0.0.0

ENV AMP_AUTO_UPDATE=true
ENV AMP_LICENCE=notset
ENV AMP_MODULE=ADS
ENV AMP_RELEASE_STREAM=Mainline
ENV AMP_SUPPORT_LEVEL=UNSUPPORTED
ENV AMP_SUPPORT_TOKEN=AST0/MTAD
ENV AMP_SUPPORT_TAGS="nosupport docker community unofficial unraid"
Expand Down Expand Up @@ -177,18 +177,6 @@ RUN apt-key adv --fetch-keys http://repo.cubecoders.com/archive.key && \
/var/lib/apt/lists/* \
/var/tmp/*

# Get the latest AMP Core to pre-cache upgrades.
RUN if [ "$CACHE_AMP_UPGRADE" = "true" ]; then \
echo "Pre-caching AMP Upgrade..." && \
wget https://cubecoders.com/AMPVersions.json -O /tmp/AMPVersions.json && \
if [ "$TARGETPLATFORM" = "linux/arm64 "]; then \
wget https://cubecoders.com/Downloads/Release/AMP_Latest_AArch64.zip -O /opt/AMPCache-$(cat /tmp/AMPVersions.json | jq -r '.AMPCore' | sed -e 's/\.//g').zip; \
else wget https://cubecoders.com/Downloads/AMP_Latest.zip -O /opt/AMPCache-$(cat /tmp/AMPVersions.json | jq -r '.AMPCore' | sed -e 's/\.//g').zip; \
fi; \
else echo "Skipping AMP Upgrade Pre-cache."; \
fi


# Set up environment
COPY entrypoint /opt/entrypoint
RUN chmod -R +x /opt/entrypoint
Expand Down
30 changes: 17 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,13 @@ Updates to AMP are automatically bundled into new Docker images. We check for up

**Please DO NOT bug CubeCoders for support without first asking here; they do not support nor endorse this image and will tell you that you are on your own.**

If you need help with AMP when using this image, please [create an issue](https://github.com/MitchTalmadge/AMP-dockerized/issues/new) and we will figure it out!
If you need help with AMP when using this image, please [create an issue](https://github.com/MitchTalmadge/AMP-dockerized/issues/new) in this repository.

If you have coding skills and find this repository useful, please consider helping out by answering questions in the issues or making pull requests to fix bugs. I really can't do this alone.

## Unraid
If you are using Unraid, please check out [this support topic](https://forums.unraid.net/topic/98290-support-amp-application-management-panel-corneliousjd-repo/) made by one of our community members, [@CorneliousJD](https://github.com/CorneliousJD)!


# Supported Modules

**Tested and Working:**
Expand Down Expand Up @@ -98,9 +99,9 @@ Just a quick note about ports: some games use TCP, some games use UDP. Make sure

### Licence

| Name | Description | Default Value |
|-----------|----------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------|
| `LICENCE` | The licence key for CubeCoders AMP. You can retrieve or buy this on [their website.](https://manage.cubecoders.com/) | No Default. AMP will not boot without a real licence. |
| Name | Description | Default Value |
|---------------|--------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------|
| `AMP_LICENCE` | The licence key for CubeCoders AMP. You can retrieve or buy this on [their website.](https://manage.cubecoders.com/) | No Default. AMP will not boot without a real licence. |

**Important Details:**
- _Americans:_ This is spelled licenCe not licenSe. Got me a few times.
Expand All @@ -109,9 +110,9 @@ Just a quick note about ports: some games use TCP, some games use UDP. Make sure

### Module

| Name | Description | Default Value |
|----------|------------------------------------------------------------------|---------------|
| `MODULE` | Which Module to use for the main instance created by this image. | `ADS` |
| Name | Description | Default Value |
|--------------|-----------------------------------------------------------------------------------------------------------------------------------------------------|---------------|
| `AMP_MODULE` | Which Module to use for the Main instance created by this image (note: changing this value will have no effect after the Main instance is created). | `ADS` |

To run multiple game servers under this image, use the default value of `ADS` (Application Deployment Service) which allows you to create various modules from the web ui.

Expand Down Expand Up @@ -162,10 +163,10 @@ Example: `TZ=America/Denver`
| `USERNAME` | The username of the admin user created on first boot. | `admin` |
| `PASSWORD` | The password of the admin user. This value is only used when creating the new user. If you use the default value, please change it after first sign-in. | `password` |

### Nightly Builds
| Name | Description | Default Value |
|-------|----------------------------------------------------------------------|---------------|
| `NIGHTLY` | Set to any value to enable nightly builds. All instances will be migrated to nightly builds on next image start. Unset this variable to go back to MainLine builds (stable releases). | UNSET |
### Release Stream
| Name | Description | Default Value |
|----------------------|----------------------------------------------------------------------------------------------------|---------------|
| `AMP_RELEASE_STREAM` | Valid values are `Mainline` or `Development`. Don't change this unless you know what you're doing. | `Mainline` |

## Volumes

Expand Down Expand Up @@ -198,8 +199,11 @@ To restart the AMP instances, just restart the Docker container.
Or, just put [CloudFlare](https://www.cloudflare.com/) and its free SSL cert in front of your web UI and save yourself hours of pain.

# Upgrading AMP
To upgrade, just restart your container! On startup, we check for updates and install them if they are available.

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`.
| Name | Description | Default Value |
|-------------------|-------------------------------------------------------------------------------------------------|---------------|
| `AMP_AUTO_UPDATE` | Set to `false` if you would not like AMP to automatically update when you reboot the container. | `true` |

# Contributing

Expand Down
Loading

0 comments on commit d34b6ed

Please sign in to comment.