This is an automated email from the ASF dual-hosted git repository.

shuber pushed a commit to branch opensearch-persistence
in repository https://gitbox.apache.org/repos/asf/unomi.git

commit 0213604f7b32f338e5a5c1a7492cabe63c855f96
Author: Serge Huber <shu...@jahia.com>
AuthorDate: Tue Dec 17 15:02:55 2024 +0100

    - Remove old build scripts
    - Add option to new build script to be able to use opensearch with 
integration tests
---
 build.sh              | 15 ++++++++++++++-
 buildAndRun.sh        | 38 --------------------------------------
 buildAndRunNoTests.sh | 46 ----------------------------------------------
 compileDeploy.sh      | 37 -------------------------------------
 generate-package.sh   | 22 ----------------------
 5 files changed, 14 insertions(+), 144 deletions(-)

diff --git a/build.sh b/build.sh
index 01d3d3938..d53030d20 100755
--- a/build.sh
+++ b/build.sh
@@ -64,6 +64,7 @@ MAVEN_OFFLINE=false
 SEARCH_ENGINE="elasticsearch"
 KARAF_DEBUG_PORT=5005
 KARAF_DEBUG_SUSPEND=n
+USE_OPENSEARCH=false
 
 # Function to display usage
 usage() {
@@ -91,6 +92,7 @@ EOF
     echo "  --purge-maven-cache        Purge local Maven cache before building"
     echo "  --search-engine ENGINE     Set search engine 
(elasticsearch|opensearch)"
     echo "  --karaf-home PATH          Set Karaf home directory for deployment"
+    echo "  --use-opensearch          Use OpenSearch instead of ElasticSearch 
for tests"
     echo ""
     echo "Examples:"
     echo "  $0 --integration-tests --search-engine opensearch"
@@ -99,6 +101,7 @@ EOF
     echo "  $0 --purge-maven-cache --no-maven-cache"
     echo "  $0 -X --integration-tests    Run tests with Maven debug output"
     echo "  $0 -o -X                    Run offline with Maven debug output"
+    echo "  $0 --integration-tests --use-opensearch"
     exit 1
 }
 
@@ -147,6 +150,9 @@ while [ "$1" != "" ]; do
             shift
             CONTEXT_SERVER_KARAF_HOME=$1
             ;;
+        --use-opensearch)
+            USE_OPENSEARCH=true
+            ;;
         *)
             echo "Unknown option: $1"
             usage
@@ -244,7 +250,14 @@ fi
 # Add profile options
 PROFILES=""
 if [ "$RUN_INTEGRATION_TESTS" = true ]; then
-    PROFILES="$PROFILES,integration-tests,$SEARCH_ENGINE"
+    if [ "$USE_OPENSEARCH" = true ]; then
+        MVN_OPTS="$MVN_OPTS -Duse.opensearch=true -P opensearch"
+        echo "Running integration tests with OpenSearch"
+    else
+        MVN_OPTS="$MVN_OPTS -Duse.opensearch=false"
+        echo "Running integration tests with ElasticSearch"
+    fi
+    MVN_OPTS="$MVN_OPTS -P integration-tests"
 else
     if [ "$SKIP_TESTS" = true ]; then
         PROFILES="$PROFILES,!integration-tests,!run-tests"
