Skip to content
Browse files

Scripts modified and nspslalog properties using jboss.server.config.u…

…rl property
  • Loading branch information...
1 parent 26df835 commit fb7f3ea2e3a28bbe5fc9c3caf2457828bdd875d7 @frjtrifork frjtrifork committed Mar 30, 2012
View
3 .gitignore
@@ -22,4 +22,5 @@ release.properties
*.ipr
*.iws
Dokumentation
-.DS_Store
+.DS_Store
+_install/
View
2 etc/slalog_config_files/nspslalog-stamdata-authorization-lookup.properties
@@ -1,2 +1,2 @@
nspslalog.log4j.configure=true
-dk.sdsd.nsp.slalog.log4j.configuration.url=file:/Users/frj/dev/tools/jboss-6.0.0.Final-NSP/server/default/conf/log4j-nspslalog-stamdata-authorization-lookup.properties
+dk.sdsd.nsp.slalog.log4j.configuration.url=${jboss.server.config.url}log4j-nspslalog-stamdata-authorization-lookup.properties
View
2 etc/slalog_config_files/nspslalog-stamdata-batch-copy.properties
@@ -1,2 +1,2 @@
nspslalog.log4j.configure=true
-dk.sdsd.nsp.slalog.log4j.configuration.url=file:/Users/frj/dev/tools/jboss-6.0.0.Final-NSP/server/default/conf/log4j-nspslalog-stamdata-batch-copy.properties
+dk.sdsd.nsp.slalog.log4j.configuration.url=${jboss.server.config.url}log4j-nspslalog-stamdata-batch-copy.properties
View
2 etc/slalog_config_files/nspslalog-stamdata-cpr.properties
@@ -1,2 +1,2 @@
nspslalog.log4j.configure=true
-dk.sdsd.nsp.slalog.log4j.configuration.url=file:/Users/frj/dev/tools/jboss-6.0.0.Final-NSP/server/default/conf/log4j-nspslalog-stamdata-cpr.properties
+dk.sdsd.nsp.slalog.log4j.configuration.url=${jboss.server.config.url}log4j-nspslalog-stamdata-cpr.properties
View
2 etc/slalog_config_files/nspslalog-stamdata-data-manager.properties
@@ -1,2 +1,2 @@
nspslalog.log4j.configure=true
-dk.sdsd.nsp.slalog.log4j.configuration.url=file:/Users/frj/dev/tools/jboss-6.0.0.Final-NSP/server/default/conf/log4j-nspslalog-stamdata-data-manager.properties
+dk.sdsd.nsp.slalog.log4j.configuration.url=${jboss.server.config.url}log4j-nspslalog-stamdata-data-manager.properties
View
46 sdm_dodi_install.sh
@@ -1,8 +1,9 @@
#!/bin/bash
set -e
-db_host_dodi=192.168.72.142
-db_host_nsp=192.168.72.141
+db_host_dodi=tri-test-niab81
+db_host_nsp=tri-test-niab82
+
db_admin_user=root
db_admin_password=nspnetic
@@ -12,6 +13,8 @@ db_password=CrevCuen
jboss_dir=/pack/jboss/server/default/
jboss_conf_dir=${jboss_dir}/conf
+jboss_conf_url=file:${jboss_conf_dir}
+jboss_log_dir=${jboss_dir}/log
jboss_deploy_dir=${jboss_dir}/deploy
mysql_dir=/pack/mysql
@@ -30,11 +33,8 @@ fi
## Create the trifork database user
num_users=$(${mysql_admin_connect} -D mysql -N -e "select count(*) from user where user='${db_username}';" | grep 0 || true)
-if [ "${num_users}" -eq 0 ]; then
- echo "No trifork user found"
-else
+if [ "${num_users}" != "0" ]; then
echo "DROP USER 'trifork'@'%';" > sql/drop_trifork_user.sql
- echo "Dropping existing user trifork"
${mysql_admin_connect} < sql/drop_trifork_user.sql
fi
@@ -55,16 +55,38 @@ ${mysql_admin_connect} < sql/stamdata/create_db_stamdata.sql
${mysql_user_connect} stamdata < sql/stamdata/schema.sql
+echo "Replacing jboss.server.config.url placeholder i nspslalog properties with path to jboss conf folder"
+find . -type f -name "nspslalog*.properties" -exec sed -i.orig -e "s|\\\${jboss.server.config.url}|${jboss_conf_url}|g" {} \;
+echo "Copying properties to jboss conf folder"
+find . -type f -name "nspslalog*.properties" -exec cp {} ${jboss_conf_dir}/ \;
+
+echo "Reverting to original nspslalog files"
+for file in conf/nspslalog*.properties.orig
+do
+ # do something on "$file"
+ new_file_name=${file%.orig}
+ mv -f "${file}" "${new_file_name}"
+done
+
+
+jboss_pid=$(/pack/jdk/bin/jps -l | grep jboss | cut -d " " -f 1) || true
+if [ -n "${jboss_pid}" ]; then
+ echo "Stopping jboss"
+ /etc/init.d/jboss stop || true
+
+
+ jboss_pid_2=$(/pack/jdk/bin/jps -l | grep jboss | cut -d " " -f 1) || true
+ if [ -n "${jboss_pid_2}" ]; then
+ echo "Shutdown of jboss failed, killing process"
+ kill -9 ${jboss_pid_2}
+ fi
+fi
-
-cp conf/* ${jboss_conf_dir}/
-
-echo "Stopping jboss"
-/etc/init.d/jboss stop
-
+rm ${jboss_log_dir}/*
cp deploy/* ${jboss_deploy_dir}/
echo "Starting jboss"
/etc/init.d/jboss start
+echo
echo "Done deploying - check the jboss log files in ${jboss_log_dir}"
View
44 sdm_nsp_install.sh
@@ -1,8 +1,9 @@
#!/bin/bash
set -e
-db_host_dodi=192.168.72.142
-db_host_nsp=192.168.72.141
+db_host_dodi=tri-test-niab81
+db_host_nsp=tri-test-niab82
+
db_admin_user=root
db_admin_password=nspnetic
@@ -12,6 +13,8 @@ db_password=CrevCuen
jboss_dir=/pack/jboss/server/default/
jboss_conf_dir=${jboss_dir}/conf
+jboss_conf_url=file:${jboss_conf_dir}
+jboss_log_dir=${jboss_dir}/log
jboss_deploy_dir=${jboss_dir}/deploy
mysql_dir=/pack/mysql
@@ -30,11 +33,8 @@ fi
## Create the trifork database user
num_users=$(${mysql_admin_connect} -D mysql -N -e "select count(*) from user where user='${db_username}';" | grep 0 || true)
-if [ "${num_users}" -eq 0 ]; then
- echo "No trifork user found"
-else
+if [ "${num_users}" != "0" ]; then
echo "DROP USER 'trifork'@'%';" > sql/drop_trifork_user.sql
- echo "Dropping existing user trifork"
${mysql_admin_connect} < sql/drop_trifork_user.sql
fi
@@ -55,15 +55,37 @@ ${mysql_admin_connect} < sql/create_trifork_mysql_user.sql
## Create schema in stamdata database
${mysql_user_connect} stamdata < sql/stamdata/schema.sql
+echo "Replacing jboss.server.config.url placeholder i nspslalog properties with path to jboss conf folder"
+find . -type f -name "nspslalog*.properties" -exec sed -i.orig -e "s|\\\${jboss.server.config.url}|${jboss_conf_url}|g" {} \;
+echo "Copying properties to jboss conf folder"
+find . -type f -name "nspslalog*.properties" -exec cp {} ${jboss_conf_dir}/ \;
+
+echo "Reverting to original nspslalog files"
+for file in conf/nspslalog*.properties.orig
+do
+ # do something on "$file"
+ new_file_name=${file%.orig}
+ mv -f "${file}" "${new_file_name}"
+done
+
+jboss_pid=$(/pack/jdk/bin/jps -l | grep jboss | cut -d " " -f 1) || true
+if [ -n "${jboss_pid}" ]; then
+ echo "Stopping jboss"
+ /etc/init.d/jboss stop || true
+
+
+ jboss_pid_2=$(/pack/jdk/bin/jps -l | grep jboss | cut -d " " -f 1) || true
+ if [ -n "${jboss_pid_2}" ]; then
+ echo "Shutdown of jboss failed, killing process"
+ kill -9 ${jboss_pid_2}
+ fi
+fi
-cp conf/* ${jboss_conf_dir}/
-
-echo "Stopping jboss"
-/etc/init.d/jboss stop
-
+rm ${jboss_log_dir}/*
cp deploy/* ${jboss_deploy_dir}/
echo "Starting jboss"
/etc/init.d/jboss start
+echo
echo "Done deploying - check the jboss log files in ${jboss_log_dir}"
View
18 sdm_package.sh
@@ -1,8 +1,9 @@
#!/bin/bash
set -e
-db_host_dodi=192.168.72.142
-db_host_nsp=192.168.72.141
+db_host_dodi=tri-test-niab81
+db_host_nsp=tri-test-niab82
+
db_username=trifork
db_password=CrevCuen
@@ -133,4 +134,15 @@ tar czf sdm_${dodi_dir}.tar.gz ${dodi_dir}
echo
echo "Done - results are available in ${install_dir}"
-find . -name "*.tar.gz"
+find . -name "*.tar.gz"
+
+echo
+echo "Copying files to vm's"
+scp sdm_${dodi_dir}.tar.gz ${db_host_dodi}:~
+scp sdm_${nsp_dir}.tar.gz ${db_host_nsp}:~
+
+
+echo
+echo "Files uploaded to ${db_host_dodi} and ${db_host_nsp}
+ - Log in to the systems and extract the tar.gz files
+ - Go into the created folder and execute the *_install.sh scripts"

0 comments on commit fb7f3ea

Please sign in to comment.
Something went wrong with that request. Please try again.