From 72974ce409277c52eb30461e48f0755916a49f05 Mon Sep 17 00:00:00 2001 From: Carlos Alexandro Becker Date: Wed, 21 Nov 2012 15:29:09 -0200 Subject: totvs utils --- custom/totvs.zsh | 74 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 custom/totvs.zsh (limited to 'custom/totvs.zsh') diff --git a/custom/totvs.zsh b/custom/totvs.zsh new file mode 100644 index 000000000..9ef5fd641 --- /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 +} + + -- cgit v1.2.3-70-g09d2 From 50e538aeb5cc2ac9388390fd03c2189635f17b57 Mon Sep 17 00:00:00 2001 From: Carlos Alexandro Becker Date: Wed, 21 Nov 2012 15:35:28 -0200 Subject: oops --- custom/totvs.zsh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'custom/totvs.zsh') diff --git a/custom/totvs.zsh b/custom/totvs.zsh index 9ef5fd641..e9924c147 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 } -- cgit v1.2.3-70-g09d2 From 89614be1af55be2f2fb2b49782f80644d619ef6f Mon Sep 17 00:00:00 2001 From: Carlos Alexandro Becker Date: Wed, 21 Nov 2012 16:01:28 -0200 Subject: param -i para gerar installer --- custom/totvs.zsh | 41 ++++++++++++++++++++++++++++------------- 1 file changed, 28 insertions(+), 13 deletions(-) (limited to 'custom/totvs.zsh') diff --git a/custom/totvs.zsh b/custom/totvs.zsh index e9924c147..065413758 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 -- cgit v1.2.3-70-g09d2 From 9b1c64d7ffeb9ee9ea806a560bc929a683ff15f1 Mon Sep 17 00:00:00 2001 From: Carlos Alexandro Becker Date: Wed, 21 Nov 2012 16:20:43 -0200 Subject: go --- custom/totvs.zsh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'custom/totvs.zsh') diff --git a/custom/totvs.zsh b/custom/totvs.zsh index 065413758..d1456bdc5 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 } -- cgit v1.2.3-70-g09d2 From 2acd30ed0508ddbda188144c4f7b0c4bb351bd43 Mon Sep 17 00:00:00 2001 From: Carlos Alexandro Becker Date: Wed, 21 Nov 2012 16:35:31 -0200 Subject: fixing issue with solr in jboss start --- custom/totvs.zsh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'custom/totvs.zsh') diff --git a/custom/totvs.zsh b/custom/totvs.zsh index d1456bdc5..25945548a 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 } -- cgit v1.2.3-70-g09d2 From a366456284d5a454d8c5a25fdf88ce428ca28f54 Mon Sep 17 00:00:00 2001 From: Carlos Alexandro Becker Date: Thu, 22 Nov 2012 09:20:31 -0200 Subject: fixing some build issues... --- custom/totvs.zsh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'custom/totvs.zsh') diff --git a/custom/totvs.zsh b/custom/totvs.zsh index 25945548a..2de9f4ab6 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 } -- cgit v1.2.3-70-g09d2 From 60b7dd8af55d8e27a7326585753867f738c35dcd Mon Sep 17 00:00:00 2001 From: Carlos Alexandro Becker Date: Thu, 22 Nov 2012 10:42:11 -0200 Subject: fixing various issues with build, add runinstall option --- custom/totvs.zsh | 62 ++++++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 45 insertions(+), 17 deletions(-) (limited to 'custom/totvs.zsh') diff --git a/custom/totvs.zsh b/custom/totvs.zsh index 2de9f4ab6..f3a449da6 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" -- cgit v1.2.3-70-g09d2 From 5ff4a0030f1b29d8e45e6f1336232a81c1b93b3d Mon Sep 17 00:00:00 2001 From: Carlos Alexandro Becker Date: Thu, 22 Nov 2012 14:20:53 -0200 Subject: e alias --- custom/totvs.zsh | 2 ++ 1 file changed, 2 insertions(+) (limited to 'custom/totvs.zsh') diff --git a/custom/totvs.zsh b/custom/totvs.zsh index f3a449da6..883bdf7dd 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() { -- cgit v1.2.3-70-g09d2