diff --git a/buildAndRun.sh b/buildAndRun.sh
deleted file mode 100755
index df085ae5c..000000000
--- a/buildAndRun.sh
+++ /dev/null
@@ -1,38 +0,0 @@
-#!/bin/sh
-################################################################################
-#
-#    Licensed to the Apache Software Foundation (ASF) under one or more
-#    contributor license agreements.  See the NOTICE file distributed with
-#    this work for additional information regarding copyright ownership.
-#    The ASF licenses this file to You under the Apache License, Version 2.0
-#    (the "License"); you may not use this file except in compliance with
-#    the License.  You may obtain a copy of the License at
-#
-#       http://www.apache.org/licenses/LICENSE-2.0
-#
-#    Unless required by applicable law or agreed to in writing, software
-#    distributed under the License is distributed on an "AS IS" BASIS,
-#    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-#    See the License for the specific language governing permissions and
-#    limitations under the License.
-#
-################################################################################
-echo Building...
-DIRNAME=`dirname "$0"`
-PROGNAME=`basename "$0"`
-if [ -f "$DIRNAME/setenv.sh" ]; then
-  . "$DIRNAME/setenv.sh"
-fi
-mvn clean install -P integration-tests,rat
-if [ $? -ne 0 ]
-then
-    exit 1;
-fi
-pushd package/target
-echo Uncompressing Unomi package...
-tar zxvf unomi-$UNOMI_VERSION.tar.gz
-cd unomi-$UNOMI_VERSION/bin
-echo Apache Unomi features installed, use [unomi:start] to start it.
-./karaf debug
-popd
-
diff --git a/buildAndRunNoTests.sh b/buildAndRunNoTests.sh
deleted file mode 100755
index e3b2ecea8..000000000
--- a/buildAndRunNoTests.sh
+++ /dev/null
@@ -1,46 +0,0 @@
-#!/bin/sh
-################################################################################
-#
-#    Licensed to the Apache Software Foundation (ASF) under one or more
-#    contributor license agreements.  See the NOTICE file distributed with
-#    this work for additional information regarding copyright ownership.
-#    The ASF licenses this file to You under the Apache License, Version 2.0
-#    (the "License"); you may not use this file except in compliance with
-#    the License.  You may obtain a copy of the License at
-#
-#       http://www.apache.org/licenses/LICENSE-2.0
-#
-#    Unless required by applicable law or agreed to in writing, software
-#    distributed under the License is distributed on an "AS IS" BASIS,
-#    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-#    See the License for the specific language governing permissions and
-#    limitations under the License.
-#
-################################################################################
-echo Building...
-DIRNAME=`dirname "$0"`
-PROGNAME=`basename "$0"`
-if [ -f "$DIRNAME/setenv.sh" ]; then
-  . "$DIRNAME/setenv.sh"
-fi
-mvn clean install -P \!integration-tests,rat,\!run-tests -DskipTests
-if [ $? -ne 0 ]
-then
-    exit 1;
-fi
-pushd package/target
-echo Uncompressing Unomi package...
-tar zxvf unomi-$UNOMI_VERSION.tar.gz
-if [ -f "../../GeoLite2-City.mmdb" ]; then
-  echo Installing GeoLite2 City database...
-  cp ../../GeoLite2-City.mmdb unomi-$UNOMI_VERSION/etc
-fi
-if [ -f "../../allCountries.zip" ]; then
-  echo Installing Geonames countries database...
-  cp ../../allCountries.zip unomi-$UNOMI_VERSION/etc
-fi
-cd unomi-$UNOMI_VERSION/bin
-echo echo Apache Unomi features installed, use [unomi:start] to start it.
-./karaf debug
-popd
-
diff --git a/compileDeploy.sh b/compileDeploy.sh
deleted file mode 100755
index f1a511093..000000000
--- a/compileDeploy.sh
+++ /dev/null
@@ -1,37 +0,0 @@
-#!/bin/sh
-################################################################################
-#
-#    Licensed to the Apache Software Foundation (ASF) under one or more
-#    contributor license agreements.  See the NOTICE file distributed with
-#    this work for additional information regarding copyright ownership.
-#    The ASF licenses this file to You under the Apache License, Version 2.0
-#    (the "License"); you may not use this file except in compliance with
-#    the License.  You may obtain a copy of the License at
-#
-#       http://www.apache.org/licenses/LICENSE-2.0
-#
-#    Unless required by applicable law or agreed to in writing, software
-#    distributed under the License is distributed on an "AS IS" BASIS,
-#    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-#    See the License for the specific language governing permissions and
-#    limitations under the License.
-#
-################################################################################
-echo Setting up environment...
-DIRNAME=`dirname "$0"`
-PROGNAME=`basename "$0"`
-if [ -f "$DIRNAME/setenv.sh" ]; then
-  . "$DIRNAME/setenv.sh"
-fi
-if [ "x$CONTEXT_SERVER_KARAF_HOME" = "x" ]; then
-    
CONTEXT_SERVER_KARAF_HOME=~/java/deployments/context-server/apache-karaf-$KARAF_VERSION
-    export CONTEXT_SERVER_KARAF_HOME
-fi
-echo Compiling...
-mvn clean install
-echo Deploying KAR package to $CONTEXT_SERVER_KARAF_HOME/deploy...
-cp kar/target/unomi-kar-$UNOMI_VERSION.kar $CONTEXT_SERVER_KARAF_HOME/deploy/
-echo Purging Karaf local Maven repository, exploded KAR directory and 
temporary directory... 
-rm -rf $CONTEXT_SERVER_KARAF_HOME/data/maven/repository/*
-rm -rf $CONTEXT_SERVER_KARAF_HOME/data/tmp/*
-echo Compilation and deployment completed successfully.
diff --git a/generate-package.sh b/generate-package.sh
deleted file mode 100755
index 73084b931..000000000
--- a/generate-package.sh
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/bin/sh
-################################################################################
-#
-#    Licensed to the Apache Software Foundation (ASF) under one or more
-#    contributor license agreements.  See the NOTICE file distributed with
-#    this work for additional information regarding copyright ownership.
-#    The ASF licenses this file to You under the Apache License, Version 2.0
-#    (the "License"); you may not use this file except in compliance with
-#    the License.  You may obtain a copy of the License at
-#
-#       http://www.apache.org/licenses/LICENSE-2.0
-#
-#    Unless required by applicable law or agreed to in writing, software
-#    distributed under the License is distributed on an "AS IS" BASIS,
-#    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-#    See the License for the specific language governing permissions and
-#    limitations under the License.
-#
-################################################################################
-echo Building...
-mvn clean install -P !integration-tests,rat
-echo Package building completed.

Reply via email to