Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 30 additions & 4 deletions scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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.
./gradlew publishToMavenLocal -Dbuild.snapshot=$SNAPSHOT -Dbuild.version_qualifier=$QUALIFIER
echo "Building and publishing OpenSearch project to Maven Local"
./gradlew publishToMavenLocal -Dbuild.snapshot=$SNAPSHOT -Dbuild.version_qualifier=$QUALIFIER -PrustRelease

# Publish to existing test repo, using this to stage release versions of the artifacts that can be released from the same build.
./gradlew publishNebulaPublicationToTestRepository -Dbuild.snapshot=$SNAPSHOT -Dbuild.version_qualifier=$QUALIFIER
echo "Publishing OpenSearch to Test Repository"
./gradlew publishNebulaPublicationToTestRepository -Dbuild.snapshot=$SNAPSHOT -Dbuild.version_qualifier=$QUALIFIER -PrustRelease

# 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
Expand All @@ -103,6 +107,27 @@ case $PLATFORM-$DISTRIBUTION-$ARCHITECTURE in
TARGET="$PLATFORM-arm64-$PACKAGE"
SUFFIX="$PLATFORM-arm64"
;;
linux-tar-ppc64le)
PACKAGE="tar"
EXT="tar.gz"
TYPE="archives"
TARGET="$PLATFORM-ppc64le-$PACKAGE"
SUFFIX="$PLATFORM-ppc64le"
;;
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"
Expand Down Expand Up @@ -139,9 +164,10 @@ 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 -PrustRelease

# 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"`
mkdir -p "${OUTPUT}/dist"
Expand All @@ -150,7 +176,7 @@ cp distribution/$TYPE/$TARGET/build/distributions/$ARTIFACT_BUILD_NAME "${OUTPUT
echo "Building core plugins..."
mkdir -p "${OUTPUT}/core-plugins"
cd plugins
../gradlew assemble -Dbuild.snapshot="$SNAPSHOT" -Dbuild.version_qualifier=$QUALIFIER
../gradlew assemble -Dbuild.snapshot="$SNAPSHOT" -Dbuild.version_qualifier=$QUALIFIER -PrustRelease
cd ..
for plugin in plugins/*; do
PLUGIN_NAME=$(basename "$plugin")
Expand Down
Loading