From 0c0aecff89f25b32e028a3547beea268a24373af Mon Sep 17 00:00:00 2001 From: Leandro Favarin Date: Sat, 28 Sep 2024 15:44:15 +0200 Subject: [PATCH] Automate releases --- ...ocker-images.yml => build-and-publish.yml} | 7 +- .github/workflows/release-checker.yml | 29 +++++ Dockerfile | 2 +- LICENSE.md | 2 + README.md | 102 +----------------- release-versions/latest.txt | 1 + 6 files changed, 43 insertions(+), 100 deletions(-) rename .github/workflows/{docker-images.yml => build-and-publish.yml} (91%) create mode 100644 .github/workflows/release-checker.yml create mode 100644 release-versions/latest.txt diff --git a/.github/workflows/docker-images.yml b/.github/workflows/build-and-publish.yml similarity index 91% rename from .github/workflows/docker-images.yml rename to .github/workflows/build-and-publish.yml index 2a8b065..4c7d0a9 100644 --- a/.github/workflows/docker-images.yml +++ b/.github/workflows/build-and-publish.yml @@ -1,8 +1,13 @@ -name: Build and push Docker image +name: Build and publish Docker images + on: + workflow_dispatch: push: branches: - main + paths: + - 'release-versions/latest.txt' + jobs: docker: runs-on: ubuntu-latest diff --git a/.github/workflows/release-checker.yml b/.github/workflows/release-checker.yml new file mode 100644 index 0000000..d222d6a --- /dev/null +++ b/.github/workflows/release-checker.yml @@ -0,0 +1,29 @@ +name: Release Checker + +on: + schedule: + - cron: '0 0 * * *' # midnights + +jobs: + Release-Checker: + runs-on: ubuntu-latest + steps: + - name: Fetch latest release version + id: fetch-release + run: | + curl -s https://api.github.com/repos/rclone/rclone/releases/latest | jq -r ".tag_name" > release-versions/latest.txt + echo ::set-output name=success::$([ "$(cat release-versions/latest.txt)" == 'null' ] && echo "false" || echo "true") + + - name: Check for modified files + id: git-check + run: echo ::set-output name=modified::$([ -z "`git status --porcelain`" ] && echo "false" || echo "true") + + - name: Commit latest release version + if: | + steps.fetch-release.outputs.success == 'true' && + steps.git-check.outputs.modified == 'true' + run: | + git config --global user.name "github-actions[bot]" + git config --global user.email "github-actions[bot]@users.noreply.github.com" + git commit -am "Release: v$(cat release-versions/latest.txt)" + git push diff --git a/Dockerfile b/Dockerfile index 7eb2bb4..f422268 100644 --- a/Dockerfile +++ b/Dockerfile @@ -38,7 +38,7 @@ RUN ARCH=$(echo ${TARGETPLATFORM} | sed 's/\//-/g') && \ echo $ARCH > /tmp/arch.txt RUN ARCH=$(cat /tmp/arch.txt) ; \ - URL=http://downloads.rclone.org/${RCLONE_VERSION}/rclone-${RCLONE_VERSION}-${ARCH}.zip ; \ + URL=https://downloads.rclone.org/${RCLONE_VERSION}/rclone-${RCLONE_VERSION}-${ARCH}.zip ; \ URL=${URL/\/current/} ; \ cd /tmp \ && wget -q $URL \ diff --git a/LICENSE.md b/LICENSE.md index 2339a1d..c44de88 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,3 +1,5 @@ +Copyright 2024 Leandro Favarin + Copyright 2019 Pfidr34 Copyright 2017 Brian J. Cardiff diff --git a/README.md b/README.md index ef746a4..080352c 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,8 @@ Docker image to perform a [rclone](http://rclone.org) sync based on a cron schedule, with [healthchecks.io](https://healthchecks.io) monitoring. +Forked from [pfidr34/docker-rclone](https://github.com/pfidr34/docker-rclone). + rclone is a command line program to sync files and directories to and from: * Google Drive @@ -32,7 +34,7 @@ A first run of the container can help in the creation of the file, but feel free ``` $ mkdir config -$ docker run --rm -it -v $(pwd)/config:/config pfidr/rclone +$ docker run --rm -it -v $(pwd)/config:/config ghcr.io/leandrofavarin/docker-rclone ``` ### Perform sync in a daily basis @@ -64,107 +66,11 @@ A few environment variables allow you to customize the behavior of rclone: **When using UID/GID the config and/or logs directory must be writeable by this UID** ```bash -$ docker run --rm -it -v $(pwd)/config:/config -v /path/to/source:/source -e SYNC_SRC="/source" -e SYNC_DEST="dest:path" -e TZ="America/Chicago" -e CRON="0 0 * * *" -e CRON_ABORT="0 6 * * *" -e FORCE_SYNC=1 -e CHECK_URL=https://hchk.io/hchk_uuid pfidr/rclone +$ docker run --rm -it -v $(pwd)/config:/config -v /path/to/source:/source -e SYNC_SRC="/source" -e SYNC_DEST="dest:path" -e TZ="America/Chicago" -e CRON="0 0 * * *" -e CRON_ABORT="0 6 * * *" -e FORCE_SYNC=1 -e CHECK_URL=https://hchk.io/hchk_uuid ghcr.io/leandrofavarin/docker-rclone ``` See [rclone sync docs](https://rclone.org/commands/rclone_sync/) for source/dest syntax and additional options. -## Changelog - -+ **09/03/2024:** - * Update to latest Rclone (v1.67.0) -+ **07/06/2023:** - * Update to latest Rclone (v1.63.0) -+ **07/18/2022:** - * Update to latest Rclone (v1.59.0) -+ **04/25/2022:** - * Display exit code in console output - * Fix issue with healthcheck - * Update to latest Rclone (v1.58.0) -+ **11/18/2021:** - * Update to latest Rclone (v1.57.0) -+ **10/04/2021:** - * Update to latest Rclone (v1.56.2) -+ **09/27/2021:** - * Update to latest Rclone (v1.56.1) -+ **08/25/2021:** - * Update to latest Rclone (v1.56.0) -+ **06/25/2021:** - * Update to latest Rclone (v1.55.1) -+ **06/25/2021:** - * Update to latest Rclone (v1.55.0) -+ **03/10/2021:** - * Update to latest Rclone (v1.54.1) -+ **02/04/2021:** - * Update to latest Rclone (v1.54.0) -+ **01/22/2021:** - * Update to latest Rclone (v1.53.4) -+ **11/23/2020:** - * Update to latest Rclone (v1.53.3) -+ **10/28/2020:** - * Update to latest Rclone (v1.53.2) -+ **09/13/2020:** - * Update to latest Rclone (v1.53.1) -+ **09/05/2020:** - * Update to latest Rclone (v1.53.0) -+ **08/31/2020:** - * Add ability to send log data to healthchecks.io - See `HC_LOG` environment variable -+ **08/20/2020:** - * Update to latest Rclone (v1.52.3) -+ **06/25/2020:** - * Update to latest Rclone (v1.52.2) -+ **06/11/2020:** - * Update to latest Rclone (v1.52.1) -+ **05/28/2020:** - * Eval the entire rclone command - * Modify how rclone errors are interpreted when checking if source directory is empty -+ **05/27/2020:** - * Update to latest Rclone (v1.52.0) - * Add `RCLONE_DIR_CMD_DEPTH` option to declare recursion depth when checking if `SYNC_SRC` is empty - * Move call to signal start of healthchecks.io further up in the sync process - * Change when logs are deleted to make sure an active log is not deleted -+ **05/18/2020:** - * Modify how rclone errors are interpreted when passing results to healthchecks.io -+ **05/17/2020:** - * Handle spaces in `SYNC_SRC` and `SYNC_DEST` -+ **02/01/2020:** - * Update to latest Rclone (v1.51.0) -+ **11/20/2019:** - * Update to latest Rclone (v1.50.2) -+ **11/18/2019:** - * Add support for UID/GID -+ **11/06/2019:** - * Update to latest Rclone (v1.50.1) -+ **10/27/2019:** - * Update to latest Rclone (v1.50.0) -+ **10/07/2019:** - * Update to latest Rclone (v1.49.5) -+ **10/01/2019:** - * Update to latest Rclone (v1.49.4) -+ **09/23/2019:** - * Add environment variable SYNC_ONCE -+ **09/19/2019:** - * Add environment variable SYNC_OPTS_EVAL -+ **09/17/2019:** - * Update to latest Rclone (v1.49.3) -+ **09/10/2019:** - * Regression on log rotation -+ **09/09/2019:** - * Update to latest Rclone (v1.49.2) -+ **08/29/2019:** - * Update to latest Rclone (v1.49.1) -+ **08/20/2019:** - * Add start command for healthchecks.io calls - * Add debug messages for healthchecks.io calls -+ **08/19/2019:** - * Correct log rotation when there are no logs -+ **07/18/2019:** - * Optimizations to dockerfile -+ **06/22/2019:** - * Update to latest Rclone (v1.48.0) -+ **05/01/2019:** - * Initial release -


diff --git a/release-versions/latest.txt b/release-versions/latest.txt new file mode 100644 index 0000000..2da6866 --- /dev/null +++ b/release-versions/latest.txt @@ -0,0 +1 @@ +v1.68.1 \ No newline at end of file