@@ -157,6 +157,35 @@ function _inside_mantle() {
157
157
)
158
158
}
159
159
160
+ # _install_rclones pulls the latest version
161
+ # of 'rclone'
162
+ function _install_rclone() {
163
+ pushd $( mktemp --directory)
164
+
165
+ curl --fail --silent --location --show-error --remote-name \
166
+ https://downloads.rclone.org/rclone-current-linux-amd64.zip
167
+ # unzip without creating a directory to get binary at current level
168
+ unzip -j ./rclone-current-linux-amd64.zip
169
+ install ./rclone /usr/local/bin
170
+
171
+ popd
172
+ }
173
+
174
+ function copy_from_bincache_to_bucket() {
175
+ local channel=" ${1} "
176
+ local arch=" ${2} "
177
+ local version=" ${3} "
178
+
179
+ # assert that 'rclone' is available
180
+ if ! command -v rclone > /dev/null 2>&1
181
+ then
182
+ _install_rclone
183
+ fi
184
+
185
+ # TODO: Add 'r2' configuration as secret.
186
+ rclone sync --progress --http-url " https://${BUILDCACHE_SERVER} /${arch} /${version} " :http: " r2:flatcar/${channel} /${arch} /${version} "
187
+ }
188
+
160
189
function publish_sdk() {
161
190
local docker_sdk_vernum=" $1 "
162
191
local sdk_name=" "
@@ -217,6 +246,11 @@ function _release_build_impl() {
217
246
echo " ===="
218
247
echo " Done, now you can copy the images to Origin"
219
248
echo " ===="
249
+
250
+ echo " Experimental (i.e ignore if it fails) - copy the images to CloudFlare bucket for Alpha channel"
251
+ [[ " ${CHANNEL} " != " alpha" ]] && exit 0
252
+ copy_from_bincache_to_bucket " ${CHANNEL} " " ${arch} " " ${vernum} "
253
+
220
254
# Future: trigger copy to Origin in a secure way
221
255
# Future: trigger update payload signing
222
256
# Future: trigger website update
0 commit comments