Skip to content

Commit

Permalink
Automate releases
Browse files Browse the repository at this point in the history
  • Loading branch information
leandrofavarin committed Sep 28, 2024
1 parent 1962544 commit 0c0aecf
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 100 deletions.
Original file line number Diff line number Diff line change
@@ -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
Expand Down
29 changes: 29 additions & 0 deletions .github/workflows/release-checker.yml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
2 changes: 2 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
Copyright 2024 Leandro Favarin

Copyright 2019 Pfidr34

Copyright 2017 Brian J. Cardiff
Expand Down
102 changes: 4 additions & 98 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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

<br />
<br />
<br />
Expand Down
1 change: 1 addition & 0 deletions release-versions/latest.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v1.68.1

0 comments on commit 0c0aecf

Please sign in to comment.