Skip to content

Commit d6e9bfe

Browse files
committed
ci/release: copy secondary artifacts from bincache
this logic takes care of copying binary packages, SDK and packages containers to cloudflare bucket in the `r2:flatcar/mirror/` location Signed-off-by: Mathieu Tortuyaux <[email protected]>
1 parent dfa08da commit d6e9bfe

File tree

1 file changed

+37
-1
lines changed

1 file changed

+37
-1
lines changed

ci-automation/release.sh

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,27 @@ function copy_from_bincache_to_bucket() {
175175
docker.io/rclone/rclone:1.71.1 \
176176
--config "/opt/rclone.conf" \
177177
sync \
178-
--http-url "https://${BUILDCACHE_SERVER}/images/${arch}/${version}" :http: "r2:flatcar/${channel}/${arch}-usr/${version}" || { echo "ERROR: Skipping bucket copy due to failure" ; }
178+
--http-url "https://${BUILDCACHE_SERVER}/images/${arch}/${version}" :http: "r2:flatcar/${channel}/${arch}-usr/${version}" || { echo "ERROR: Skipping images copy to bucket due to failure" ; }
179+
180+
echo "Copying the binary packages from bincache to CloudFlare bucket"
181+
docker run --rm --net host \
182+
-v "${rclone_configuration_file}:/opt/rclone.conf:ro" \
183+
docker.io/rclone/rclone:1.71.1 \
184+
--config "/opt/rclone.conf" \
185+
sync \
186+
--http-url "https://${BUILDCACHE_SERVER}/boards/${arch}-usr/${version}" :http: "r2:flatcar/mirror/boards/${arch}-usr/${version}" || { echo "ERROR: Skipping binary packages copy to bucket due to failure" ; }
187+
188+
# Only copy once the 'containers' artifacts
189+
if [ "${arch}" = "amd64" ]; then
190+
echo "Copying SDK and packages containers from bincache to CloudFlare bucket"
191+
docker run --rm --net host \
192+
-v "${rclone_configuration_file}:/opt/rclone.conf:ro" \
193+
docker.io/rclone/rclone:1.71.1 \
194+
--config "/opt/rclone.conf" \
195+
sync \
196+
--http-url "https://${BUILDCACHE_SERVER}/containers/${version}" :http: "r2:flatcar/mirror/containers/${version}" || { echo "ERROR: Skipping containers copy (SDK / packages) to bucket due to failure" ; }
197+
fi
198+
179199
)
180200
}
181201

@@ -200,6 +220,22 @@ function publish_sdk() {
200220
docker_image_from_registry_or_buildcache "${sdk_name}" "${docker_sdk_vernum}"
201221
docker push "${sdk_container_common_registry}/flatcar-sdk-${a}:${docker_sdk_vernum}"
202222
done
223+
224+
rclone_configuration_file="$(mktemp)"
225+
chmod 600 "${rclone_configuration_file}"
226+
227+
(
228+
trap "rm -f ${rclone_configuration_file}" EXIT
229+
echo "${RCLONE_CONFIGURATION_FILE}" | base64 --decode > "${rclone_configuration_file}"
230+
231+
echo "Copying the SDK from bincache to CloudFlare bucket"
232+
docker run --rm --net host \
233+
-v "${rclone_configuration_file}:/opt/rclone.conf:ro" \
234+
docker.io/rclone/rclone:1.71.1 \
235+
--config "/opt/rclone.conf" \
236+
sync \
237+
--http-url "https://${BUILDCACHE_SERVER}/sdk/amd64/${docker_sdk_vernum}" :http: "r2:flatcar/mirror/sdk/amd64/${docker_sdk_vernum}" || { echo "ERROR: Skipping SDK copy to bucket due to failure" ; }
238+
)
203239
}
204240

205241
function _release_build_impl() {

0 commit comments

Comments
 (0)