fix(vyos-build): fix rclone file names

This commit is contained in:
JJGadgets
2024-03-03 02:45:29 +08:00
parent 813d534802
commit bd695cd505

View File

@@ -104,13 +104,15 @@ jobs:
RCLONE_FAST_LIST: "true"
RCLONE_UPDATE: "true"
RCLONE_USE_SERVER_MODTIME: "true"
run:
| # first copies ISO as is, then copies ISO with common "latest" filename (with some filters to avoid hardcoding and safeguard against uploading the wrong thing if somehow >1 file), then deletes files older than the past 5 number of files under that arch and builder name
run: | # first copies ISO as is, then copies ISO with common "latest" filename (with some filters to avoid hardcoding and safeguard against uploading the wrong thing if somehow >1 file), then deletes files older than the past 5 number of files under that arch and builder name
export FILE=$(find . -type f | tail -n 1)
rclone copyto "${FILE}" "r2:vyos-build/${FILE}"
rclone copyto "${FILE}" r2:vyos-build/${{ env.VYOS_ARCH }}.iso
rclone lsf --format=p r2:vyos-build | grep "${{ env.VYOS_BUILDER }}" | grep "${{ env.VYOS_ARCH }}" | tail -n +4 | rclone delete --files-from - r2:vyos-build
echo "File to upload:"
echo "${FILE}"
rclone copy ./ r2:vyos-build/
rclone copyto --s3-no-list-bucket "${FILE}" r2:vyos-build/${{ env.VYOS_ARCH }}.iso
rclone lsf --format=p r2:vyos-build | grep "${{ env.VYOS_BUILDER }}" | grep "${{ env.VYOS_ARCH }}" | tail -n +3 | rclone delete --files-from - r2:vyos-build
rclone cleanup r2:vyos-build
# --s3-no-list-bucket needed for single file copyto bucket root, https://github.com/rclone/rclone/issues/5271 https://forum.rclone.org/t/issue-using-copyto-for-single-files/38842
# OLD CHANGELOG, TODO: maybe add this as a CHANGELOG.md to R2 bucket?
# body: |