summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Alexandro Becker <caarlos0@gmail.com>2012-11-22 10:42:11 -0200
committerCarlos Alexandro Becker <caarlos0@gmail.com>2012-11-22 10:42:11 -0200
commit60b7dd8af55d8e27a7326585753867f738c35dcd (patch)
treebd8de415a7b765745776365b5770b06e1a5a082e
parenta366456284d5a454d8c5a25fdf88ce428ca28f54 (diff)
downloadzsh-60b7dd8af55d8e27a7326585753867f738c35dcd.tar.gz
zsh-60b7dd8af55d8e27a7326585753867f738c35dcd.tar.bz2
zsh-60b7dd8af55d8e27a7326585753867f738c35dcd.zip
fixing various issues with build, add runinstall option
-rw-r--r--custom/totvs.zsh62
1 files changed, 45 insertions, 17 deletions
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"