Skip to content

Commit 0702b7b

Browse files
committed
ci-automation/release: Set up rclone config for mapping into container
The wrong variable was used to set up the mapping of the rclone config into the rclone container and it wasn't set up in the right function. Move it into the right function and use the right variable name but also don't rely on /proc/PID/fd/FD to be mappable into the container but instead use a regular temp file. Signed-off-by: Kai Lueke <kailuke@microsoft.com>
1 parent 50b4233 commit 0702b7b

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

ci-automation/release.sh

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,6 @@ function _inside_mantle() {
9191
secret_to_file gcp_json_key_path "${GCP_JSON_KEY}"
9292
google_release_credentials_file=""
9393
secret_to_file google_release_credentials_file "${GOOGLE_RELEASE_CREDENTIALS}"
94-
rclone_configuration_file=""
95-
secret_to_file rclone_configuration_file "${RCLONE_CONFIGURATION_FILE}"
9694

9795
for platform in aws azure; do
9896
for arch in amd64 arm64; do
@@ -164,13 +162,21 @@ function copy_from_bincache_to_bucket() {
164162
local arch="${2}"
165163
local version="${3}"
166164

165+
rclone_configuration_file="$(mktemp)"
166+
chmod 600 "${rclone_configuration_file}"
167+
168+
(
169+
trap "rm -f ${rclone_configuration_file}" EXIT
170+
echo "${RCLONE_CONFIGURATION_FILE}" | base64 --decode > "${rclone_configuration_file}"
171+
167172
echo "Copying the images from bincache to CloudFlare bucket"
168173
docker run --rm \
169-
-v "${RCLONE_CONFIGURATION_FILE}:/opt/rclone.conf:ro" \
174+
-v "${rclone_configuration_file}:/opt/rclone.conf:ro" \
170175
docker.io/rclone/rclone:1.71.1 \
171176
--config "/opt/rclone.conf" \
172177
sync \
173178
--http-url "https://${BUILDCACHE_SERVER}/images/${arch}/${version}" :http: "r2:flatcar/${channel}/${arch}-usr/${version}"
179+
)
174180
# Note: There is no "current" symlink and when switching the release to current we
175181
# could at a later stage (when the update payloads are selected in Nebraska) either
176182
# use folder copies where we delete the old "current" folder first, or we could

0 commit comments

Comments
 (0)