2023-07-03 19:29:36 +02:00
---
name: Nextcloud Upload
authors: Ellpeck
description: Upload files to Nextcloud using chunking and optionally add tags to files
tags: [deploy, publish]
containerImage: ellpeck/woodpecker-nextcloud-upload
containerImageUrl: https://hub.docker.com/r/ellpeck/woodpecker-nextcloud-upload
url: https://github.com/Ellpeck/WoodpeckerPlugins/tree/main/nextcloud-upload
---
2023-07-02 16:53:53 +02:00
# Nextcloud Upload
Simple plugin to upload files to Nextcloud using chunking, based on a glob pattern and a destination location. Note that, since this uses Nextcloud's built-in chunking system, it likely doesn't work for other WebDAV applications.
Here's an example of how to use it:
```yml
steps:
upload:
image: ellpeck/woodpecker-nextcloud-upload
settings:
2023-07-03 23:12:02 +02:00
# required settings
2023-07-02 16:53:53 +02:00
server: https://cloud.ellpeck.de # the server to use
user: EllBot # the user
token: access-token # the access token, or password if 2FA is disabled
2023-07-02 17:00:41 +02:00
files: # the file(s), uses glob patterns
- "**/*.md"
2023-07-02 16:53:53 +02:00
dest: Uploads/CoolMarkdownFiles # the destination directory
2023-07-03 23:12:02 +02:00
2023-07-16 22:13:50 +02:00
# optional retention settings, useful if old builds should be deleted automatically
retentionamount: 7 # amount of children that retentionbase is allowed to have before oldest ones are deleted on upload
retentionbase: Uploads # directory that the retentionamount applies to
2023-07-16 22:47:57 +02:00
retentionskiptrash: false # whether retention-based deletion should skip the Nextcloud trash, defaults to false
2023-07-16 22:13:50 +02:00
# misc optional settings
2023-07-03 23:12:02 +02:00
basedir: "." # local base directory for files, defaults to .
chunksize: # chunk size in bytes, defaults to 10485760, or 10 MiB
2023-07-16 22:47:57 +02:00
quiet: false # whether to reduce output, defaults to false
2023-07-03 23:12:02 +02:00
tags: # a set of tags to apply to uploaded files, tag is expected to already exist
2023-07-03 13:11:49 +02:00
- mytag
2023-07-16 22:47:57 +02:00
flatten: false # whether to flatten directories, causing all files to be placed directly in dest, defaults to false
2023-07-02 16:53:53 +02:00
```