Sign inSign up

vividboarder/drone-webdav

By vividboarder

Updated over 2 years ago

A Drone plugin to push files to a webdav server

Image
0

10K+

vividboarder/drone-webdav repository overview

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
    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: 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
    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

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:

VariableDescription
PLUGIN_PROXY_URLMay be used to specify a proxy (e.g. socks5://{ip_address}:{port})
PLUGIN_TIMEOUTDefines a timeout (in seconds) to stop the upload after a certain time.
PLUGIN_ATTEMPTSDefines how often a failed upload should be retried. Normally there is only one upload attempt.
PLUGIN_CUSTOM_ARGUMENTSAdditional 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

If someone wants to make this better (or add a Drone file) I'd gladly accept the patch.

Tag summary

Content type

Image

Digest

sha256:9d300c5d9

Size

5.2 MB

Last updated

over 2 years ago

docker pull vividboarder/drone-webdav