forked from opensearch-project/opensearch-build
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Opensearch security plugin windows install certs demo config and add …
…batch install script (opensearch-project#2704) * Security script for install.sh add windows specific changes Signed-off-by: Peter Zhu <zhujiaxi@amazon.com> * Add Windows install batch and resolve security plugin demo config issues Signed-off-by: Peter Zhu <zhujiaxi@amazon.com> * Add more comments Signed-off-by: Peter Zhu <zhujiaxi@amazon.com> * Add more comments Signed-off-by: Peter Zhu <zhujiaxi@amazon.com> * Add more comments Signed-off-by: Peter Zhu <zhujiaxi@amazon.com> * Add more comments Signed-off-by: Peter Zhu <zhujiaxi@amazon.com> * Add sql 2.4.0 Signed-off-by: Peter Zhu <zhujiaxi@amazon.com> * Add sql 2.4.0 Signed-off-by: Peter Zhu <zhujiaxi@amazon.com> * Add comments Signed-off-by: Peter Zhu <zhujiaxi@amazon.com> * Add comments Signed-off-by: Peter Zhu <zhujiaxi@amazon.com> * Add comments Signed-off-by: Peter Zhu <zhujiaxi@amazon.com> Signed-off-by: Peter Zhu <zhujiaxi@amazon.com> Signed-off-by: Monu Singh <msnghgw@amazon.com>
- Loading branch information
1 parent
af0121f
commit d218623
Showing
7 changed files
with
151 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
#!/bin/bash | ||
|
||
# Copyright OpenSearch Contributors | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
# The OpenSearch Contributors require contributions made to | ||
# this file be licensed under the Apache-2.0 license or a | ||
# compatible open source license. | ||
|
||
set -ex | ||
|
||
function usage() { | ||
echo "Usage: $0 [args]" | ||
echo "" | ||
echo "Arguments:" | ||
echo -e "-v VERSION\t[Required] OpenSearch version." | ||
echo -e "-s SNAPSHOT\t[Optional] Build a snapshot, default is 'false'." | ||
echo -e "-p PLATFORM\t[Optional] Platform, default is 'uname -s'." | ||
echo -e "-a ARCHITECTURE\t[Optional] Build architecture, default is 'uname -m'." | ||
echo -e "-f ARTIFACTS\t[Optional] Location of build artifacts." | ||
echo -e "-o OUTPUT\t[Optional] Output path." | ||
echo -e "-h help" | ||
} | ||
|
||
while getopts ":h:v:q:s:o:p:a:f:" 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 | ||
;; | ||
f) | ||
ARTIFACTS=$ARTIFACTS | ||
;; | ||
:) | ||
echo "Error: -${OPTARG} requires an argument" | ||
usage | ||
exit 1 | ||
;; | ||
?) | ||
echo "Invalid option: -${arg}" | ||
exit 1 | ||
;; | ||
esac | ||
done | ||
|
||
if [ -z "$VERSION" ]; then | ||
echo "Error: missing version." | ||
usage | ||
exit 1 | ||
fi | ||
|
||
[ -z "$SNAPSHOT" ] && SNAPSHOT="false" | ||
[ -z "$PLATFORM" ] && PLATFORM=$(uname -s | awk '{print tolower($0)}') | ||
[ -z "$ARCHITECTURE" ] && ARCHITECTURE=`uname -m` | ||
|
||
SECURITY_PLUGIN="opensearch-security" | ||
chmod -c 755 $OUTPUT/plugins/$SECURITY_PLUGIN/tools/*.sh | ||
|
||
if [ "$PLATFORM" = "windows" ]; then | ||
chmod -c 755 $OUTPUT/plugins/$SECURITY_PLUGIN/tools/*.bat | ||
|
||
# Temporary solution to run shell script on Windows through MinGW | ||
# Tracking issue: https://github.com/opensearch-project/security/issues/2148 | ||
$OUTPUT/plugins/$SECURITY_PLUGIN/tools/install_demo_configuration.sh -y -i -s | ||
fi |
File renamed without changes.
22 changes: 22 additions & 0 deletions
22
scripts/startup/zip/windows/opensearch-windows-install.bat
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
:: SPDX-License-Identifier: Apache-2.0 | ||
:: Copyright OpenSearch Contributors | ||
|
||
@echo off | ||
|
||
:: Set variables and cd into the location of the batch script | ||
PUSHD "%~dp0" | ||
SET "OPENSEARCH_HOME=%CD%" | ||
SET "OPENSEARCH_PATH_CONF=%OPENSEARCH_HOME%\config" | ||
|
||
:: Echo User Inputs | ||
ECHO "OPENSEARCH_HOME: %OPENSEARCH_HOME%" | ||
ECHO "OPENSEARCH_PATH_CONF: %OPENSEARCH_PATH_CONF%" | ||
|
||
:: Start OpenSearch | ||
ECHO Start OpenSearch | ||
IF "%~1" == "" ( | ||
CALL "%OPENSEARCH_HOME%\bin\opensearch.bat" | ||
) ELSE ( | ||
CALL "%OPENSEARCH_HOME%\bin\opensearch.bat" "%*" | ||
) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters