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.

117 lines
3.7 KiB

4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 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/sothr/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: sothr/concourse-rclone-resource
  13. tag: latest
  14. ```
  15. ## Source Configuration
  16. * `config`: Required. The rclone config file contents to use.
  17. * `password`: Optional. Encryption password used for encrypted rclone configurations. Please use secrets management for this value.
  18. * `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.
  19. ### Example
  20. ```bash
  21. resources:
  22. - name: rclone
  23. type: rclone
  24. source:
  25. config: |
  26. [remote]
  27. client_id = <Your ID>
  28. client_secret = <Your Secret>
  29. scope = drive
  30. root_folder_id = <Your root folder id>
  31. service_account_file = /tmp/rclone/serviceAccountFile
  32. token = {"access_token":"XXX","token_type":"Bearer","refresh_token":"XXX","expiry":"2014-03-16T13:57:58.955387075Z"}
  33. files:
  34. serviceAccountFile: |
  35. ...contents...
  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. * `command`: Optional. The rclone command to run. Default `copy`
  49. * copy (default)
  50. * copyto (default)
  51. * move
  52. * sync
  53. * `args`: Optional. An array of additional arguments to pass to rclone.
  54. * `dedupe`: Optional. Run `rsync dedupe` after syncing files. Default `false`
  55. * `dedupeMode`: Optional. The dedupe mode to use. Default `newest`. [rclone dedupe](https://rclone.org/commands/rclone_dedupe/)
  56. * skip
  57. * first
  58. * newest (default)
  59. * oldest
  60. * largest
  61. * rename
  62. * `link`: Optional. Create a link to the resource if possible. Default `false`
  63. * `linkFilter`: Optional. A find filter on the source directory for files to generate links to. Default `-maxdepth 1 -type f`
  64. * `allowFailure`: Optional. Allow this destination to fail without failing the job. Default `false`
  65. * `sleep`: Optional. Sleep for this number of seconds after each Rclone command. Default `null`
  66. * `linkDestination`: Optional. Rclone location to store the generated link data.
  67. * `linkDestinationSubDir`: Optional. A file that includes additional path information to be appened to the end of the linkDestination.
  68. #### Example
  69. ```bash
  70. # Extends example in Source Configuration
  71. jobs:
  72. - name:
  73. plan:
  74. - do:
  75. - get: code # git resource
  76. - put: rclone
  77. params:
  78. source: code
  79. destination:
  80. - dir: "remote:backup"
  81. subdir: code/target
  82. - dir: "remote2:release"
  83. ```
  84. ## License
  85. Copyright 2020 Drew Short
  86. Licensed under the Apache License, Version 2.0 (the "License");
  87. you may not use this file except in compliance with the License.
  88. You may obtain a copy of the License at
  89. http://www.apache.org/licenses/LICENSE-2.0
  90. Unless required by applicable law or agreed to in writing, software
  91. distributed under the License is distributed on an "AS IS" BASIS,
  92. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  93. See the License for the specific language governing permissions and
  94. limitations under the License.