Deploying an ISO to Nextcloud

SergeantBiggs

system administrationlinuxarchlinuxcicddrone

348 Words

2022-06-20 09:10 +0000


I recently wrote an article on building a custom ArchLinux-based live distro with Drone. This setup has worked quite well for me, and it saved me a lot of time in the long run. There’s just one thing that bothers me about it: after it is built, the ISO is copied to an open directory. I can then download the ISO from there and flash it onto a USB. I wanted to make sure that the ISO is actually “deployed” on all of my devices after it’s built, so I don’t have to download it manually. This also removes the possibility of there being multiple versions on multiple machines, and saves me the hassle of always having to remember to download it.

I decided the best way of doing this would be via NextCloud. I have a NextCloud server, which syncs important files between my devices. This would be the perfect tool for “deploying” the new ISO to all of the devices that it is needed on.

Nextcloud has an API for their WebDAV implementation. This allows us to use WebDav operations to download, upload, and change files on the server. This is pretty much ideal for our use case. Since WebDAV is an extension of HTTP, I can use my favourite API client (curl + bash).

#!/usr/bin/env bash
USERNAME="clouduser"
FILE="spart.iso"

curl -u "${USERNAME}:${PASSWORD}" \
    https://cloud.example.com/remote.php/dav/files/clouduser/ISO/"$FILE" \
    -T "$BUILD_DIR/out/$FILE"

Our client will need a password. To provide this, we can create an Application Password in NextCloud. After generating it, we will use Drone to provide the password to our script. We don’t want to store our password in plain text, so we can use drones secret management. Secrets are defined per repository under settings -> secrets. After adding our secret, we can use it in our pipeline.

kind: pipeline
type: exec
name: default

steps:
- name: upload iso to nextcloud
  commands:
    - ./extra/upload/upload-to-nextcloud.sh
  environment:
    BUILD_DIR: /media/fast/cryptset/builds/spart
    PASSWORD:
        from_secret: nc_password

trigger:
  branch:
  - main

Drone continues to be a very useful tool, and I look forward to doing more stuff with it. I hope you enjoyed reading this article!

Articles from blogs I read

Claude Code won April Fools Day this year

They gave people a heckin tamagochi, what's not to like?

via Xe Iaso's blog April 1, 2026

tar: a slop-free alternative to rsync

So apparently rsync is slop now. When I heard, I wanted to drop a quick note on my blog to give an alternative: tar. It doesn’t do everything that rsync does, in particular identifying and skipping up-to-date files, but tar + ssh can definitely accomodate th…

via Drew DeVault's blog March 28, 2026

Mastodon Stories for systemd v260

On March 17 we released systemd v260 into the wild. In the weeks leading up to that release (and since then) I have posted a series of serieses of posts to Mastodon about key new features in this release, under the #systemd260 hash tag. In case you aren't …

via Pid Eins March 27, 2026

What happens if we represent unix time as floats?

When evaluating the performance of some software component, I want to get high precision. But when I talk about millions of years in the future, I don't care about the exact second.

via Ξ January 16, 2026

Generated by openring