diff --git a/scripts/build.sh b/scripts/build.sh index a0917776507be..a8737386fb3cc 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -70,15 +70,19 @@ 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 # 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 # 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 # Copy maven publications to be promoted +echo "Copying Maven publications to $OUTPUT/maven/org" cp -r ./build/local-test-repo/org/opensearch "${OUTPUT}"/maven/org # Assemble distribution artifact @@ -103,6 +107,20 @@ case $PLATFORM-$DISTRIBUTION-$ARCHITECTURE in TARGET="$PLATFORM-arm64-$PACKAGE" SUFFIX="$PLATFORM-arm64" ;; + linux-deb-x64) + PACKAGE="deb" + EXT="deb" + TYPE="packages" + TARGET="deb" + SUFFIX="amd64" + ;; + linux-deb-arm64) + PACKAGE="deb" + EXT="deb" + TYPE="packages" + TARGET="arm64-deb" + SUFFIX="arm64" + ;; linux-rpm-x64) PACKAGE="rpm" EXT="rpm" @@ -142,20 +160,24 @@ echo "Building OpenSearch for $PLATFORM-$DISTRIBUTION-$ARCHITECTURE" ./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 "opensearch-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 -echo "Building core plugins..." -mkdir -p "${OUTPUT}/core-plugins" -cd plugins -../gradlew assemble -Dbuild.snapshot="$SNAPSHOT" -Dbuild.version_qualifier=$QUALIFIER -cd .. -for plugin in plugins/*; do - PLUGIN_NAME=$(basename "$plugin") - if [ -d "$plugin" ] && [ "examples" != "$PLUGIN_NAME" ]; then - PLUGIN_ARTIFACT_BUILD_NAME=`ls "$plugin"/build/distributions/ | grep "$PLUGIN_NAME.*$IDENTIFIER.zip"` - cp "$plugin"/build/distributions/"$PLUGIN_ARTIFACT_BUILD_NAME" "${OUTPUT}"/core-plugins/"$PLUGIN_ARTIFACT_BUILD_NAME" - fi -done +# [WAZUH] we don't need to build the plugins +# echo "Building core plugins..." +# mkdir -p "${OUTPUT}/core-plugins" +# cd plugins +# ../gradlew assemble -Dbuild.snapshot="$SNAPSHOT" -Dbuild.version_qualifier=$QUALIFIER +# cd .. +# for plugin in plugins/*; do +# PLUGIN_NAME=$(basename "$plugin") +# if [ -d "$plugin" ] && [ "examples" != "$PLUGIN_NAME" ]; then +# PLUGIN_ARTIFACT_BUILD_NAME=`ls "$plugin"/build/distributions/ | grep "$PLUGIN_NAME.*$IDENTIFIER.zip"` +# cp "$plugin"/build/distributions/"$PLUGIN_ARTIFACT_BUILD_NAME" "${OUTPUT}"/core-plugins/"$PLUGIN_ARTIFACT_BUILD_NAME" +# fi +# done \ No newline at end of file