From e3a3bed2ba890da1d22a366c7b0b50697b80a802 Mon Sep 17 00:00:00 2001 From: Daniel Wolf Date: Tue, 9 May 2023 16:08:19 -0400 Subject: [PATCH] migrate from drone to gitea-runner --- .dockerignore | 1 + .drone.yml | 65 ------------------------- .gitea/workflows/build.yaml | 92 +++++++++++++++++++++++++++++++++++ .gitea/workflows/pullreq.yaml | 14 ++++++ LICENSE.md | 2 +- README.md | 17 +++---- 6 files changed, 114 insertions(+), 77 deletions(-) delete mode 100644 .drone.yml create mode 100644 .gitea/workflows/build.yaml create mode 100644 .gitea/workflows/pullreq.yaml diff --git a/.dockerignore b/.dockerignore index 348e0d4..d236b92 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,5 +1,6 @@ .drone.yml .git +.gitea .gitignore LICENSE.md README.md diff --git a/.drone.yml b/.drone.yml deleted file mode 100644 index 68017eb..0000000 --- a/.drone.yml +++ /dev/null @@ -1,65 +0,0 @@ ---- -kind: pipeline -type: exec -name: default - -platform: - os: linux - arch: amd64 - -steps: -- name: build - environment: - PDR_USER: - from_secret: docker-user-pdr - PDR_PASS: - from_secret: docker-pass-pdr - commands: - - docker build -t pdr.nephatrine.net/nephatrine/minecraft-mcu:latest . - - docker login -p "$PDR_PASS" -u "$PDR_USER" pdr.nephatrine.net - - docker push pdr.nephatrine.net/nephatrine/minecraft-mcu:latest - - docker logout pdr.nephatrine.net -- name: publish - environment: - DOCKER_USER: - from_secret: docker-user - DOCKER_PASS: - from_secret: docker-pass - commands: - - docker tag pdr.nephatrine.net/nephatrine/minecraft-mcu:latest nephatrine/minecraft-mcu:latest - - docker login -p "$DOCKER_PASS" -u "$DOCKER_USER" - - docker push -a nephatrine/minecraft-mcu - - docker logout - depends_on: - - build - ---- -kind: pipeline -name: notify - -steps: -- name: notify-status - image: appleboy/drone-discord - failure: ignore - settings: - avatar_url: https://nephatrine.net/images/buttons/drone-ci.png - message: "Build of **[{{repo.name}}:{{commit.branch}}]()** returned [{{build.status}}](<{{build.link}}>)." - username: DroneCI - webhook_id: - from_secret: wh-infra-id - webhook_token: - from_secret: wh-infra-id - -depends_on: -- default - -trigger: - status: - - success - - failure - ---- -kind: signature -hmac: 523ec8bf4f49d63d04bfca6cf97d631bff5f2b6c97d68e2b47901b4a50a91bc4 - -... diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml new file mode 100644 index 0000000..cd2a4c6 --- /dev/null +++ b/.gitea/workflows/build.yaml @@ -0,0 +1,92 @@ +name: Build Container Image +run-name: ${{ gitea.actor }} pushed to ${{ gitea.repository }}:${{ gitea.ref_name }} +on: [push, workflow_call] +jobs: + build_amd64: + if: gitea.repository_owner == 'NephNET' && !contains(github.event.head_commit.message, '#noci') + runs-on: nephnet-amd64 + steps: + - name: Checkout Repository + uses: actions/checkout@v3 + - name: Docker Build + run: | + docker build --pull -t code.nephatrine.net/nephnet/minecraft-mcu:${{ gitea.ref_name }}-cached --target builder ${{ gitea.workspace }} + docker build --pull -t code.nephatrine.net/nephnet/minecraft-mcu:${{ gitea.ref_name }}-amd64 ${{ gitea.workspace }} + - name: Docker Login + uses: actions/docker-login@v2 + with: + registry: code.nephatrine.net + username: ${{ gitea.actor }} + password: ${{ secrets.PACKAGER_TOKEN }} + - name: Docker Push + run: docker push code.nephatrine.net/nephnet/minecraft-mcu:${{ gitea.ref_name }}-amd64 + - name: Notify Discord + uses: actions/discord-status@v1 + if: always() + with: + title: "Container Build (X86_64)" + webhook: ${{ secrets.DISCORD_WEBHOOK_BUILD }} + build_manifest: + needs: [build_amd64] + runs-on: nephnet + steps: + - name: Docker Login + uses: actions/docker-login@v2 + with: + registry: code.nephatrine.net + username: ${{ gitea.actor }} + password: ${{ secrets.PACKAGER_TOKEN }} + - name: Docker Manifest + run: | + docker manifest create code.nephatrine.net/nephnet/minecraft-mcu:${{ gitea.ref_name }} --amend code.nephatrine.net/nephnet/minecraft-mcu:${{ gitea.ref_name }}-amd64 + docker manifest push --purge code.nephatrine.net/nephnet/minecraft-mcu:${{ gitea.ref_name }} + publish_amd64: + if: gitea.ref_name == 'master' + needs: [build_amd64] + runs-on: nephnet-amd64 + steps: + - name: Check Base Image + if: github.event_name != 'push' + uses: actions/docker-base-image-check@v1.2.1 + id: checkbase + with: + base-image: nephatrine/alpine-s6:latest-amd64 + image: nephatrine/minecraft-mcu:latest-amd64 + - name: Docker Login + uses: actions/docker-login@v2 + with: + username: ${{ secrets.DOCKER_USER }} + password: ${{ secrets.DOCKER_PASS }} + - name: Docker Push + run: | + docker tag code.nephatrine.net/nephnet/minecraft-mcu:master-amd64 nephatrine/minecraft-mcu:latest-amd64 + docker push nephatrine/minecraft-mcu:latest-amd64 + - name: Notify Discord + if: github.event_name == 'push' || steps.checkbase.outputs.needs-updating == 'true' + uses: actions/discord-status@v1 + with: + title: "DockerHub: drone-ci" + description: "The container image was pushed to [DockerHub](https://hub.docker.com/repository/docker/nephatrine/minecraft-mcu/general).\nPull `nephatrine/minecraft-mcu:latest-amd64` for the newest image." + nodetail: true + webhook: ${{ secrets.DISCORD_WEBHOOK_PACKAGE }} + publish_manifest: + needs: [publish_amd64] + runs-on: nephnet + steps: + - name: Docker Login + uses: actions/docker-login@v2 + with: + username: ${{ secrets.DOCKER_USER }} + password: ${{ secrets.DOCKER_PASS }} + - name: Docker Manifest + run: | + docker manifest create nephatrine/minecraft-mcu:latest --amend nephatrine/minecraft-mcu:latest-amd64 + docker manifest push --purge nephatrine/minecraft-mcu:latest + - name: Checkout Repository + uses: actions/checkout@v3 + - name: Docker Describe + uses: actions/dockerhub-update-description@v3 + with: + username: ${{ secrets.DOCKER_USER }} + password: ${{ secrets.DOCKER_PASS }} + repository: nephatrine/minecraft-mcu diff --git a/.gitea/workflows/pullreq.yaml b/.gitea/workflows/pullreq.yaml new file mode 100644 index 0000000..a2a89a8 --- /dev/null +++ b/.gitea/workflows/pullreq.yaml @@ -0,0 +1,14 @@ +name: Build Container Image +run-name: ${{ gitea.actor }} pushed to ${{ gitea.repository }}:${{ gitea.ref_name }} +on: + pull_request: + types: [ opened, synchronize, ready_for_review ] +jobs: + build: + if: gitea.actor == 'nephatrine' && gitea.event.pull_request.draft == false + runs-on: nephnet + steps: + - name: Checkout Repository + uses: actions/checkout@v3 + - name: Docker Build + run: docker build --pull ${{ gitea.workspace }} diff --git a/LICENSE.md b/LICENSE.md index 3e6a2f2..36c919f 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,4 +1,4 @@ -Copyright © 2021 Daniel Wolf <> +Copyright © 2023 Daniel Wolf <> **Permission to use, copy, modify, and distribute this software for any purpose with or without fee is hereby granted, provided that the above diff --git a/README.md b/README.md index 7fbf633..52b6093 100644 --- a/README.md +++ b/README.md @@ -1,22 +1,17 @@ -[Git](https://code.nephatrine.net/nephatrine/docker-minecraft-mcu/src/branch/master) | +[Git](https://code.nephatrine.net/NephNET/docker-minecraft-mcu/src/branch/master) | [Docker](https://hub.docker.com/r/nephatrine/minecraft-mcu/) | [unRAID](https://code.nephatrine.net/nephatrine/unraid-containers) -[![Build Status](https://ci.nephatrine.net/api/badges/nephatrine/docker-minecraft-mcu/status.svg?ref=refs/heads/master)](https://ci.nephatrine.net/nephatrine/docker-minecraft-mcu) - # Minecraft Server This docker image contains a Minecraft server to self-host your own Java Edition server and optionally MCUpdater modpack. -**YOU WILL NEED TO USE A SEPARATE REVERSE PROXY SERVER TO SECURE THIS SERVICE. -FOR INSTANCE, AN [NGINX](https://nginx.com/) REVERSE PROXY CONTAINER.** +To secure this service, we suggest a separate reverse proxy server, such as an +[NGINX](https://nginx.com/) container. -- [Alpine Linux](https://alpinelinux.org/) -- [Skarnet Software](https://skarnet.org/software/) -- [S6 Overlay](https://github.com/just-containers/s6-overlay) -- [Minecraft](https://minecraft.net/) -- [MCUpdater](https://mcupdater.com/) +- [Alpine Linux](https://alpinelinux.org/) w/ [S6 Overlay](https://github.com/just-containers/s6-overlay) +- [Minecraft](https://minecraft.net/) w/ [MCUpdater](https://mcupdater.com/) **Please note, you will still need to agree to the EULA the first time you start up the server by changing ``eula=false`` to ``eula=true`` in the @@ -88,4 +83,4 @@ This container runs network services that are intended to be exposed outside the container. You can map these to host ports using the ``-p HOST:CONTAINER`` or ``-p HOST:CONTAINER/PROTOCOL`` syntax. -- ``25565/tcp``: Minecraft Server. This is the game server. +- ``25565/tcp+udp``: Minecraft Server. This is the game server.