diff --git a/.gitea/workflows/deploy.yaml b/.gitea/workflows/deploy.yaml index 9f12b60..fe71674 100644 --- a/.gitea/workflows/deploy.yaml +++ b/.gitea/workflows/deploy.yaml @@ -96,23 +96,32 @@ jobs: - name: ship artifacts run: | - R="--rsync-path=sudo rsync --mkpath" + # An array, not a string. `R="--rsync-path=sudo rsync --mkpath"` used + # as `rsync $R` word-splits into three arguments — `--rsync-path=sudo` + # plus a stray `rsync` that rsync reads as a source path — and the + # remote end runs `sudo --server`, which sudo rejects. + # + # --mkpath because rsync will not create a missing destination + # directory for a single-file copy, and Fedora ships neither + # /etc/sysusers.d nor /etc/firewalld/services + # (architecture/deployment-gitea-actions.md §6). + R=(--rsync-path="sudo rsync --mkpath") B=target/x86_64-unknown-linux-musl/release - rsync $R --chmod 0755 "$B/tireless-api" \ + rsync "${R[@]}" --chmod 0755 "$B/tireless-api" \ gitea_ci@"$API_HOST":/usr/local/bin/tireless-api - rsync $R --chmod 0755 "$B/tireless-worker" \ + rsync "${R[@]}" --chmod 0755 "$B/tireless-worker" \ gitea_ci@"$API_HOST":/usr/local/bin/tireless-worker - rsync $R --chmod 0755 "$B/tireless" \ + rsync "${R[@]}" --chmod 0755 "$B/tireless" \ gitea_ci@"$API_HOST":/usr/local/bin/tireless - rsync $R --chmod 0640 config.toml \ + rsync "${R[@]}" --chmod 0640 config.toml \ gitea_ci@"$API_HOST":/etc/tireless/config.toml - rsync $R asset/systemd/tireless.sysusers.conf \ + rsync "${R[@]}" asset/systemd/tireless.sysusers.conf \ gitea_ci@"$API_HOST":/etc/sysusers.d/tireless.conf for unit in tireless-api tireless-poller tireless-runner; do - rsync $R "asset/systemd/$unit.service" \ + rsync "${R[@]}" "asset/systemd/$unit.service" \ gitea_ci@"$API_HOST":"/etc/systemd/system/$unit.service" done - rsync $R asset/firewalld/tireless-api.xml \ + rsync "${R[@]}" asset/firewalld/tireless-api.xml \ gitea_ci@"$API_HOST":/etc/firewalld/services/tireless-api.xml - name: ship dashboard @@ -129,8 +138,11 @@ jobs: run: | ssh gitea_ci@"$API_HOST" bash -euo pipefail <