You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

108 lines
3.2 KiB

5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
  1. # concourse-rclone-resource
  2. A Concourse CI resource that executes [`rclone`](https://rclone.org/)
  3. against a remote host.
  4. See [Docker Hub](https://cloud.docker.com/repository/docker/warricksothr/concourse-rclone-resource)
  5. for tagged image versions available.
  6. ## Resource Type Configuration
  7. ```bash
  8. resource_types:
  9. - name: rclone
  10. type: docker-image
  11. source:
  12. repository: warricksothr/concourse-rclone-resource
  13. tag: latest
  14. files:
  15. serviceAccountFile: |
  16. ...contents...
  17. ```
  18. ## Source Configuration
  19. * `config`: Required. The rclone config file contents to use.
  20. * `password`: Optional. Encryption password used for encrypted rclone configurations. Please use secrets management for this value.
  21. * `files`: Optional. Additional files to write to the /tmp/rclone directory. This is a map of key/value pairs for the filename and contents of that file.
  22. ### Example
  23. ```bash
  24. resources:
  25. - name: rclone
  26. type: rclone
  27. source:
  28. config: |
  29. [remote]
  30. client_id = <Your ID>
  31. client_secret = <Your Secret>
  32. scope = drive
  33. root_folder_id = <Your root folder id>
  34. service_account_file = /tmp/rclone/serviceAccountFile
  35. token = {"access_token":"XXX","token_type":"Bearer","refresh_token":"XXX","expiry":"2014-03-16T13:57:58.955387075Z"}
  36. ```
  37. ### Note
  38. It's highly recommended to use secrets mangement to avoid storing sensitive credentials in the pipeline
  39. ## Behaviour
  40. ### `check`: No-Op
  41. ### `in`: No-Op
  42. ### `out`: Execute `rclone`
  43. #### Parameters
  44. * `source`: Required. The path to the source files.
  45. * `destination`: Required. A list of destinations to copy files to.
  46. * `dir`: Required. A rclone destination for the files. ex. `remote:some/location`
  47. * `subdir`: Optional. A file that includes additional path information to be appended to the end of destination.
  48. * `dedupe`: Optional. Run `rsync dedupe` after syncing files. Default `false`
  49. * `dedupeMode`: Optional. The dedupe mode to use. Default `newest`. [rclone dedupe](https://rclone.org/commands/rclone_dedupe/)
  50. * skip
  51. * first
  52. * newest (default)
  53. * oldest
  54. * largest
  55. * rename
  56. * `link`: Optional. Create a link to the resource if possible. Default `false`
  57. * `linkFilter`: Optional. A find filter on the source directory for files to generate links to. Default `-maxdepth 1 -type f`
  58. * `args`: Optional. An array of additional arguments to pass to rclone.
  59. #### Example
  60. ```bash
  61. # Extends example in Source Configuration
  62. jobs:
  63. - name:
  64. plan:
  65. - do:
  66. - get: code # git resource
  67. - put: rclone
  68. params:
  69. source: code
  70. destination:
  71. - dir: "remote:backup"
  72. subdir: code/target
  73. - dir: "remote2:release"
  74. ```
  75. ## License
  76. Copyright 2020 Drew Short
  77. Licensed under the Apache License, Version 2.0 (the "License");
  78. you may not use this file except in compliance with the License.
  79. You may obtain a copy of the License at
  80. http://www.apache.org/licenses/LICENSE-2.0
  81. Unless required by applicable law or agreed to in writing, software
  82. distributed under the License is distributed on an "AS IS" BASIS,
  83. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  84. See the License for the specific language governing permissions and
  85. limitations under the License.