Update readme & Add docs.md (#16)

* docs: use "from_secret"

- https://docs.drone.io/secret/repository/
- https://woodpecker-ci.org/docs/usage/secrets

* Update Readme.md

* Add docs.md to add it to the WoodpeckerCI-Plugin index

https://woodpecker-ci.org/plugins
This commit is contained in:
6543 2022-12-29 00:20:17 +01:00 committed by GitHub
parent 5f3f05247a
commit d9d0424b9f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 60 additions and 11 deletions

View File

@ -1,5 +1,6 @@
# drone-webdav
A WebDAV plugin, for the drone.io project, which allows you to push build artifacts to any WebDAV server, including Nextcloud or ownCloud.
A [Drone CI](https://www.drone.io/) / [Woodpecker CI](https://woodpecker-ci.org/) plugin, that will allow pushing build artifacts to any WebDAV server, including Nextcloud or ownCloud.
## Examples
@ -25,18 +26,18 @@ pipeline:
settings:
file: com.vividboarder.otbeta/build/outputs/apk/com.vividboarder.otbeta-debug.apk
destination: https://my.nextcloud.com/remote.php/dav/files/vividboarder/Android/Apks/
secrets:
- source: WEBDAV_USER
target: PLUGIN_USERNAME
- source: WEBDAV_PASSWORD
target: PLUGIN_PASSWORD
user:
from_secret: WEBDAV_USER
password:
from_secret: WEBDAV_PASSWORD
```
## FAQ
#### How do I upload multiple files at once?
Since this script uses **curl** to upload your files, you can use it's corresponding syntax.<br>
An example, taken from the official [documentation](https://curl.haxx.se/docs/manpage.html#-T), would be to pass ``{dogs.png,cats.jpg}`` to ``PLUGIN_FILE``.
### How do I upload multiple files at once?
Since this script uses **curl** to upload your files, you can use it's corresponding syntax.
An example, taken from the official [documentation](https://curl.se/docs/manpage.html#-T), would be to pass ``{dogs.png,cats.jpg}`` to ``PLUGIN_FILE``.
## Customization
@ -49,11 +50,12 @@ The following environment variables can be used for further cutomization:
| ``PLUGIN_ATTEMPTS`` | Defines how often a failed upload should be retried. Normally there is only one upload attempt. |
| ``PLUGIN_CUSTOM_ARGUMENTS`` | Additional arguments to be passed to `curl`. |
## Development
There are only two tests right now and they are configured using Docker Compose. To run them, just use
make test
```sh
make test
```
If someone wants to make this better (or add a Drone file) I'd gladly accept the patch.

47
docs.md Normal file
View File

@ -0,0 +1,47 @@
---
name: WebDAV
description: plugin to publish any artifacts to any WebDAV server
authors: vividboarder
tags: [deploy, publish]
containerImage: vividboarder/drone-webdav
containerImageUrl: https://hub.docker.com/r/vividboarder/drone-webdav
url: https://github.com/vividboarder/drone-webdav
---
A [Drone CI](https://www.drone.io/) / [Woodpecker CI](https://woodpecker-ci.org/) plugin,
that will allow pushing build artifacts to any [WebDAV](http://www.webdav.org/) server, including Nextcloud or ownCloud.
## Features
- Upload multiple files
- Use a proxy
- Retry on fail
## Settings
| Settings Name | Required | Description
| ------------------ |--------- | --------------------------------------------
| `file` | **✓** | File(s) to upload. Use [curl syntax](https://curl.se/docs/manpage.html#-T) for multiple (e.g. `{dogs.png,cats.jpg}`)
| `destination` | **✓** | The WebDav **folder** url
| `user` | **✓** | The WebDav-**User** to use
| `password` | | The **Password** for the WebDav-User
| `proxy_url` | | May be used to specify a proxy (e.g. `socks5://{ip_address}:{port}`
| `timeout` | | Defines a timeout (in seconds) to stop the upload after a certain time
| `attempts` | | Defines how often a failed upload should be retried. Normally there is only one upload attempt
| `custom_arguments` | | Additional arguments to be passed to [`curl`](https://curl.se/)
## Example
```yaml
pipeline:
upload_debug:
image: vividboarder/drone-webdav
settings:
file: com.vividboarder.otbeta/build/outputs/apk/com.vividboarder.otbeta-debug.apk
destination: https://my.nextcloud.com/remote.php/dav/files/vividboarder/Android/Apks/
user:
from_secret: WEBDAV_USER
password:
from_secret: WEBDAV_PASSWORD
```