From 4ef7fc03c7f0a726d2e25921dbaa9ef9b29b3b8f Mon Sep 17 00:00:00 2001 From: KeHaoKH Date: Fri, 9 Dec 2022 01:39:50 +0800 Subject: [PATCH 1/2] feat: check if the number of plugins on s3 is correct Signed-off-by: KeHaoKH --- hack/release/auto-release-darwin-arm64.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/hack/release/auto-release-darwin-arm64.sh b/hack/release/auto-release-darwin-arm64.sh index 3ed6ddf0d..12a5f64f2 100755 --- a/hack/release/auto-release-darwin-arm64.sh +++ b/hack/release/auto-release-darwin-arm64.sh @@ -71,3 +71,17 @@ echo "${DTM_CORE_BINARY} uploaded." # After downloading aws cli, you need to configure aws credentials. pip3 install awscli aws s3 cp $plugin_dir $STORAGE_URL_WITH_TAG --recursive --acl public-read + +# check if the number of plugins on s3 is correct +local_plugin_nums=$(./dtm list plugins |wc -l) +((local_plugin_file_nums=local_plugin_nums*6)) +s3_plugin_file_total_nums=$(aws s3 ls download.devstream.io/"$tag"/|awk '{print $NF}'|uniq|wc -l) +((s3_plugin_file_nums=s3_plugin_file_total_nums-3)) +echo "$s3_plugin_file_nums" +echo "$local_plugin_file_nums" +if [ "$local_plugin_file_nums" -ne "$s3_plugin_file_nums" ] +then + echo "Attention,Maybe the plugin uploaded to s3 is not correct." +else + echo "The plugin uploaded to s3 is not correct." +fi From 2b11064e287951b225f064d1c3eba1bcc2689b96 Mon Sep 17 00:00:00 2001 From: KeHaoKH Date: Fri, 9 Dec 2022 01:58:22 +0800 Subject: [PATCH 2/2] fix: modified the shell prompt to make it easy to understand Signed-off-by: KeHaoKH --- hack/release/auto-release-darwin-arm64.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hack/release/auto-release-darwin-arm64.sh b/hack/release/auto-release-darwin-arm64.sh index 12a5f64f2..c3b92117c 100755 --- a/hack/release/auto-release-darwin-arm64.sh +++ b/hack/release/auto-release-darwin-arm64.sh @@ -73,15 +73,15 @@ pip3 install awscli aws s3 cp $plugin_dir $STORAGE_URL_WITH_TAG --recursive --acl public-read # check if the number of plugins on s3 is correct -local_plugin_nums=$(./dtm list plugins |wc -l) +local_plugin_nums=$(../../dtm list plugins |wc -l) ((local_plugin_file_nums=local_plugin_nums*6)) s3_plugin_file_total_nums=$(aws s3 ls download.devstream.io/"$tag"/|awk '{print $NF}'|uniq|wc -l) ((s3_plugin_file_nums=s3_plugin_file_total_nums-3)) -echo "$s3_plugin_file_nums" -echo "$local_plugin_file_nums" +echo "s3_plugin_file_nums:" "$s3_plugin_file_nums" +echo "local_plugin_file_nums:" "$local_plugin_file_nums" if [ "$local_plugin_file_nums" -ne "$s3_plugin_file_nums" ] then echo "Attention,Maybe the plugin uploaded to s3 is not correct." else - echo "The plugin uploaded to s3 is not correct." + echo "The plugin uploaded to s3 is correct." fi