From e9144f460d0336fecde4890de22ecf8f7e96bd7e Mon Sep 17 00:00:00 2001 From: James Brumond Date: Wed, 16 Aug 2023 17:09:53 -0700 Subject: [PATCH] cleanup; readme; workflow_dispatch does not yet work in gitea, but trigger can be changed for pseudo-manual triggers --- .drone.yml | 17 ----------- .gitea/workflows/build-and-publish.yaml | 2 +- .gitea/workflows/build.yaml | 2 +- readme.md | 40 +++++++++++++++++++++++++ 4 files changed, 42 insertions(+), 19 deletions(-) delete mode 100644 .drone.yml diff --git a/.drone.yml b/.drone.yml deleted file mode 100644 index b17a357..0000000 --- a/.drone.yml +++ /dev/null @@ -1,17 +0,0 @@ -# --- -# kind: template -# load: multiarch-container.yaml -# data: -# repo: images/rotate-backups -# build_args: -# - PYTHON_VERSION=3 -# - ALPINE_VERSION=3.18 -# - ROTATE_BACKUPS_VERSION=8.1 -# tags: -# - "8.1" -# - "8" -# platforms: -# - os: linux -# arch: arm64 -# - os: linux -# arch: amd64 diff --git a/.gitea/workflows/build-and-publish.yaml b/.gitea/workflows/build-and-publish.yaml index f1ca354..15dcfed 100644 --- a/.gitea/workflows/build-and-publish.yaml +++ b/.gitea/workflows/build-and-publish.yaml @@ -25,7 +25,7 @@ jobs: username: ${{ secrets.REGISTRY_USER }} password: ${{ secrets.REGISTRY_TOKEN }} - - name: Build and push + - name: Build and publish uses: docker/build-push-action@v4 env: # see diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml index 892f4d4..ff03e31 100644 --- a/.gitea/workflows/build.yaml +++ b/.gitea/workflows/build.yaml @@ -21,7 +21,7 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 - - name: Build and push + - name: Build uses: docker/build-push-action@v4 env: # see diff --git a/readme.md b/readme.md index 5d07856..49ee4ba 100644 --- a/readme.md +++ b/readme.md @@ -2,3 +2,43 @@ # `rotate-backups` in a container image + +## Example usage in kubernetes cronjob + +```yaml +apiVersion: batch/v1 +kind: CronJob +metadata: + name: mariadb-backup-rotate-cron + namespace: mariadb + labels: + app: mariadb-backup-rotate-cron +spec: + schedule: "0 4 20 * *" # 20th of each month at 4am + jobTemplate: + spec: + template: + metadata: + labels: + app: mariadb-backup-rotate-cron + spec: + containers: + - name: mariadb-backup-rotate-container + image: gitea.jbrumond.me/images/rotate-backups:8 + command: [ "/opt/rotate.sh", "--daily=7", "--weekly=4", "--monthly=12", "--yearly=always" ] + resources: + limits: + cpu: 500m + memory: 1Gi + requests: + cpu: 100m + memory: 100Mi + volumeMounts: + - name: mariadb-backup-persistent-storage + mountPath: /data + restartPolicy: OnFailure + volumes: + - name: mariadb-backup-persistent-storage + persistentVolumeClaim: + claimName: mariadb-backup-pv-claim +```