diff --git a/scripts/build.sh b/scripts/build.sh index aab72e00c1485..55d9f96c1e838 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -71,15 +71,15 @@ fi [ -z "$OUTPUT" ] && OUTPUT=artifacts echo "Creating output directory $OUTPUT/maven/org/opensearch if it doesn't already exist" -mkdir -p $OUTPUT/maven/org/opensearch +mkdir -p "$OUTPUT/maven/org/opensearch" # Build project and publish to maven local. echo "Building and publishing OpenSearch project to Maven Local" -./gradlew publishToMavenLocal -Dbuild.snapshot=$SNAPSHOT -Dbuild.version_qualifier=$QUALIFIER +./gradlew publishToMavenLocal -Dbuild.snapshot="$SNAPSHOT" -Dbuild.version_qualifier="$QUALIFIER" # Publish to existing test repo, using this to stage release versions of the artifacts that can be released from the same build. echo "Publishing OpenSearch to Test Repository" -./gradlew publishNebulaPublicationToTestRepository -Dbuild.snapshot=$SNAPSHOT -Dbuild.version_qualifier=$QUALIFIER +./gradlew publishNebulaPublicationToTestRepository -Dbuild.snapshot="$SNAPSHOT" -Dbuild.version_qualifier="$QUALIFIER" # Copy maven publications to be promoted echo "Copying Maven publications to $OUTPUT/maven/org" @@ -89,7 +89,7 @@ cp -r ./build/local-test-repo/org/opensearch "${OUTPUT}"/maven/org # see https://github.com/opensearch-project/OpenSearch/blob/main/settings.gradle#L34 for other distribution targets [ -z "$PLATFORM" ] && PLATFORM=$(uname -s | awk '{print tolower($0)}') -[ -z "$ARCHITECTURE" ] && ARCHITECTURE=`uname -m` +[ -z "$ARCHITECTURE" ] && ARCHITECTURE=$(uname -m) [ -z "$DISTRIBUTION" ] && DISTRIBUTION="tar" case $PLATFORM-$DISTRIBUTION-$ARCHITECTURE in @@ -157,13 +157,13 @@ esac echo "Building OpenSearch for $PLATFORM-$DISTRIBUTION-$ARCHITECTURE" -./gradlew :distribution:$TYPE:$TARGET:assemble -Dbuild.snapshot=$SNAPSHOT -Dbuild.version_qualifier=$QUALIFIER +./gradlew ":distribution:$TYPE:$TARGET:assemble" -Dbuild.snapshot="$SNAPSHOT" -Dbuild.version_qualifier="$QUALIFIER" # Copy artifact to dist folder in bundle build output echo "Copying artifact to ${OUTPUT}/dist" -[[ "$SNAPSHOT" == "true" ]] && IDENTIFIER="-SNAPSHOT" -ARTIFACT_BUILD_NAME=`ls distribution/$TYPE/$TARGET/build/distributions/ | grep "wazuh-indexer-min.*$SUFFIX.$EXT"` +# [[ "$SNAPSHOT" == "true" ]] && IDENTIFIER="-SNAPSHOT" +ARTIFACT_BUILD_NAME=$(ls "distribution/$TYPE/$TARGET/build/distributions/" | grep "wazuh-indexer-min.*$SUFFIX.$EXT") # [WAZUH] Used by the GH workflow to upload the artifact echo "$ARTIFACT_BUILD_NAME" > "$OUTPUT/artifact_name.txt" mkdir -p "${OUTPUT}/dist" -cp distribution/$TYPE/$TARGET/build/distributions/$ARTIFACT_BUILD_NAME "${OUTPUT}"/dist/$ARTIFACT_BUILD_NAME +cp "distribution/$TYPE/$TARGET/build/distributions/$ARTIFACT_BUILD_NAME" "${OUTPUT}/dist/$ARTIFACT_BUILD_NAME"