A Drone plugin to push files to webdav
Go to file
opyale 33594bbc59
Uploading multiple files (README) (#7)
* First changes.

* Fixing typo.

* Making improvments.

* Removing unnecessary code.

* Improvements and code formatting

* Additional formatting.

* First changes.

* Fix

* Minor improvements.

* RM else

Co-authored-by: 6543 <6543@obermui.de>
2020-05-18 15:13:56 -07:00
.dockerignore Defaults to WEBDAV_* for username and password if not provided (#1) 2018-04-12 10:49:56 -07:00
Dockerfile Defaults to WEBDAV_* for username and password if not provided (#1) 2018-04-12 10:49:56 -07:00
push.sh Adding options for customization. (#5) 2020-05-17 19:53:22 -07:00
Readme.md Uploading multiple files (README) (#7) 2020-05-18 15:13:56 -07:00

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.

Examples

An example configuration would be as follows:

pipeline:
  upload_debug:
    image: vividboarder/drone-webdav
    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: myusername
    password: mypassword

You probably don't want to check your credentials into your repo, so you may use secrets for this:

pipeline:
  upload_debug:
    image: vividboarder/drone-webdav
    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

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.
An example, taken from the official documentation, would be to pass {dogs.png,cats.jpg} to PLUGIN_FILE.

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.
PLUGIN_CUSTOM_ARGUMENTS Additional arguments to be passed to curl.