Skip to content

Commit cad1faf

Browse files
authored
Merge pull request #3480 from flatcar/kai/release-rclone
ci-automation/release: Set up rclone config for mapping into container
2 parents 50b4233 + 39a03b4 commit cad1faf

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

ci-automation/release.sh

Lines changed: 12 additions & 10 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,18 +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}"
174-
# Note: There is no "current" symlink and when switching the release to current we
175-
# could at a later stage (when the update payloads are selected in Nebraska) either
176-
# use folder copies where we delete the old "current" folder first, or we could
177-
# use a clever Caddy redirect to make "current" point to the wanted version for
178-
# each channel.
179+
)
179180
}
180181

181182
function publish_sdk() {
@@ -243,12 +244,13 @@ function _release_build_impl() {
243244
echo "===="
244245

245246

246-
# Future: trigger copy to Origin in a secure way
247247
# Future: trigger update payload signing
248+
249+
# In separate unified pipeline with sub jobs per channel?
248250
# Future: trigger website update
249251
# Future: trigger release email sending
250252
# Future: trigger push to nebraska
251-
# Future: trigger Origin symlink switch
253+
# Future: trigger Origin current-release.txt switch
252254
}
253255

254256
TEMPLATE='

0 commit comments

Comments
 (0)