2018-04-12 00:26:31 +00:00
# drone-webdav
2022-12-28 23:20:17 +00:00
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.
2018-04-12 00:26:31 +00:00
2020-05-18 02:53:22 +00:00
## Examples
2018-04-12 00:26:31 +00:00
An example configuration would be as follows:
```yaml
pipeline:
upload_debug:
image: vividboarder/drone-webdav
2020-08-26 23:33:16 +00:00
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/
2020-08-26 23:35:39 +00:00
user: myusername
password: mypassword
2018-04-12 00:26:31 +00:00
```
You probably don't want to check your credentials into your repo, so you may use secrets for this:
```yaml
pipeline:
upload_debug:
image: vividboarder/drone-webdav
2020-08-26 23:33:16 +00:00
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/
2022-12-28 23:20:17 +00:00
user:
from_secret: WEBDAV_USER
password:
from_secret: WEBDAV_PASSWORD
2018-04-12 00:26:31 +00:00
```
2020-05-18 02:53:22 +00:00
2020-05-18 22:13:56 +00:00
## FAQ
2022-12-28 23:20:17 +00:00
### 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``.
2020-05-18 22:13:56 +00:00
2020-05-18 02:53:22 +00:00
## Customization
The following environment variables can be used for further cutomization:
| Variable | Description |
|-----------------------------|----------------------------------------------------------------------------------------------------------|
| ``PLUGIN_PROXY_URL`` | May be used to specify a proxy (e.g. ``socks5://{ip_address}:{port}``) |
| ``PLUGIN_TIMEOUT`` | Defines a timeout (in seconds) to stop the upload after a certain time. |
| ``PLUGIN_ATTEMPTS`` | Defines how often a failed upload should be retried. Normally there is only one upload attempt. |
2020-05-18 22:13:56 +00:00
| ``PLUGIN_CUSTOM_ARGUMENTS`` | Additional arguments to be passed to `curl` . |
2020-05-19 01:08:06 +00:00
## Development
There are only two tests right now and they are configured using Docker Compose. To run them, just use
2022-12-28 23:20:17 +00:00
```sh
make test
```
2020-05-19 01:08:06 +00:00
If someone wants to make this better (or add a Drone file) I'd gladly accept the patch.