Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added few project-specific customization scripts. These are invoked from
the bash_profile
- Loading branch information
Joseph Khafaji
committed
Sep 9, 2015
1 parent
4a773f4
commit 09310a5
Showing
2 changed files
with
82 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/bin/sh | ||
function localMysql(){ | ||
mysql -uroot -pr2kogCiKyKq5 $1 | ||
} | ||
|
||
function dockerMysql(){ | ||
mysql -uroot -pr2kogCiKyKq5 -h$(boot2docker ip) -P13306 $1 | ||
} | ||
|
||
|
||
# To quickly tail all tomcat logs | ||
function logs(){ | ||
tail -f /usr/local/Cellar/tomcat7/7.0.61/libexec/logs/*.out \ | ||
/usr/local/Cellar/tomcat7/7.0.61/libexec/logs/*.txt \ | ||
/var/hosting/tomcatlogs/justride_mpg.log | ||
} | ||
|
||
# run a command against Tomcat docker container | ||
function _() | ||
{ | ||
docker exec $(docker ps | grep $(docker ps | grep masabi/payment-webapp | grep -v db | awk '{print $1}') | awk '{print $1}') "$@" | ||
} | ||
|
||
# run a command against Mysql docker container | ||
function __() | ||
{ | ||
docker exec $(docker ps | grep $(docker ps | grep masabi/payment-webapp-db | awk '{print $1}') | awk '{print $1}') "$@" | ||
} | ||
|
||
function dockerMpgLogs(){ | ||
_ tail -f /var/hosting/tomcatlogs/justride_mpg.log | ||
} |
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,50 @@ | ||
#!/bin/sh | ||
|
||
# VARIABLES DECLARATION | ||
MPG_SRC_HOME="/Users/hassanein.khafaji/Projects/masabi/mpg" | ||
|
||
function mpgBuild() | ||
{ | ||
cd ${MPG_SRC_HOME} | ||
mvn clean package --projects com.masabi:justride-payment-webapp --also-make -DskipTests $1 | ||
} | ||
|
||
function mpgBuildWithUnitTests() | ||
{ | ||
cd ${MPG_SRC_HOME} | ||
mvn clean package --projects com.masabi:justride-payment-webapp --also-make $1 -o | ||
} | ||
|
||
function mpgDeploy(){ | ||
MPG_WAR="${MPG_SRC_HOME}/payment-webapp/target/MPG.war" | ||
TOMCAT_WEBAPPS="/usr/local/Cellar/tomcat7/7.0.61/libexec/webapps" | ||
CATALINA_SH="/usr/local/Cellar/tomcat7/7.0.61/libexec/bin/catalina.sh" | ||
|
||
# delete the old war and copy the new one. | ||
cd ${TOMCAT_WEBAPPS} | ||
rm -fr MPG* | ||
cp ${MPG_WAR} . | ||
|
||
# restart tomcat | ||
ps -ef | grep tomcat | grep -v grep | awk '{print $2}' | xargs kill -9 | ||
${CATALINA_SH} start | ||
} | ||
|
||
function mpgRedeploy(){ | ||
mpgBuild && mpgDeploy | ||
} | ||
|
||
function mpgBuildWithIntegrationTests(){ | ||
cd ${MPG_SRC_HOME} | ||
mvn verify --projects com.masabi:justride-payment-webapp --also-make -P WithDocker $1 | ||
} | ||
|
||
function mpgBuildThenRunDocker(){ | ||
cd ${MPG_SRC_HOME} | ||
mvn pre-integration-test --projects com.masabi:justride-payment-webapp --also-make -P WithDocker $1 | ||
} | ||
|
||
function mpgBuildThenRunDockerAndRunTests(){ | ||
cd ${MPG_SRC_HOME} | ||
mvn integration-test --projects com.masabi:justride-payment-webapp --also-make $1 | ||
} |