-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #410 from WeBankFinTech/dev-1.0.0
[release] Prepare for release DSS-1.0.0
- Loading branch information
Showing
2,707 changed files
with
186,571 additions
and
86,904 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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,109 @@ | ||
#!/bin/sh | ||
#Actively load user env | ||
source ~/.bashrc | ||
shellDir=`dirname $0` | ||
workDir=`cd ${shellDir}/..;pwd` | ||
|
||
SOURCE_ROOT=${workDir} | ||
|
||
#load config | ||
source ${SOURCE_ROOT}/conf/config.sh | ||
source ${SOURCE_ROOT}/conf/db.sh | ||
|
||
APPCONN_NAME='' | ||
APPCONN_INSTALL_IP=127.0.0.1 | ||
APPCONN_INSTALL_PORT=8088 | ||
|
||
#echo "Current path of init sql is ${DB_DML_PATH}" | ||
LOCAL_IP="`ifconfig | grep 'inet' | grep -v '127.0.0.1' | cut -d: -f2 | awk '{ print $2}'`" | ||
|
||
function isSuccess(){ | ||
if [ $? -ne 0 ]; then | ||
echo "Failed to " + $1 | ||
exit 1 | ||
else | ||
echo "Succeed to" + $1 | ||
fi | ||
} | ||
|
||
PROC_NAME=DSSProjectServerApplication | ||
ProcNumber=`ps -ef |grep -w $PROC_NAME|grep -v grep|wc -l` | ||
if [ $ProcNumber -le 0 ];then | ||
echo "${PROC_NAME} is not running,Please check whether DSS is installed" | ||
exit 1000 | ||
else | ||
echo "Begine to install appconn" | ||
fi | ||
|
||
##choose install mysql mode | ||
function initInstallAppConn() { | ||
echo "Please select the type of installation component?" | ||
echo " 1: schedulis" | ||
echo " 2: visualis" | ||
echo " 3:Your AppConn Name" | ||
echo " 4:exit" | ||
read -p "Please input the choice:" idx | ||
if [[ '1' = "$idx" ]];then | ||
APPCONN_NAME="schedulis" | ||
elif [[ '2' = "$idx" ]];then | ||
APPCONN_NAME="visualis" | ||
elif [[ '4' = "$idx" ]];then | ||
echo "no choice,exit!" | ||
exit 1 | ||
else | ||
APPCONN_NAME=$idx | ||
fi | ||
echo "Current installation component is ${APPCONN_NAME}" | ||
|
||
echo "" | ||
echo "If this machine(127.0.0.1) is installed, enter 1" | ||
echo "For others, you need to enter a complete IP address." | ||
read -p "Please enter the ip of appconn: " ip | ||
APPCONN_INSTALL_IP=$ip | ||
if [[ '1' = "$ip" ]];then | ||
APPCONN_INSTALL_IP="127.0.0.1" | ||
fi | ||
echo "You input ip is ${APPCONN_INSTALL_IP}" | ||
|
||
echo "" | ||
read -p "Please enter the port of appconn:" port | ||
APPCONN_INSTALL_PORT=$port | ||
echo "You input ip is ${APPCONN_INSTALL_PORT}" | ||
} | ||
|
||
function replaceCommonIp() { | ||
if [[ $APPCONN_INSTALL_IP == "127.0.0.1" ]] || [[ $APPCONN_INSTALL_IP == "0.0.0.0" ]];then | ||
echo "APPCONN_INSTALL_IP is equals $APPCONN_INSTALL_IP, we will change it to ip address" | ||
APPCONN_INSTALL_IP=$LOCAL_IP | ||
fi | ||
} | ||
|
||
##choose execute mysql mode | ||
function executeSQL() { | ||
TEMP_DB_DML_PATH=${SOURCE_ROOT}/dss-appconns/${APPCONN_NAME}/db | ||
DB_DML_PATH=$TEMP_DB_DML_PATH/init_real.sql | ||
cp -rf $TEMP_DB_DML_PATH/init.sql $DB_DML_PATH | ||
sed -i "s/APPCONN_INSTALL_IP/$APPCONN_INSTALL_IP/g" $DB_DML_PATH | ||
sed -i "s/APPCONN_INSTALL_PORT/$APPCONN_INSTALL_PORT/g" $DB_DML_PATH | ||
sed -i "s#DSS_INSTALL_HOME_VAL#$DSS_INSTALL_HOME#g" $DB_DML_PATH | ||
mysql -h$MYSQL_HOST -P$MYSQL_PORT -u$MYSQL_USER -p$MYSQL_PASSWORD -D$MYSQL_DB --default-character-set=utf8 -e "source $DB_DML_PATH" | ||
isSuccess "source $DB_DML_PATH" | ||
echo "the table update finished" | ||
} | ||
|
||
echo "" | ||
echo "step1:Initialize installation settings" | ||
initInstallAppConn | ||
echo "" | ||
|
||
echo "step2:replaceIp" | ||
replaceCommonIp | ||
echo "" | ||
|
||
echo "step3:update database" | ||
executeSQL | ||
echo "" | ||
|
||
echo "step4:refresh appconn load" | ||
curl -H "Token-Code:BML-AUTH" -H "Token-User:hadoop" -X GET http://${GATEWAY_INSTALL_IP}:${GATEWAY_PORT}/api/rest_j/v1/dss/framework/project/appconn/${APPCONN_NAME}/load | ||
echo "" |
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,102 @@ | ||
#!/bin/sh | ||
|
||
function checkExternalServer(){ | ||
echo "telnet check for your $SERVER_NAME, if you wait for a long time,may be your $SERVER_NAME does not prepared" | ||
result=`echo -e "\n" | telnet $EXTERNAL_SERVER_IP $EXTERNAL_SERVER_PORT 2>/dev/null | grep Connected | wc -l` | ||
if [ $result -eq 1 ]; then | ||
echo "$SERVER_NAME is OK." | ||
else | ||
echo "$SERVER_NAME is Bad. You need to prepare the' $SERVER_NAME ' environment in advance" | ||
exit 1 | ||
fi | ||
} | ||
|
||
## choose install mode | ||
function chooseInstallMode() { | ||
echo "Simple installation mode" | ||
#check for Java | ||
checkJava | ||
#check for mysql | ||
SERVER_NAME=MYSQL | ||
EXTERNAL_SERVER_IP=$MYSQL_HOST | ||
EXTERNAL_SERVER_PORT=$MYSQL_PORT | ||
checkExternalServer | ||
} | ||
|
||
##choose install mysql mode | ||
function chooseInstallMySQLMode() { | ||
echo "Do you want to clear Dss table information in the database?" | ||
echo " 1: Do not execute table-building statements" | ||
echo " 2: Dangerous! Clear all data and rebuild the tables." | ||
echo "" | ||
MYSQL_INSTALL_MODE=1 | ||
read -p "Please input the choice:" idx | ||
if [[ '2' = "$idx" ]];then | ||
MYSQL_INSTALL_MODE=2 | ||
echo "You chose Rebuild the table" | ||
elif [[ '1' = "$idx" ]];then | ||
MYSQL_INSTALL_MODE=1 | ||
echo "You chose not execute table-building statements" | ||
else | ||
echo "no choice,exit!" | ||
exit 1 | ||
fi | ||
|
||
##init db | ||
if [[ '2' = "$MYSQL_INSTALL_MODE" ]];then | ||
ENV_FLAG="dev" | ||
DB_CONF_PATH=${workDir}/db | ||
DB_DML_PATH=$DB_CONF_PATH/dss_dml_real.sql | ||
replaceAppConnInstanceSQL | ||
executeSQL | ||
fi | ||
} | ||
|
||
##choose execute mysql mode | ||
function executeSQL() { | ||
chooseInstallMode | ||
|
||
sed -i "s/GATEWAY_INSTALL_IP/$GATEWAY_INSTALL_IP/g" $DB_DML_PATH | ||
sed -i "s/GATEWAY_PORT/$GATEWAY_PORT/g" $DB_DML_PATH | ||
|
||
sed -i "s#DSS_INSTALL_HOME_VAL#$DSS_INSTALL_HOME#g" $DB_DML_PATH | ||
|
||
mysql -h$MYSQL_HOST -P$MYSQL_PORT -u$MYSQL_USER -p$MYSQL_PASSWORD -D$MYSQL_DB --default-character-set=utf8 -e "source $DB_CONF_PATH/dss_ddl.sql" | ||
isSuccess "source dss_ddl.sql" | ||
mysql -h$MYSQL_HOST -P$MYSQL_PORT -u$MYSQL_USER -p$MYSQL_PASSWORD -D$MYSQL_DB --default-character-set=utf8 -e "source $DB_DML_PATH" | ||
isSuccess "source dss_dml_real.sql" | ||
echo "Rebuild the table" | ||
} | ||
|
||
function replaceAppConnInstanceSQL() { | ||
DB_DML_PATH=$DB_CONF_PATH/dss_dml_real.sql | ||
cp -rf $DB_CONF_PATH/dss_dml.sql $DB_DML_PATH | ||
sed -i "s#ORCHESTRATOR_IP#$DSS_FRAMEWORK_ORCHESTRATOR_SERVER_INSTALL_IP#g" $DB_DML_PATH | ||
sed -i "s#ORCHESTRATOR_PORT#$DSS_FRAMEWORK_ORCHESTRATOR_SERVER_PORT#g" $DB_DML_PATH | ||
|
||
sed -i "s#WORKFLOW_IP#$DSS_WORKFLOW_SERVER_INSTALL_IP#g" $DB_DML_PATH | ||
sed -i "s#WORKFLOW_PORT#$DSS_WORKFLOW_SERVER_PORT#g" $DB_DML_PATH | ||
|
||
sed -i "s#EVENTCHECKER_JDBC_URL#$EVENTCHECKER_JDBC_URL#g" $DB_DML_PATH | ||
sed -i "s#EVENTCHECKER_JDBC_USERNAME#$EVENTCHECKER_JDBC_USERNAME#g" $DB_DML_PATH | ||
sed -i "s#EVENTCHECKER_JDBC_PASSWORD#$EVENTCHECKER_JDBC_PASSWORD#g" $DB_DML_PATH | ||
|
||
sed -i "s#DATACHECKER_JOB_JDBC_URL#$DATACHECKER_JOB_JDBC_URL#g" $DB_DML_PATH | ||
sed -i "s#DATACHECKER_JOB_JDBC_USERNAME#$DATACHECKER_JOB_JDBC_USERNAME#g" $DB_DML_PATH | ||
sed -i "s#DATACHECKER_JOB_JDBC_PASSWORD#$DATACHECKER_JOB_JDBC_PASSWORD#g" $DB_DML_PATH | ||
|
||
sed -i "s#DATACHECKER_BDP_JDBC_URL#$DATACHECKER_BDP_JDBC_URL#g" $DB_DML_PATH | ||
sed -i "s#DATACHECKER_BDP_JDBC_USERNAME#$DATACHECKER_BDP_JDBC_USERNAME#g" $DB_DML_PATH | ||
sed -i "s#DATACHECKER_BDP_JDBC_PASSWORD#$DATACHECKER_BDP_JDBC_PASSWORD#g" $DB_DML_PATH | ||
|
||
sed -i "s#BDP_MASK_IP#127.0.0.1#g" $DB_DML_PATH | ||
sed -i "s#BDP_MASK_PORT#8087#g" $DB_DML_PATH | ||
|
||
sed -i "s#EMAIL_HOST#${EMAIL_HOST}#g" $DB_DML_PATH | ||
sed -i "s#EMAIL_PORT#${EMAIL_PORT}#g" $DB_DML_PATH | ||
sed -i "s#EMAIL_USERNAME#${EMAIL_USERNAME}#g" $DB_DML_PATH | ||
sed -i "s#EMAIL_PASSWORD#${EMAIL_PASSWORD}#g" $DB_DML_PATH | ||
sed -i "s#EMAIL_PROTOCOL#${EMAIL_PROTOCOL}#g" $DB_DML_PATH | ||
} | ||
|
||
chooseInstallMySQLMode |
Oops, something went wrong.