Delete dead scripts

This commit is contained in:
Michael Buckley 2019-06-24 17:05:31 -04:00
parent 581b18309e
commit 3b11f3d5f1
5 changed files with 0 additions and 167 deletions

View File

@ -1,89 +0,0 @@
#!/bin/bash
#
#Script for automatically exporting the apex application from APEX
#
# This script is designed to be run from the top level directory of your project and will break otherwise
function legacy_sqlplus_export {
if [ -z "${ORACLE_HOME}" ]; then
echo "Missing environment variable: ORACLE_HOME. Please add the path of your oracle installation to your environment variables under the variable name ORACLE_HOME"; exit 1
fi
if [ -z "${APEX_HOME}" ]; then
echo "Missing environment variable: APEX_HOME. Please add the path of your apex installation to your environment variables under the variable name APEX_HOME. Note: You should be using APEX version 5 or above"; exit 1
fi
if [ ! -e "${ORACLE_HOME}"/jdbc/lib/ojdbc6.jar ]; then
echo "Missing ojdbc6.jar: please download from oracle and put in ${ORACLE_HOME}/jdbc/lib directory"; exit 1
fi
if [ ! -e "${APEX_HOME}"/utilities/oracle/apex/APEXExport.class ]; then
echo "Missing APEXExport class. Please ensure you are using Apex 5 or above and have the APEXExport and APEXExportSplitter classes are in the $APEX_HOME/utilities/oracle/apex/ directory"; exit 1
fi
if [ ! -e "${APEX_HOME}"/utilities/oracle/apex/APEXExportSplitter.class ]; then
echo "Missing APEXExportSplitter class. Please ensure you are using Apex 5 or above and have the APEXExport and APEXExportSplitter classes are in the $APEX_HOME/utilities/oracle/apex/ directory"; exit 1
fi
source ./config/asc.conf
export CLASSPATH="${APEX_HOME}"/utilities:"${ORACLE_HOME}"/jdbc/lib/ojdbc6.jar
export_file="f${apexappid}.sql"
if [ -d apex/ ]; then
rm -r apex/
fi
if [ -e "${export_file}" ]; then
rm "${export_file}"
fi
java oracle.apex.APEXExport -db "${database_connection}" -user "${username}" -password "${password}" -applicationid "${apexappid}" -skipExportDate -expOriginalIds #
if [ ! 0 -eq "$?" ]; then
echo "Exit code #: $?. An error has occured while trying to use APEXExport. Please check that your database_connection, username, password, and apexappid variables are all set correctly."; exit 1
fi
java oracle.apex.APEXExportSplitter "${export_file}"
if [ ! 0 -eq "$?" ]; then
echo "Exit code #: $?. An error has occured while trying to use APEXExportSplitter. Please check that your apexappid variable is set correctly and that the application exists in the workspace you are trying to export from"; exit 1
fi
rm "${export_file}"
}
function main {
if which -s sql; then
source ./config/asc.conf
local connect_string="${username}/${password}@${database_connection}"
echo Using sqlcl to export app ${apexappid}
export_file="f${apexappid}.sql"
if [ -d apex/ ]; then
rm -r apex/
fi
if [ -e "${export_file}" ]; then
rm "${export_file}"
fi
sql "${connect_string}" @/dev/stdin <<EOF
apex export -skipExportDate -expOriginalIds -split -splitNoCheckSum -applicationid $apexappid
EOF
if [ -e "${export_file}" ]; then
rm "${export_file}"
fi
else
echo WARNING: Did not find SQLcl. Using legacy APEXExportSplitter instead
legacy_sqlplus_export
fi
mv "f${apexappid}" apex
# fixup install paths. The tool generates absolute paths
sed -E -i 'bak' 's^@(.*/)?application/^@apex/application/^' apex/install.sql
}
main

View File

@ -1,20 +0,0 @@
# designed to be called from frontrunner script
script_folder=$(dirname "${0}")
"${script_folder}"/check_conf_file.sh || exit 1
source config/asc.conf || exit 1
NLS_LANG=.AL32UTF8
export NLS_LANG
if which -s sql; then
sql_cmd=sql
else
echo WARNING: could not find SQLcl \(sql\). Falling back to sqlplus
sql_cmd=sqlplus
fi
if [ -z "${app_alias}" ]; then
#call install_apex with an empty app_alias string (will ask for user input otherwise)
${sql_cmd} "${username}"/"${password}"@"${database_connection}" @"${script_folder}"/install_apex.sql "${apexappid}" "${workspace_name}" "${parsing_schema}" '' || exit 1
else
${sql_cmd} "${username}"/"${password}"@"${database_connection}" @"${script_folder}"/install_apex.sql "${apexappid}" "${workspace_name}" "${parsing_schema}" "${app_alias}" || exit 1
fi

View File

@ -1,37 +0,0 @@
# designed to be called from top level project dir
script_folder=$(dirname $0)
source config/asc.conf || exit 1
if which -s sql; then
echo Running PWD $PWD
sql_cmd="sql -S"
else
echo WARNING: could not find SQLcl \(sql\). Falling back to sqlplus
sql_cmd="sqlplus -S"
fi
tmpfile=$(mktemp -t generate_app_id)
echo ${sql_cmd} ${username}/${password}@${database_connection} @${script_folder}/generate_new_app_id.sql $tmpfile || exit 1
${sql_cmd} ${username}/${password}@${database_connection} @${script_folder}/generate_new_app_id.sql > $tmpfile || exit 1
app_id=$(cat $tmpfile)
rm $tmpfile
if [ -h config/asc.conf ]; then
conf_file=$(readlink ./config/asc.conf)
echo -n "The id '${app_id}' will be written to '${conf_file}'. Is this alright? [y/N]: "
read can_write
if [ "${can_write}" == "y" ]; then
sed -i "s/^apexappid=.*/apexappid=${app_id}/" config/${conf_file}
echo "apexappid in '${conf_file}' has been replaced with '${app_id}'. The new config file looks like this: "
cat config/${conf_file}
else
echo -n "The generated app id was not written to file. "
echo "You can change this manually by changing the apexappid of your config to '${app_id}'"
fi
fi
rm -f config/new_app_id.txt

View File

@ -1,8 +0,0 @@
set serveroutput on
set feedback off
begin
apex_application_install.generate_application_id;
dbms_output.put_Line(apex_application_install.get_application_id);
end;
/
exit

View File

@ -1,13 +0,0 @@
# designed to be called from frontrunner script
script_folder=$(dirname $0)
"${script_folder}"/check_conf_file.sh || exit 1
source config/asc.conf || exit 1
if which -s sql; then
sql_cmd=sql
else
echo WARNING: could not find SQLcl \(sql\). Falling back to sqlplus
sql_cmd=sqlplus
fi
${sql_cmd} "${username}"/"${password}"@"${database_connection}" @"${script_folder}"/uninstall_apex.sql "${apexappid}" "${workspace_name}" "${parsing_schema}" || exit 1