diff --git a/build.gradle b/build.gradle index bf4cf9ba..ff0dbb84 100644 --- a/build.gradle +++ b/build.gradle @@ -385,12 +385,6 @@ task updateVersion { println "Setting version to ${newVersion}." // String tokenization to support -SNAPSHOT ant.replaceregexp(file:'build.gradle', match: '"opensearch.version", "\\d.*"', replace: '"opensearch.version", "' + newVersion.tokenize('-')[0] + '-SNAPSHOT"', flags:'g', byline:true) - ant.replaceregexp(file:'../.github/workflows/dashboards-reports-test-and-build-workflow.yml', match:'OPENSEARCH_PLUGIN_VERSION: \\d+.\\d+.\\d+.\\d+', replace:'OPENSEARCH_PLUGIN_VERSION: ' + newVersion.tokenize('-')[0] + '.0', flags:'g', byline:true) - ant.replaceregexp(file:'../.github/workflows/draft-release-notes-workflow.yml', match:'version: \\d+.\\d+.\\d+.\\d+', replace:'version: ' + newVersion.tokenize('-')[0] + '.0', flags:'g', byline:true) - // Match key version in JSON files. - ant.replaceregexp(file:'../dashboards-reports/opensearch_dashboards.json', match:'"version": "\\d+.\\d+.\\d+.\\d+', replace:'"version": ' + '"' + newVersion.tokenize('-')[0] + '.0', flags:'g', byline:true) - ant.replaceregexp(file:'../dashboards-reports/package.json', match:'"version": "\\d+.\\d+.\\d+.\\d+', replace:'"version": ' + '"' + newVersion.tokenize('-')[0] + '.0', flags:'g', byline:true) - // Match key opensearchDashboardsVersion in JSON files. - ant.replaceregexp(file:'../dashboards-reports/opensearch_dashboards.json', match:'"opensearchDashboardsVersion": "\\d+.\\d+.\\d+', replace:'"opensearchDashboardsVersion": ' + '"' + newVersion.tokenize('-')[0], flags:'g', byline:true) + ant.replaceregexp(file:'./.github/workflows/draft-release-notes-workflow.yml', match:'version: \\d+.\\d+.\\d+.\\d+', replace:'version: ' + newVersion.tokenize('-')[0] + '.0', flags:'g', byline:true) } } diff --git a/scripts/build.sh b/scripts/build.sh deleted file mode 100755 index 4b2893f3..00000000 --- a/scripts/build.sh +++ /dev/null @@ -1,82 +0,0 @@ -#!/bin/bash - -# -# Copyright OpenSearch Contributors -# SPDX-License-Identifier: Apache-2.0 -# - -set -ex - -function usage() { - echo "Usage: $0 [args]" - echo "" - echo "Arguments:" - echo -e "-v VERSION\t[Required] OpenSearch version." - echo -e "-q QUALIFIER\t[Optional] Version qualifier." - echo -e "-s SNAPSHOT\t[Optional] Build a snapshot, default is 'false'." - echo -e "-p PLATFORM\t[Optional] Platform, ignored." - echo -e "-a ARCHITECTURE\t[Optional] Build architecture, ignored." - echo -e "-o OUTPUT\t[Optional] Output path, default is 'artifacts'." - echo -e "-h help" -} - -while getopts ":h:v:q:s:o:p:a:" arg; do - case $arg in - h) - usage - exit 1 - ;; - v) - VERSION=$OPTARG - ;; - q) - QUALIFIER=$OPTARG - ;; - s) - SNAPSHOT=$OPTARG - ;; - o) - OUTPUT=$OPTARG - ;; - p) - PLATFORM=$OPTARG - ;; - a) - ARCHITECTURE=$OPTARG - ;; - :) - echo "Error: -${OPTARG} requires an argument" - usage - exit 1 - ;; - ?) - echo "Invalid option: -${arg}" - exit 1 - ;; - esac -done - -if [ -z "$VERSION" ]; then - echo "Error: You must specify the OpenSearch version" - usage - exit 1 -fi - -[[ ! -z "$QUALIFIER" ]] && VERSION=$VERSION-$QUALIFIER -[[ "$SNAPSHOT" == "true" ]] && VERSION=$VERSION-SNAPSHOT -[ -z "$OUTPUT" ] && OUTPUT=artifacts - -mkdir -p $OUTPUT - -./gradlew assemble --no-daemon --refresh-dependencies -DskipTests=true -Dopensearch.version=$VERSION -Dbuild.snapshot=$SNAPSHOT -Dbuild.version_qualifier=$QUALIFIER - -zipPath=$(find . -path \*build/distributions/*.zip) -distributions="$(dirname "${zipPath}")" - -echo "COPY ${distributions}/*.zip" -mkdir -p $OUTPUT/plugins -cp ${distributions}/*.zip ./$OUTPUT/plugins - -./gradlew publishPluginZipPublicationToZipStagingRepository -Dopensearch.version=$VERSION -Dbuild.snapshot=$SNAPSHOT -Dbuild.version_qualifier=$QUALIFIER -mkdir -p $OUTPUT/maven/org/opensearch -cp -r ./build/local-staging-repo/org/opensearch/. $OUTPUT/maven/org/opensearch