From 15e0dc9ec937d98094419b59a89be60fe6dbff3f Mon Sep 17 00:00:00 2001 From: Carlos Alexandro Becker Date: Tue, 6 Nov 2012 15:39:59 -0200 Subject: [PATCH 01/11] Added some maven love. --- plugins/mvn/mvn.color.plugin.zsh | 41 ++++++++++++++++++++++++++++++++ plugins/mvn/mvn.plugin.zsh | 14 ++++++++++- 2 files changed, 54 insertions(+), 1 deletion(-) create mode 100644 plugins/mvn/mvn.color.plugin.zsh diff --git a/plugins/mvn/mvn.color.plugin.zsh b/plugins/mvn/mvn.color.plugin.zsh new file mode 100644 index 00000000..82281a70 --- /dev/null +++ b/plugins/mvn/mvn.color.plugin.zsh @@ -0,0 +1,41 @@ +# mvn-color based on https://gist.github.com/1027800 +export BOLD=`tput bold` +export UNDERLINE_ON=`tput smul` +export UNDERLINE_OFF=`tput rmul` +export TEXT_BLACK=`tput setaf 0` +export TEXT_RED=`tput setaf 1` +export TEXT_GREEN=`tput setaf 2` +export TEXT_YELLOW=`tput setaf 3` +export TEXT_BLUE=`tput setaf 4` +export TEXT_MAGENTA=`tput setaf 5` +export TEXT_CYAN=`tput setaf 6` +export TEXT_WHITE=`tput setaf 7` +export BACKGROUND_BLACK=`tput setab 0` +export BACKGROUND_RED=`tput setab 1` +export BACKGROUND_GREEN=`tput setab 2` +export BACKGROUND_YELLOW=`tput setab 3` +export BACKGROUND_BLUE=`tput setab 4` +export BACKGROUND_MAGENTA=`tput setab 5` +export BACKGROUND_CYAN=`tput setab 6` +export BACKGROUND_WHITE=`tput setab 7` +export RESET_FORMATTING=`tput sgr0` + + +# Wrapper function for Maven's mvn command. +mvn-color() +{ + # Filter mvn output using sed + mvn $@ | sed -e "s/\(\[INFO\]\ \-.*\)/${TEXT_BLUE}${BOLD}\1/g" \ + -e "s/\(\[INFO\]\ \[.*\)/${RESET_FORMATTING}${BOLD}\1${RESET_FORMATTING}/g" \ + -e "s/\(\[INFO\]\ BUILD SUCCESSFUL\)/${BOLD}${TEXT_GREEN}\1${RESET_FORMATTING}/g" \ + -e "s/\(\[WARNING\].*\)/${BOLD}${TEXT_YELLOW}\1${RESET_FORMATTING}/g" \ + -e "s/\(\[ERROR\].*\)/${BOLD}${TEXT_RED}\1${RESET_FORMATTING}/g" \ + -e "s/Tests run: \([^,]*\), Failures: \([^,]*\), Errors: \([^,]*\), Skipped: \([^,]*\)/${BOLD}${TEXT_GREEN}Tests run: \1${RESET_FORMATTING}, Failures: ${BOLD}${TEXT_RED}\2${RESET_FORMATTING}, Errors: ${BOLD}${TEXT_RED}\3${RESET_FORMATTING}, Skipped: ${BOLD}${TEXT_YELLOW}\4${RESET_FORMATTING}/g" + + # Make sure formatting is reset + echo -ne ${RESET_FORMATTING} +} + +# Override the mvn command with the colorized one. +alias mvn="mvn-color" + diff --git a/plugins/mvn/mvn.plugin.zsh b/plugins/mvn/mvn.plugin.zsh index e8af2f49..66d18074 100644 --- a/plugins/mvn/mvn.plugin.zsh +++ b/plugins/mvn/mvn.plugin.zsh @@ -1,6 +1,18 @@ +# aliases +alias mvncie='mvn clean install eclipse:eclipse' +alias mvnci='mvn clean install' +alias mvne='mvn eclipse:eclipse' +alias mvnce='mvn clean eclipse:clean eclipse:eclipse' +alias mvnd='mvn deploy' +alias mvnp='mvn package' +alias mvnc='mvn clean' +alias mvncom='mvn compile' +alias mvnt='mvn test' +alias mvnag='mvn archetype:generate' + function listMavenCompletions { reply=( cli:execute cli:execute-phase archetype:generate generate-sources compile clean install test test-compile deploy package cobertura:cobertura jetty:run gwt:run gwt:debug -DskipTests -Dmaven.test.skip=true -DarchetypeCatalog=http://tapestry.formos.com/maven-snapshot-repository -Dtest= `if [ -d ./src ] ; then find ./src -type f | grep -v svn | sed 's?.*/\([^/]*\)\..*?-Dtest=\1?' ; fi`); } -compctl -K listMavenCompletions mvn \ No newline at end of file +compctl -K listMavenCompletions mvn From 8723a2ce58abd951c6664ddb19b29d612219956a Mon Sep 17 00:00:00 2001 From: Carlos Alexandro Becker Date: Tue, 6 Nov 2012 15:44:50 -0200 Subject: [PATCH 02/11] mvn.colors.plugin.zsh was not read... mergin with mvn.plugin.zsh. --- plugins/mvn/mvn.color.plugin.zsh | 41 -------------------------------- plugins/mvn/mvn.plugin.zsh | 41 ++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 41 deletions(-) delete mode 100644 plugins/mvn/mvn.color.plugin.zsh diff --git a/plugins/mvn/mvn.color.plugin.zsh b/plugins/mvn/mvn.color.plugin.zsh deleted file mode 100644 index 82281a70..00000000 --- a/plugins/mvn/mvn.color.plugin.zsh +++ /dev/null @@ -1,41 +0,0 @@ -# mvn-color based on https://gist.github.com/1027800 -export BOLD=`tput bold` -export UNDERLINE_ON=`tput smul` -export UNDERLINE_OFF=`tput rmul` -export TEXT_BLACK=`tput setaf 0` -export TEXT_RED=`tput setaf 1` -export TEXT_GREEN=`tput setaf 2` -export TEXT_YELLOW=`tput setaf 3` -export TEXT_BLUE=`tput setaf 4` -export TEXT_MAGENTA=`tput setaf 5` -export TEXT_CYAN=`tput setaf 6` -export TEXT_WHITE=`tput setaf 7` -export BACKGROUND_BLACK=`tput setab 0` -export BACKGROUND_RED=`tput setab 1` -export BACKGROUND_GREEN=`tput setab 2` -export BACKGROUND_YELLOW=`tput setab 3` -export BACKGROUND_BLUE=`tput setab 4` -export BACKGROUND_MAGENTA=`tput setab 5` -export BACKGROUND_CYAN=`tput setab 6` -export BACKGROUND_WHITE=`tput setab 7` -export RESET_FORMATTING=`tput sgr0` - - -# Wrapper function for Maven's mvn command. -mvn-color() -{ - # Filter mvn output using sed - mvn $@ | sed -e "s/\(\[INFO\]\ \-.*\)/${TEXT_BLUE}${BOLD}\1/g" \ - -e "s/\(\[INFO\]\ \[.*\)/${RESET_FORMATTING}${BOLD}\1${RESET_FORMATTING}/g" \ - -e "s/\(\[INFO\]\ BUILD SUCCESSFUL\)/${BOLD}${TEXT_GREEN}\1${RESET_FORMATTING}/g" \ - -e "s/\(\[WARNING\].*\)/${BOLD}${TEXT_YELLOW}\1${RESET_FORMATTING}/g" \ - -e "s/\(\[ERROR\].*\)/${BOLD}${TEXT_RED}\1${RESET_FORMATTING}/g" \ - -e "s/Tests run: \([^,]*\), Failures: \([^,]*\), Errors: \([^,]*\), Skipped: \([^,]*\)/${BOLD}${TEXT_GREEN}Tests run: \1${RESET_FORMATTING}, Failures: ${BOLD}${TEXT_RED}\2${RESET_FORMATTING}, Errors: ${BOLD}${TEXT_RED}\3${RESET_FORMATTING}, Skipped: ${BOLD}${TEXT_YELLOW}\4${RESET_FORMATTING}/g" - - # Make sure formatting is reset - echo -ne ${RESET_FORMATTING} -} - -# Override the mvn command with the colorized one. -alias mvn="mvn-color" - diff --git a/plugins/mvn/mvn.plugin.zsh b/plugins/mvn/mvn.plugin.zsh index 66d18074..cde46798 100644 --- a/plugins/mvn/mvn.plugin.zsh +++ b/plugins/mvn/mvn.plugin.zsh @@ -1,3 +1,44 @@ +# mvn-color based on https://gist.github.com/1027800 +export BOLD=`tput bold` +export UNDERLINE_ON=`tput smul` +export UNDERLINE_OFF=`tput rmul` +export TEXT_BLACK=`tput setaf 0` +export TEXT_RED=`tput setaf 1` +export TEXT_GREEN=`tput setaf 2` +export TEXT_YELLOW=`tput setaf 3` +export TEXT_BLUE=`tput setaf 4` +export TEXT_MAGENTA=`tput setaf 5` +export TEXT_CYAN=`tput setaf 6` +export TEXT_WHITE=`tput setaf 7` +export BACKGROUND_BLACK=`tput setab 0` +export BACKGROUND_RED=`tput setab 1` +export BACKGROUND_GREEN=`tput setab 2` +export BACKGROUND_YELLOW=`tput setab 3` +export BACKGROUND_BLUE=`tput setab 4` +export BACKGROUND_MAGENTA=`tput setab 5` +export BACKGROUND_CYAN=`tput setab 6` +export BACKGROUND_WHITE=`tput setab 7` +export RESET_FORMATTING=`tput sgr0` + + +# Wrapper function for Maven's mvn command. +mvn-color() +{ + # Filter mvn output using sed + mvn $@ | sed -e "s/\(\[INFO\]\ \-.*\)/${TEXT_BLUE}${BOLD}\1/g" \ + -e "s/\(\[INFO\]\ \[.*\)/${RESET_FORMATTING}${BOLD}\1${RESET_FORMATTING}/g" \ + -e "s/\(\[INFO\]\ BUILD SUCCESSFUL\)/${BOLD}${TEXT_GREEN}\1${RESET_FORMATTING}/g" \ + -e "s/\(\[WARNING\].*\)/${BOLD}${TEXT_YELLOW}\1${RESET_FORMATTING}/g" \ + -e "s/\(\[ERROR\].*\)/${BOLD}${TEXT_RED}\1${RESET_FORMATTING}/g" \ + -e "s/Tests run: \([^,]*\), Failures: \([^,]*\), Errors: \([^,]*\), Skipped: \([^,]*\)/${BOLD}${TEXT_GREEN}Tests run: \1${RESET_FORMATTING}, Failures: ${BOLD}${TEXT_RED}\2${RESET_FORMATTING}, Errors: ${BOLD}${TEXT_RED}\3${RESET_FORMATTING}, Skipped: ${BOLD}${TEXT_YELLOW}\4${RESET_FORMATTING}/g" + + # Make sure formatting is reset + echo -ne ${RESET_FORMATTING} +} + +# Override the mvn command with the colorized one. +alias mvn="mvn-color" + # aliases alias mvncie='mvn clean install eclipse:eclipse' alias mvnci='mvn clean install' From 8871c7a6d00a7c0a1e586e4f4d7a21c255231783 Mon Sep 17 00:00:00 2001 From: Carlos Alexandro Becker Date: Wed, 7 Nov 2012 10:28:44 -0200 Subject: [PATCH 03/11] made dpkg -i more util --- plugins/debian/debian.plugin.zsh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugins/debian/debian.plugin.zsh b/plugins/debian/debian.plugin.zsh index 39d3ef36..71f22f7b 100644 --- a/plugins/debian/debian.plugin.zsh +++ b/plugins/debian/debian.plugin.zsh @@ -61,7 +61,8 @@ if [[ $use_sudo -eq 1 ]]; then # Install all .deb files in the current directory. # Warning: you will need to put the glob in single quotes if you use: # glob_subst - alias di='sudo dpkg -i ./*.deb' + alias dia='sudo dpkg -i ./*.deb' + alias di='sudo dpkg -i' # Remove ALL kernel images and headers EXCEPT the one in use alias kclean='sudo aptitude remove -P ?and(~i~nlinux-(ima|hea) \ @@ -100,7 +101,8 @@ else # Install all .deb files in the current directory # Assumes glob_subst is off - alias di='su -lc "dpkg -i ./*.deb" root' + alias dia='su -lc "dpkg -i ./*.deb" root' + alias di='su -lc "dpkg -i" root' # Remove ALL kernel images and headers EXCEPT the one in use alias kclean='su -lc '\''aptitude remove -P ?and(~i~nlinux-(ima|hea) \ From 72974ce409277c52eb30461e48f0755916a49f05 Mon Sep 17 00:00:00 2001 From: Carlos Alexandro Becker Date: Wed, 21 Nov 2012 15:29:09 -0200 Subject: [PATCH 04/11] totvs utils --- .gitignore | 1 - custom/totvs.zsh | 74 ++++++++++++++++++++++++++++++++++++++ plugins/mvn/mvn.plugin.zsh | 2 +- 3 files changed, 75 insertions(+), 2 deletions(-) create mode 100644 custom/totvs.zsh diff --git a/.gitignore b/.gitignore index 51a5ee6c..4cb1720e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,6 @@ locals.zsh log/.zsh_history projects.zsh -custom/* !custom/example !custom/example.zsh *.swp diff --git a/custom/totvs.zsh b/custom/totvs.zsh new file mode 100644 index 00000000..9ef5fd64 --- /dev/null +++ b/custom/totvs.zsh @@ -0,0 +1,74 @@ +# +# Just some utilities for use in ecm development. +# + +setopt rmstarsilent + +HOME="/home/carlos" +ECM_WS="$HOME/totvs/ws" +ECM_JBOSS="$HOME/Public/ecm/JBoss-7.1.1" +ECM_PORT="8080" +VOLDEMORT=$ECM_WS/voldemort +ECM=$ECM_WS/ecm +INSTALLER="n" + +# fuckin aliases +alias ecmu=ecmup +alias ecmb=ecmbuild +alias ecmc=ecmclean +alias ecms=ecmstart +alias ecmo=ecmstop +alias ecm=goecm + + +# update ecm +ecmup() { + echo "update all the things!" + cd $VOLDEMORT && svn up + cd $ECM && svn up +} + +# build it! +ecmbuild() { + vared -p 'build? no problem sir, do you want a installer? (y/N) ' INSTALLER + cd $VOLDEMORT && mvncie + cd $VOLDEMORT/social-ecm + cd $VOLDEMORT/wcm && mvncie + cd $ECM/ecm/wecmpackage && mvncie + cd $VOLDEMORT/ecm && mvncie + if [[ $INSTALLER -eq 'n' ]]; then + cd $VOLDEMORT/ecm/installer + mvnci -am -Drun=installer -DLinux64=true -DappServer=jboss + else + cd $VOLDEMORT/ecm/build && mvnci + cd $VOLDEMORT/social-ecm/build && mvnci + fi +} + +# clean jboss trash folders +ecmclean() { + echo "cleaning jboss shit" + rm -rf $ECM_JBOSS/standalone/{deployments/*,log,tmp} 2> /dev/null +} + +# start jboss server +ecmstart() { + echo "starting jboss" + JAVA_OPTS="-Xmx2048m -XX:MaxPermSize=512m -DzkRun -Dbootstrap_conf=true" $ECM_JBOSS/bin/standalone.sh +} + +# stop jboss (usually on 8080) +ecmstop() { + echo "kill jboss (or whatever you are running on 8080" + fuser -k $ECM_PORT/tcp +} + +# do all the things +goecm() { + echo "serious business here. let's have a coffee.." + ecmstop + ecmclean + ecmbuild && ecmup && ecmstart +} + + diff --git a/plugins/mvn/mvn.plugin.zsh b/plugins/mvn/mvn.plugin.zsh index cde46798..f250c2a2 100644 --- a/plugins/mvn/mvn.plugin.zsh +++ b/plugins/mvn/mvn.plugin.zsh @@ -37,7 +37,7 @@ mvn-color() } # Override the mvn command with the colorized one. -alias mvn="mvn-color" +#alias mvn="mvn-color" # aliases alias mvncie='mvn clean install eclipse:eclipse' From 50e538aeb5cc2ac9388390fd03c2189635f17b57 Mon Sep 17 00:00:00 2001 From: Carlos Alexandro Becker Date: Wed, 21 Nov 2012 15:35:28 -0200 Subject: [PATCH 05/11] oops --- custom/totvs.zsh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/custom/totvs.zsh b/custom/totvs.zsh index 9ef5fd64..e9924c14 100644 --- a/custom/totvs.zsh +++ b/custom/totvs.zsh @@ -36,7 +36,7 @@ ecmbuild() { cd $VOLDEMORT/wcm && mvncie cd $ECM/ecm/wecmpackage && mvncie cd $VOLDEMORT/ecm && mvncie - if [[ $INSTALLER -eq 'n' ]]; then + if [[ $INSTALLER -eq 'y' ]]; then cd $VOLDEMORT/ecm/installer mvnci -am -Drun=installer -DLinux64=true -DappServer=jboss else @@ -68,7 +68,8 @@ goecm() { echo "serious business here. let's have a coffee.." ecmstop ecmclean - ecmbuild && ecmup && ecmstart + ecmup + ecmbuild && ecmstart } From 89614be1af55be2f2fb2b49782f80644d619ef6f Mon Sep 17 00:00:00 2001 From: Carlos Alexandro Becker Date: Wed, 21 Nov 2012 16:01:28 -0200 Subject: [PATCH 06/11] param -i para gerar installer --- custom/totvs.zsh | 41 ++++++++++++++++++++++++++++------------- 1 file changed, 28 insertions(+), 13 deletions(-) diff --git a/custom/totvs.zsh b/custom/totvs.zsh index e9924c14..06541375 100644 --- a/custom/totvs.zsh +++ b/custom/totvs.zsh @@ -18,8 +18,8 @@ alias ecmb=ecmbuild alias ecmc=ecmclean alias ecms=ecmstart alias ecmo=ecmstop -alias ecm=goecm - +alias ecmi=ecminstall +alias ecm=ecmfull # update ecm ecmup() { @@ -30,19 +30,31 @@ ecmup() { # build it! ecmbuild() { - vared -p 'build? no problem sir, do you want a installer? (y/N) ' INSTALLER + echo "build? no problem sir..." + + case $@ in + -*i*) + INSTALLER=y + ;; + esac + cd $VOLDEMORT && mvncie cd $VOLDEMORT/social-ecm cd $VOLDEMORT/wcm && mvncie cd $ECM/ecm/wecmpackage && mvncie cd $VOLDEMORT/ecm && mvncie - if [[ $INSTALLER -eq 'y' ]]; then - cd $VOLDEMORT/ecm/installer - mvnci -am -Drun=installer -DLinux64=true -DappServer=jboss - else - cd $VOLDEMORT/ecm/build && mvnci - cd $VOLDEMORT/social-ecm/build && mvnci - fi + ecminstall +} + +# gen installer or cp wars... +ecminstall() { + if [[ "$INSTALLER" == "y" ]]; then + cd $VOLDEMORT/ecm/installer + mvnci -am -Drun=installer -DLinux64=true -DappServer=jboss + else + cd $VOLDEMORT/ecm/build && mvnci + cd $VOLDEMORT/social-ecm/build && mvnci + fi } # clean jboss trash folders @@ -53,8 +65,11 @@ ecmclean() { # start jboss server ecmstart() { - echo "starting jboss" - JAVA_OPTS="-Xmx2048m -XX:MaxPermSize=512m -DzkRun -Dbootstrap_conf=true" $ECM_JBOSS/bin/standalone.sh + # why shall I start server if i just gen a installer? + if [[ "$INSTALLER" == "y" ]]; then + echo "starting jboss" + JAVA_OPTS="-Xmx2048m -XX:MaxPermSize=512m -DzkRun -Dbootstrap_conf=true" $ECM_JBOSS/bin/standalone.sh + fi } # stop jboss (usually on 8080) @@ -64,7 +79,7 @@ ecmstop() { } # do all the things -goecm() { +ecmfull() { echo "serious business here. let's have a coffee.." ecmstop ecmclean From 9b1c64d7ffeb9ee9ea806a560bc929a683ff15f1 Mon Sep 17 00:00:00 2001 From: Carlos Alexandro Becker Date: Wed, 21 Nov 2012 16:20:43 -0200 Subject: [PATCH 07/11] go --- custom/totvs.zsh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/custom/totvs.zsh b/custom/totvs.zsh index 06541375..d1456bdc 100644 --- a/custom/totvs.zsh +++ b/custom/totvs.zsh @@ -49,10 +49,13 @@ ecmbuild() { # gen installer or cp wars... ecminstall() { if [[ "$INSTALLER" == "y" ]]; then - cd $VOLDEMORT/ecm/installer + echo "generating installer..." + cd $VOLDEMORT/ecm/installer mvnci -am -Drun=installer -DLinux64=true -DappServer=jboss else + echo "cpying wars..." cd $VOLDEMORT/ecm/build && mvnci + cd $VOLDEMORT/wcm/build && mvnci cd $VOLDEMORT/social-ecm/build && mvnci fi } From 2acd30ed0508ddbda188144c4f7b0c4bb351bd43 Mon Sep 17 00:00:00 2001 From: Carlos Alexandro Becker Date: Wed, 21 Nov 2012 16:35:31 -0200 Subject: [PATCH 08/11] fixing issue with solr in jboss start --- custom/totvs.zsh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/custom/totvs.zsh b/custom/totvs.zsh index d1456bdc..25945548 100644 --- a/custom/totvs.zsh +++ b/custom/totvs.zsh @@ -69,9 +69,10 @@ ecmclean() { # start jboss server ecmstart() { # why shall I start server if i just gen a installer? - if [[ "$INSTALLER" == "y" ]]; then + if [[ "$INSTALLER" == "n" ]]; then echo "starting jboss" - JAVA_OPTS="-Xmx2048m -XX:MaxPermSize=512m -DzkRun -Dbootstrap_conf=true" $ECM_JBOSS/bin/standalone.sh + cd $ECM_JBOSS/bin + JAVA_OPTS="-Xmx2048m -XX:MaxPermSize=512m -DzkRun -Dbootstrap_conf=true" ./standalone.sh fi } From a366456284d5a454d8c5a25fdf88ce428ca28f54 Mon Sep 17 00:00:00 2001 From: Carlos Alexandro Becker Date: Thu, 22 Nov 2012 09:20:31 -0200 Subject: [PATCH 09/11] fixing some build issues... --- custom/totvs.zsh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/custom/totvs.zsh b/custom/totvs.zsh index 25945548..2de9f4ab 100644 --- a/custom/totvs.zsh +++ b/custom/totvs.zsh @@ -38,11 +38,11 @@ ecmbuild() { ;; esac - cd $VOLDEMORT && mvncie - cd $VOLDEMORT/social-ecm - cd $VOLDEMORT/wcm && mvncie - cd $ECM/ecm/wecmpackage && mvncie - cd $VOLDEMORT/ecm && mvncie + cd $VOLDEMORT && mvncie && \ + cd $VOLDEMORT/social-ecm && \ + cd $VOLDEMORT/wcm && mvncie && \ + cd $ECM/wecmpackage && mvncie && \ + cd $VOLDEMORT/ecm && mvncie && \ ecminstall } @@ -54,8 +54,8 @@ ecminstall() { mvnci -am -Drun=installer -DLinux64=true -DappServer=jboss else echo "cpying wars..." - cd $VOLDEMORT/ecm/build && mvnci - cd $VOLDEMORT/wcm/build && mvnci + cd $VOLDEMORT/ecm/build && mvnci && \ + cd $VOLDEMORT/wcm/build && mvnci && \ cd $VOLDEMORT/social-ecm/build && mvnci fi } From 60b7dd8af55d8e27a7326585753867f738c35dcd Mon Sep 17 00:00:00 2001 From: Carlos Alexandro Becker Date: Thu, 22 Nov 2012 10:42:11 -0200 Subject: [PATCH 10/11] fixing various issues with build, add runinstall option --- custom/totvs.zsh | 62 +++++++++++++++++++++++++++++++++++------------- 1 file changed, 45 insertions(+), 17 deletions(-) diff --git a/custom/totvs.zsh b/custom/totvs.zsh index 2de9f4ab..f3a449da 100644 --- a/custom/totvs.zsh +++ b/custom/totvs.zsh @@ -11,6 +11,7 @@ ECM_PORT="8080" VOLDEMORT=$ECM_WS/voldemort ECM=$ECM_WS/ecm INSTALLER="n" +DRY_CLEAN="n" # fuckin aliases alias ecmu=ecmup @@ -19,6 +20,7 @@ alias ecmc=ecmclean alias ecms=ecmstart alias ecmo=ecmstop alias ecmi=ecminstall +alias ecmri=ecmruninstall alias ecm=ecmfull # update ecm @@ -31,13 +33,6 @@ ecmup() { # build it! ecmbuild() { echo "build? no problem sir..." - - case $@ in - -*i*) - INSTALLER=y - ;; - esac - cd $VOLDEMORT && mvncie && \ cd $VOLDEMORT/social-ecm && \ cd $VOLDEMORT/wcm && mvncie && \ @@ -48,34 +43,67 @@ ecmbuild() { # gen installer or cp wars... ecminstall() { - if [[ "$INSTALLER" == "y" ]]; then - echo "generating installer..." - cd $VOLDEMORT/ecm/installer - mvnci -am -Drun=installer -DLinux64=true -DappServer=jboss - else + case $@ in + -*i*) + INSTALLER=y + ;; + esac + if [[ "$INSTALLER" == "y" ]]; then + echo "generating installer..." + cd $VOLDEMORT/ecm/installer + mvnci -am -Drun=installer -DLinux64=true -DappServer=jboss + else echo "cpying wars..." - cd $VOLDEMORT/ecm/build && mvnci && \ + cd $VOLDEMORT/ecm/build && mvnci && \ cd $VOLDEMORT/wcm/build && mvnci && \ - cd $VOLDEMORT/social-ecm/build && mvnci - fi + cd $VOLDEMORT/social-ecm/build && mvnci + fi } # clean jboss trash folders ecmclean() { echo "cleaning jboss shit" - rm -rf $ECM_JBOSS/standalone/{deployments/*,log,tmp} 2> /dev/null + case $@ in + -*d*) + DRY_CLEAN="y" + ;; + esac + if [[ "$DRY_CLEAN" == "y" ]]; then + rm -rf $ECM_JBOSS/standalone/deployments/*.{failed,deployed,dodeploy,deploying} + else + rm -rf $ECM_JBOSS/standalone/deployments/* + fi + rm -rf $ECM_JBOSS/standalone/{log,tmp,data} + rm -rf $ECM_JBOSS/solr/zoo_data } # start jboss server ecmstart() { # why shall I start server if i just gen a installer? - if [[ "$INSTALLER" == "n" ]]; then + if [[ "$INSTALLER" == "y" ]]; then + ecmruninstall + else echo "starting jboss" cd $ECM_JBOSS/bin JAVA_OPTS="-Xmx2048m -XX:MaxPermSize=512m -DzkRun -Dbootstrap_conf=true" ./standalone.sh fi } +ecmruninstall() { + echo "ok, lets install this crap :)" + cd $VOLDEMORT/ecm/installer/izpack/target + if [[ -f ECM-Linux64.zip ]]; then + mkdir -p /tmp/ecmi + rm -rf /tmp/ecmi/* + unzip ECM-Linux64 -d /tmp/ecmi/ + cd /tmp/ecmi/ + chmod a+x ECM-Installer-64.sh + ./ECM-Installer-64.sh + else + echo "uhoh, installer doesnt exist ($VOLDEMORT/ecm/installer/izpack/target/ECM-Linux64.zip)" + fi +} + # stop jboss (usually on 8080) ecmstop() { echo "kill jboss (or whatever you are running on 8080" From 5ff4a0030f1b29d8e45e6f1336232a81c1b93b3d Mon Sep 17 00:00:00 2001 From: Carlos Alexandro Becker Date: Thu, 22 Nov 2012 14:20:53 -0200 Subject: [PATCH 11/11] e alias --- custom/totvs.zsh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/custom/totvs.zsh b/custom/totvs.zsh index f3a449da..883bdf7d 100644 --- a/custom/totvs.zsh +++ b/custom/totvs.zsh @@ -22,6 +22,8 @@ alias ecmo=ecmstop alias ecmi=ecminstall alias ecmri=ecmruninstall alias ecm=ecmfull +alias e='MAVEN_OPTS="-Xmx2048m -XX:MaxPermSize=512m -DskipTests=true" ecm' + # update ecm ecmup() {