Updates install-meta.sh and miseExec.sh for metawizard
This commit is contained in:
@@ -125,6 +125,8 @@ chmod_sh_files_recursively() {
|
|||||||
|
|
||||||
validate_dir "$REPO_DIR" "Please specify a GP's cloned git repository directory with --repo-dir or -r"
|
validate_dir "$REPO_DIR" "Please specify a GP's cloned git repository directory with --repo-dir or -r"
|
||||||
|
|
||||||
|
METAWIZARD_JAR_FILENAME=""
|
||||||
|
|
||||||
if $SHOULD_DOWNLOAD; then
|
if $SHOULD_DOWNLOAD; then
|
||||||
CDK_VERSION=$(get_cdk_version_from_gp_superparent_pom "$REPO_DIR/main/super-parent/pom.xml")
|
CDK_VERSION=$(get_cdk_version_from_gp_superparent_pom "$REPO_DIR/main/super-parent/pom.xml")
|
||||||
|
|
||||||
@@ -134,30 +136,23 @@ if $SHOULD_DOWNLOAD; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
ARTIFACTORY_REPOSITORY=$(get_maven_repo_from_version "$CDK_VERSION")
|
ARTIFACTORY_REPOSITORY=$(get_maven_repo_from_version "$CDK_VERSION")
|
||||||
|
METAWIZARD_ARTIFACTORY_PATH_WILDCARD="$ARTIFACTORY_REPOSITORY/br/com/cpqd/cdk/cpqd-cdk-meta-installer/$CDK_VERSION/cpqd-cdk-meta-installer-*.jar"
|
||||||
METAWIZARD_ARTIFACTORY_PATH="$ARTIFACTORY_REPOSITORY/br/com/cpqd/cdk/cpqd-cdk-meta-installer/$CDK_VERSION/cpqd-cdk-meta-installer-*.jar"
|
METAWIZARD_ARTIFACTORY_PATH=$(jf rt search --fail-no-op=true --sort-by=path "${METAWIZARD_ARTIFACTORY_PATH_WILDCARD}" | jq -r '.[].path')
|
||||||
|
METAWIZARD_JAR_FILENAME=$(basename ${METAWIZARD_ARTIFACTORY_PATH})
|
||||||
METAWIZARD_ARTIFACTORY_URL="https://artifactory.cpqd.com.br/artifactory/$(jf rt search --fail-no-op=true --sort-by=path "${METAWIZARD_ARTIFACTORY_PATH}" | jq -r '.[].path')"
|
METAWIZARD_ARTIFACTORY_URL="https://artifactory.cpqd.com.br/artifactory/${METAWIZARD_ARTIFACTORY_PATH}"
|
||||||
|
|
||||||
wget $METAWIZARD_ARTIFACTORY_URL
|
wget $METAWIZARD_ARTIFACTORY_URL
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
METAWIZARD_SH_FILE="wizard/metawizard.sh"
|
||||||
|
|
||||||
if $SHOULD_INSTALL_META; then
|
if $SHOULD_INSTALL_META; then
|
||||||
METAWIZARD_JAR_FILE=$(find * -type f -name '*.jar')
|
|
||||||
|
|
||||||
if [ -z "$METAWIZARD_JAR_FILE" ]; then
|
|
||||||
echo "Could not find MetaWizard's .jar file"
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "Please specify '$(pwd)' in MetaWizard's installation directory"
|
echo "Please specify '$(pwd)' in MetaWizard's installation directory"
|
||||||
|
|
||||||
java -jar $METAWIZARD_JAR_FILE
|
java -jar $METAWIZARD_JAR_FILENAME
|
||||||
|
|
||||||
chmod_sh_files_recursively "$(pwd)"
|
chmod_sh_files_recursively "$(pwd)"
|
||||||
|
|
||||||
METAWIZARD_SH_FILE=$(find * -type f -name 'metawizard.sh')
|
|
||||||
|
|
||||||
if [ -z "$METAWIZARD_SH_FILE" ]; then
|
if [ -z "$METAWIZARD_SH_FILE" ]; then
|
||||||
echo "Could not find MetaWizard's .sh file"
|
echo "Could not find MetaWizard's .sh file"
|
||||||
exit 0
|
exit 0
|
||||||
@@ -182,4 +177,7 @@ if $SHOULD_DO_POST_STEPS; then
|
|||||||
chmod +x ./$MKLINK_META_FILE
|
chmod +x ./$MKLINK_META_FILE
|
||||||
|
|
||||||
./$MKLINK_META_FILE $REPO_DIR
|
./$MKLINK_META_FILE $REPO_DIR
|
||||||
|
|
||||||
|
sed -i 's/256/2048/g' ./$METAWIZARD_SH_FILE
|
||||||
|
sed -i 's/512/4096/g' ./$METAWIZARD_SH_FILE
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#!/bin/env bash
|
#!/bin/env bash
|
||||||
|
|
||||||
show_help() {
|
show_help() {
|
||||||
echo "Usage: $(basename $0) [--preset|-p] [--executable|-e] [--dry-run|-d]"
|
echo "Usage: $(basename $0) [--preset|-p] [--executable|-e] [--dry-run|-d] [--help|h]"
|
||||||
echo "Options:"
|
echo "Options:"
|
||||||
echo " --help | -h (Optional) Display help information on how to use this script"
|
echo " --help | -h (Optional) Display help information on how to use this script"
|
||||||
echo " --preset | -p (Optional) Disables interactive preset selection and runs it"
|
echo " --preset | -p (Optional) Disables interactive preset selection and runs it"
|
||||||
@@ -44,6 +44,7 @@ MISE_TOOL_MAVEN_3_9_9="3.9.9"
|
|||||||
|
|
||||||
FILENAME_GP_DEBUGPORTS="debugports-01.sh"
|
FILENAME_GP_DEBUGPORTS="debugports-01.sh"
|
||||||
FILENAME_GEOSERVER="runstandalone.sh"
|
FILENAME_GEOSERVER="runstandalone.sh"
|
||||||
|
FILENAME_METAWIZARD="metawizard.sh"
|
||||||
|
|
||||||
list_presets() {
|
list_presets() {
|
||||||
echo "Choose one of the presets:"
|
echo "Choose one of the presets:"
|
||||||
@@ -51,7 +52,8 @@ list_presets() {
|
|||||||
echo " 2. Run GeoServer with Java 8"
|
echo " 2. Run GeoServer with Java 8"
|
||||||
echo " 3. Run GeoServer with Java 11"
|
echo " 3. Run GeoServer with Java 11"
|
||||||
echo " 4. Run Maven 3.3.3 with Java 8"
|
echo " 4. Run Maven 3.3.3 with Java 8"
|
||||||
echo " 4. Run Maven 3.8.4 with Java 11"
|
echo " 5. Run Maven 3.8.4 with Java 11"
|
||||||
|
echo " 6. Run MetaWizard with Java 8"
|
||||||
}
|
}
|
||||||
|
|
||||||
read_preset_input() {
|
read_preset_input() {
|
||||||
@@ -64,21 +66,23 @@ set_executable_filename_if_it_is_null() {
|
|||||||
|
|
||||||
select_preset_by_input() {
|
select_preset_by_input() {
|
||||||
case "$SELECTED_PRESET" in
|
case "$SELECTED_PRESET" in
|
||||||
"1")
|
"1" | "2")
|
||||||
set_executable_filename_if_it_is_null "$FILENAME_GP_DEBUGPORTS"
|
set_executable_filename_if_it_is_null "$FILENAME_GP_DEBUGPORTS"
|
||||||
MISE_TOOLS=("java@$MISE_TOOL_JAVA_8")
|
MISE_TOOLS=("java@$MISE_TOOL_JAVA_8")
|
||||||
;;
|
;;
|
||||||
"2")
|
|
||||||
set_executable_filename_if_it_is_null "$FILENAME_GP_DEBUGPORTS"
|
|
||||||
MISE_TOOLS=("java@$MISE_TOOL_JAVA_11")
|
|
||||||
;;
|
|
||||||
"3")
|
"3")
|
||||||
set_executable_filename_if_it_is_null "$FILENAME_GEOSERVER"
|
set_executable_filename_if_it_is_null "$FILENAME_GEOSERVER"
|
||||||
MISE_TOOLS=("java$MISE_TOOL_JAVA_8" "maven@$MISE_TOOL_MAVEN_3_3_3")
|
MISE_TOOLS=("java@$MISE_TOOL_JAVA_11" "maven@$MISE_TOOL_MAVEN_3_3_3")
|
||||||
;;
|
;;
|
||||||
"4")
|
"4")
|
||||||
set_executable_filename_if_it_is_null "$FILENAME_GEOSERVER"
|
MISE_TOOLS=("java@$MISE_TOOL_JAVA_8" "maven@$MISE_TOOL_MAVEN_3_9_9")
|
||||||
MISE_TOOLS=("java$MISE_TOOL_JAVA_11" "maven@$MISE_TOOL_MAVEN_3_9_9")
|
;;
|
||||||
|
"5")
|
||||||
|
MISE_TOOLS=("java@$MISE_TOOL_JAVA_11" "maven@$MISE_TOOL_MAVEN_3_9_9")
|
||||||
|
;;
|
||||||
|
"6")
|
||||||
|
set_executable_filename_if_it_is_null "$FILENAME_METAWIZARD"
|
||||||
|
MISE_TOOLS=("java@$MISE_TOOL_JAVA_8")
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
@@ -102,6 +106,7 @@ if [ ! -f "$EXECUTABLE_FILENAME" ]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# TODO, EXECUTABLE_FILENAME for maven options
|
||||||
COMMAND_TO_RUN=("mise" "exec" "${MISE_TOOLS[@]}" "--" "$EXECUTABLE_FILENAME")
|
COMMAND_TO_RUN=("mise" "exec" "${MISE_TOOLS[@]}" "--" "$EXECUTABLE_FILENAME")
|
||||||
|
|
||||||
[[ "$SHOULD_DRY_RUN" == true ]] && COMMAND_TO_RUN=("echo" "${COMMAND_TO_RUN[@]}")
|
[[ "$SHOULD_DRY_RUN" == true ]] && COMMAND_TO_RUN=("echo" "${COMMAND_TO_RUN[@]}")
|
||||||
|
|||||||
Reference in New Issue
Block a user