From 7610d07b48b712dab5a5861aeb73ca0e7c234bc7 Mon Sep 17 00:00:00 2001 From: zyy17 Date: Fri, 20 Oct 2023 00:02:51 +0800 Subject: [PATCH] ci: refactor script of releasing charts to S3 (#73) --- .github/scripts/release-charts-to-s3.sh | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/.github/scripts/release-charts-to-s3.sh b/.github/scripts/release-charts-to-s3.sh index 2a01592..b1ee1ac 100755 --- a/.github/scripts/release-charts-to-s3.sh +++ b/.github/scripts/release-charts-to-s3.sh @@ -43,11 +43,20 @@ function release_charts_to_s3() { aws s3 cp "$chart"/"$package" s3://"$GREPTIME_RELEASE_BUCKET"/"$RELEASE_DIR"/"$chart"/"$version"/"$package" - # Create a latest directory will be more helpful when we want to download the latest version of a chart. - aws s3 cp "$chart"/"$package" s3://"$GREPTIME_RELEASE_BUCKET"/"$RELEASE_DIR"/"$chart"/latest/"$chart"-latest.tgz + echo "$version" > latest-version.txt + + # Create a latest-version.txt file in the chart directory. + aws s3 cp latest-version.txt s3://"$GREPTIME_RELEASE_BUCKET"/"$RELEASE_DIR"/"$chart"/latest-version.txt +} + +function main() { + update_greptime_charts + release_charts_to_s3 greptime greptimedb-operator + release_charts_to_s3 greptime greptimedb-standalone + release_charts_to_s3 greptime greptimedb-cluster + release_charts_to_s3 greptime greptimedb + release_charts_to_s3 oci://registry-1.docker.io/bitnamicharts etcd } -update_greptime_charts -release_charts_to_s3 greptime greptimedb-operator -release_charts_to_s3 greptime greptimedb -release_charts_to_s3 oci://registry-1.docker.io/bitnamicharts etcd +# The entrypoint for the script. +main