From 5baf1d4299ac40da01ee6117eed46cb92fc787d1 Mon Sep 17 00:00:00 2001 From: Muhammad Aqeel Date: Fri, 11 Jul 2025 17:16:57 +0500 Subject: [PATCH 1/3] [BR-86]: Updates script to copy artifacts in correct directory --- devel/util/copy-to-devel.sh | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/devel/util/copy-to-devel.sh b/devel/util/copy-to-devel.sh index a2f0ed78..ad7535ea 100755 --- a/devel/util/copy-to-devel.sh +++ b/devel/util/copy-to-devel.sh @@ -21,13 +21,27 @@ if [ ! -d $outDir ]; then exit 1 fi +# Check if $2 is empty +if [[ -z "$2" ]]; then + echo "Error: Second argument (mode) is required and must be either 'stable' or 'current'." + exit 1 +fi + +# Validate allowed values +if [[ "$2" != "stable" && "$2" != "current" ]]; then + echo "Error: Second argument must be either 'stable' or 'current'." + exit 1 +fi + +MODE=$2 + sleep 2 cd $outDir ls sleep 2 flags="--acl public-read --storage-class STANDARD --recursive" -BR=$BUCKET/REPO +BR=$BUCKET/REPO/$MODE set -x aws --region $REGION s3 cp . $BR $flags @@ -38,7 +52,7 @@ sleep 2 # content disposition header if [ $rc -eq 0 ] && [ -f "$offline_tgz_bndl" ]; then echo "Uploading offline bundle with content-disposition header" - aws --region $REGION s3 cp "$offline_tgz_bndl" "$BUCKET/REPO/" \ + aws --region $REGION s3 cp "$offline_tgz_bndl" "$BUCKET/REPO/$MODE" \ --acl public-read \ --content-disposition "attachment; filename=$offline_tgz_bndl" rc=$? # Capture exit code from second upload From c75f6b4cb79a158ec5ded23d2d8ea350459d0390 Mon Sep 17 00:00:00 2001 From: Muhammad Aqeel Date: Tue, 15 Jul 2025 15:24:49 +0500 Subject: [PATCH 2/3] [BR-86]: Updates script to create a subdirectory --- devel/util/copy-to-devel.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/devel/util/copy-to-devel.sh b/devel/util/copy-to-devel.sh index ad7535ea..21e2fe0f 100755 --- a/devel/util/copy-to-devel.sh +++ b/devel/util/copy-to-devel.sh @@ -33,7 +33,14 @@ if [[ "$2" != "stable" && "$2" != "current" ]]; then exit 1 fi +# Check if $3 is empty +if [[ -z "$3" ]]; then + echo "Error: Third argument (subdir) is required and it is a subdirectory inside 'stable' or 'current'." + exit 1 +fi + MODE=$2 +SUBDIR=$3 sleep 2 cd $outDir @@ -41,7 +48,7 @@ ls sleep 2 flags="--acl public-read --storage-class STANDARD --recursive" -BR=$BUCKET/REPO/$MODE +BR=$BUCKET/REPO/$MODE/$SUBDIR set -x aws --region $REGION s3 cp . $BR $flags @@ -52,7 +59,7 @@ sleep 2 # content disposition header if [ $rc -eq 0 ] && [ -f "$offline_tgz_bndl" ]; then echo "Uploading offline bundle with content-disposition header" - aws --region $REGION s3 cp "$offline_tgz_bndl" "$BUCKET/REPO/$MODE" \ + aws --region $REGION s3 cp "$offline_tgz_bndl" "$BUCKET/REPO/$MODE/$SUBDIR" \ --acl public-read \ --content-disposition "attachment; filename=$offline_tgz_bndl" rc=$? # Capture exit code from second upload From 1da80f48d5f1a90ea7f15c449cbf9781cc58404d Mon Sep 17 00:00:00 2001 From: Muhammad Aqeel Date: Tue, 15 Jul 2025 15:32:40 +0500 Subject: [PATCH 3/3] [BR-86]: Updates aws copy command to fix URL --- devel/util/copy-to-devel.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devel/util/copy-to-devel.sh b/devel/util/copy-to-devel.sh index 21e2fe0f..8ab38d15 100755 --- a/devel/util/copy-to-devel.sh +++ b/devel/util/copy-to-devel.sh @@ -59,7 +59,7 @@ sleep 2 # content disposition header if [ $rc -eq 0 ] && [ -f "$offline_tgz_bndl" ]; then echo "Uploading offline bundle with content-disposition header" - aws --region $REGION s3 cp "$offline_tgz_bndl" "$BUCKET/REPO/$MODE/$SUBDIR" \ + aws --region $REGION s3 cp "$offline_tgz_bndl" "$BUCKET/REPO/$MODE/$SUBDIR/" \ --acl public-read \ --content-disposition "attachment; filename=$offline_tgz_bndl" rc=$? # Capture exit code from second upload