Skip to content

Commit 72506be

Browse files
committed
Support windows zip for OpenSearch-min.
Signed-off-by: dblock <[email protected]>
1 parent 9924fe1 commit 72506be

File tree

1 file changed

+29
-5
lines changed

1 file changed

+29
-5
lines changed

scripts/components/OpenSearch/build.sh

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,18 +72,42 @@ mkdir -p $OUTPUT/maven/org/opensearch
7272
# Copy maven publications to be promoted
7373
cp -r ./build/local-test-repo/org/opensearch "${OUTPUT}"/maven/org
7474

75+
# Assemble distribution artifact
76+
# see https://github.com/opensearch-project/OpenSearch/blob/main/settings.gradle#L34 for other distribution targets
77+
7578
[ -z "$PLATFORM" ] && PLATFORM=`uname -s` | awk '{print tolower($0)}'
7679
[ -z "$ARCHITECTURE" ] && ARCHITECTURE=`uname -m`
7780

78-
# Assemble distribution artifact
79-
# see https://github.com/opensearch-project/OpenSearch/blob/main/settings.gradle#L34 for other distribution targets
81+
case "$(uname -s)" in
82+
Linux*)
83+
PACKAGE="tar"
84+
EXT="tar.gz"
85+
;;
86+
Darwin*)
87+
PACKAGE="tar"
88+
EXT="tar.gz"
89+
;;
90+
CYGWIN*)
91+
PACKAGE="zip"
92+
EXT="zip"
93+
;;
94+
MINGW*)
95+
PACKAGE="zip"
96+
EXT="zip"
97+
;;
98+
*)
99+
echo "Unsupported system: $(uname -s)"
100+
exit 1
101+
;;
102+
esac
103+
80104
case $ARCHITECTURE in
81105
x64)
82-
TARGET="$PLATFORM-tar"
106+
TARGET="$PLATFORM-$PACKAGE"
83107
QUALIFIER="$PLATFORM-x64"
84108
;;
85109
arm64)
86-
TARGET="$PLATFORM-arm64-tar"
110+
TARGET="$PLATFORM-arm64-$PACKAGE"
87111
QUALIFIER="$PLATFORM-arm64"
88112
;;
89113
*)
@@ -96,7 +120,7 @@ esac
96120

97121
# Copy artifact to dist folder in bundle build output
98122
[[ "$SNAPSHOT" == "true" ]] && IDENTIFIER="-SNAPSHOT"
99-
ARTIFACT_BUILD_NAME=`ls distribution/archives/$TARGET/build/distributions/ | grep "opensearch-min.*$QUALIFIER.tar.gz"`
123+
ARTIFACT_BUILD_NAME=`ls distribution/archives/$TARGET/build/distributions/ | grep "opensearch-min.*$QUALIFIER.$EXT"`
100124
mkdir -p "${OUTPUT}/dist"
101125
cp distribution/archives/$TARGET/build/distributions/$ARTIFACT_BUILD_NAME "${OUTPUT}"/dist/$ARTIFACT_BUILD_NAME
102126

0 commit comments

Comments
 (0)