Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .changeset/site-build-replace-rsync.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
"dextinity-site": patch
---

Replace `rsync` with `cp` in the build CronJob

Since rsync 3.5.0 the build job fails when it writes the tar to the `generated-sites` volume, with `failed to set permissions on "/mnt/generated-sites/.build_<date>.tar.<suffix>": Operation not permitted` and exit code 23. rsync sets the permissions of the file it transfers and the volume does not allow that. No build reaches the volume, so the site keeps serving the previous one.

rsync has nothing to offer in this step anyway: it copies a single local file, without delta transfer or a remote host. `cp` takes the mode from the source while it creates the file and runs no `chmod` afterwards, so the volume accepts the copy. `rm` takes over what `--remove-source-files` did.
5 changes: 3 additions & 2 deletions templates/build-cron-job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,10 @@ spec:
export BUILD_FILE=/tmp/build_$(date +%F_%T).tar;
npm run next-build;
tar --force-local -cf $BUILD_FILE -C .next .;
rsync --remove-source-files $BUILD_FILE /mnt/generated-sites/;
cp $BUILD_FILE /mnt/generated-sites/;
rm -f $BUILD_FILE;
rm -f $(ls -1dt /mnt/generated-sites/* | tail -n +3);
curl -L https://storage.googleapis.com/kubernetes-release/release/v${KUBECTL_VERSION}/bin/linux/amd64/kubectl -o /tmp/kubectl;
curl -fL https://storage.googleapis.com/kubernetes-release/release/v${KUBECTL_VERSION}/bin/linux/amd64/kubectl -o /tmp/kubectl;
chmod u+x /tmp/kubectl;
NAMESPACE=$(cat /var/run/secrets/kubernetes.io/serviceaccount/namespace);
/tmp/kubectl rollout restart deployment {{ include "dextinity-site.fullname" . }} -n $NAMESPACE;
Expand Down
Loading