Skip to content

Commit 3597af9

Browse files
authored
Merge pull request #3323 from flatcar/kai/r2-bucket
ci-automation/release.sh: Fix upload to R2
2 parents 2881481 + 97d0538 commit 3597af9

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

ci-automation/release.sh

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -164,9 +164,20 @@ function copy_from_bincache_to_bucket() {
164164
local arch="${2}"
165165
local version="${3}"
166166

167+
echo "Experimental (i.e ignore if it fails) - copy the images to CloudFlare bucket"
168+
(
169+
set +eu
167170
rclone --config "${RCLONE_CONFIGURATION_FILE}" \
168171
sync \
169-
--http-url "https://${BUILDCACHE_SERVER}/images/${arch}/${version}" :http: "r2:flatcar/${channel}/${arch}/${version}"
172+
--http-url "https://${BUILDCACHE_SERVER}/images/${arch}/${version}" :http: "r2:flatcar/${channel}/${arch}-usr/${version}"
173+
# Exit the function cleanly for now:
174+
true
175+
)
176+
# Note: There is no "current" symlink and when switching the release to current we
177+
# could at a later stage (when the update payloads are selected in Nebraska) either
178+
# use folder copies where we delete the old "current" folder first, or we could
179+
# use a clever Caddy redirect to make "current" point to the wanted version for
180+
# each channel.
170181
}
171182

172183
function publish_sdk() {
@@ -206,6 +217,8 @@ function _release_build_impl() {
206217
local vernum="${FLATCAR_VERSION}"
207218
local docker_vernum=""
208219
docker_vernum="$(vernum_to_docker_image_version "${vernum}")"
220+
local channel=
221+
channel="$(get_git_channel)"
209222

210223
local container_name="flatcar-publish-${docker_vernum}"
211224
local mantle_ref
@@ -222,6 +235,7 @@ function _release_build_impl() {
222235
create_digests "${SIGNER}" "aws-${arch}/flatcar_production_ami_"*txt "aws-${arch}/flatcar_production_ami_"*json
223236
sign_artifacts "${SIGNER}" "aws-${arch}/flatcar_production_ami_"*txt "aws-${arch}/flatcar_production_ami_"*json
224237
copy_to_buildcache "images/${arch}/${vernum}/" "aws-${arch}/flatcar_production_ami_"*txt* "aws-${arch}/flatcar_production_ami_"*json*
238+
copy_from_bincache_to_bucket "${channel}" "${arch}" "${vernum}"
225239
done
226240
if [ "${vernum}" = "${sdk_version}" ]; then
227241
publish_sdk "${docker_sdk_vernum}"
@@ -230,9 +244,6 @@ function _release_build_impl() {
230244
echo "Done, now you can copy the images to Origin"
231245
echo "===="
232246

233-
echo "Experimental (i.e ignore if it fails) - copy the images to CloudFlare bucket for Alpha channel"
234-
[[ "${CHANNEL}" != "alpha" ]] && exit 0
235-
copy_from_bincache_to_bucket "${CHANNEL}" "${arch}" "${vernum}"
236247

237248
# Future: trigger copy to Origin in a secure way
238249
# Future: trigger update payload signing

0 commit comments

Comments
 (0)