-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ Add (s)ftp, git and cloud (via rclone) exporters
- Loading branch information
Showing
4 changed files
with
64 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
name: Cloud Exporter | ||
|
||
requires: | ||
- rclone | ||
|
||
data: | ||
# Path to the Google Drive folder | ||
path: | ||
|
||
# Name of the rclone remote(s) | ||
remotes: | ||
|
||
after: | ||
- log: [Uploading, blue, '{{ .Ctx.OutputDatabaseFile }} to{{ range $remote := (index .Data "remotes") }} {{$remote}}:{{ index $.Data "path" }}, {{ end }}[dim]with rclone'] | ||
- run: >- | ||
{{ range $remote := (index .Data "remotes") }} | ||
rclone copy --progress {{ $.Ctx.OutputDatabaseFile }} {{$remote}}:{{ index $.Data "path" }} | ||
{{ end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
name: FTP Uploader | ||
|
||
requires: | ||
- curl | ||
|
||
data: | ||
username: | ||
password: | ||
host: | ||
path: | ||
secure: true | ||
dry run: false | ||
|
||
after: | ||
- log: [Uploading, blue, '{{ .Ctx.OutputDatabaseFile }} to {{if (index .Data "secure")}}s{{end}}ftp://{{ index .Data "host" }}/{{ index .Data "path" }}'] | ||
- run: >- | ||
{{if .DryRun}} echo {{end}} | ||
curl -T {{ .Ctx.OutputDatabaseFile }} | ||
{{if (index .Data "secure")}}sftp://{{else}}ftp://{{end}}{{index .Data "username"}}:{{index .Data "password"}}@{{ index .Data "host" }}/{{ index .Data "path" }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: Git Uploader | ||
|
||
requires: | ||
- git | ||
|
||
data: | ||
# URL to the Git repository | ||
url: | ||
# Commit message used | ||
commit: | ||
|
||
after: | ||
# - run: test ! -d .ortfodb-tmp || echo .ortfodb-tmp exists, please remove it >&2; exit 1 | ||
- log: [Cloning, blue, 'repository {{ index .Data "url" }}'] | ||
- run: git clone {{ index .Data "url" }} .ortfodb-tmp | ||
- log: [Comitting, blue, "{{ .Ctx.OutputDatabaseFile }} to the repository"] | ||
- run: cp {{ .Ctx.OutputDatabaseFile }} .ortfodb-tmp | ||
- run: cd .ortfodb-tmp && git add {{ .Ctx.OutputDatabaseFile }} && git commit -m '{{ index .Data "commit" }}' | ||
- log: [Pushing, blue, "changes to the repository"] | ||
- run: cd .ortfodb-tmp && git push | ||
- log: [Cleaning up, dim, ".ortfodb-tmp directory"] | ||
- run: rm -rf .ortfodb-tmp |