Skip to content

Commit be50958

Browse files
committed
release: sync alpha bincache assets to s3 bucket
Signed-off-by: Mathieu Tortuyaux <[email protected]>
1 parent 1a65456 commit be50958

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

ci-automation/release.sh

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,35 @@ function _inside_mantle() {
157157
)
158158
}
159159

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+
160189
function publish_sdk() {
161190
local docker_sdk_vernum="$1"
162191
local sdk_name=""
@@ -217,6 +246,11 @@ function _release_build_impl() {
217246
echo "===="
218247
echo "Done, now you can copy the images to Origin"
219248
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+
220254
# Future: trigger copy to Origin in a secure way
221255
# Future: trigger update payload signing
222256
# Future: trigger website update

0 commit comments

Comments
 (0)