60b7dd8af55d8e27a7326585753867f738c35dcd

Author
Carlos Alexandro Becker <caarlos0@gmail.com>
Committer
Carlos Alexandro Becker <caarlos0@gmail.com>
Date

Message

fixing various issues with build, add runinstall option

Diff

This diff is truncated to protect this page.

  1diff --git a/custom/totvs.zsh b/custom/totvs.zsh
  2index 2de9f4ab6b31971abe645dbc7883f58eea61be9d..f3a449da6c27e7d0335d04aae2438353efb77ef4 100644
  3--- a/custom/totvs.zsh
  4+++ b/custom/totvs.zsh
  5@@ -11,6 +11,7 @@ ECM_PORT="8080"
  6 VOLDEMORT=$ECM_WS/voldemort
  7 ECM=$ECM_WS/ecm
  8 INSTALLER="n"
  9+DRY_CLEAN="n"
 10 
 11 # fuckin aliases
 12 alias ecmu=ecmup
 13@@ -19,6 +20,7 @@ alias ecmc=ecmclean
 14 alias ecms=ecmstart
 15 alias ecmo=ecmstop
 16 alias ecmi=ecminstall
 17+alias ecmri=ecmruninstall
 18 alias ecm=ecmfull
 19 
 20 # update ecm
 21@@ -31,13 +33,6 @@ ecmup() {
 22 # build it!
 23 ecmbuild() {
 24 	echo "build? no problem sir..."
 25-	
 26-	case $@ in
 27-	-*i*)
 28-		INSTALLER=y
 29-		;;
 30-	esac	
 31-
 32 	cd $VOLDEMORT && mvncie && \
 33 	cd $VOLDEMORT/social-ecm && \
 34 	cd $VOLDEMORT/wcm && mvncie && \
 35@@ -48,34 +43,67 @@ ecmbuild() {
 36 
 37 # gen installer or cp wars...
 38 ecminstall() {
 39-        if [[ "$INSTALLER" == "y" ]]; then
 40-        	echo "generating installer..."
 41-	        cd $VOLDEMORT/ecm/installer
 42-                mvnci -am -Drun=installer -DLinux64=true -DappServer=jboss
 43-        else
 44+	case $@ in
 45+	-*i*)
 46+		INSTALLER=y
 47+		;;
 48+	esac	
 49+  if [[ "$INSTALLER" == "y" ]]; then
 50+  	echo "generating installer..."
 51+    cd $VOLDEMORT/ecm/installer
 52+          mvnci -am -Drun=installer -DLinux64=true -DappServer=jboss
 53+  else
 54 		echo "cpying wars..."
 55-                cd $VOLDEMORT/ecm/build && mvnci && \
 56+    cd $VOLDEMORT/ecm/build && mvnci && \
 57 		cd $VOLDEMORT/wcm/build && mvnci && \
 58-                cd $VOLDEMORT/social-ecm/build && mvnci
 59-        fi
 60+    cd $VOLDEMORT/social-ecm/build && mvnci
 61+	fi
 62 }
 63 
 64 # clean jboss trash folders
 65 ecmclean() {
 66 	echo "cleaning jboss shit"
 67-	rm -rf $ECM_JBOSS/standalone/{deployments/*,log,tmp} 2> /dev/null
 68+	case $@ in
 69+	-*d*)
 70+		DRY_CLEAN="y"
 71+		;;
 72+	esac
 73+	if [[ "$DRY_CLEAN" == "y" ]]; then
 74+		rm -rf $ECM_JBOSS/standalone/deployments/*.{failed,deployed,dodeploy,deploying}
 75+	else
 76+		rm -rf $ECM_JBOSS/standalone/deployments/*
 77+	fi
 78+	rm -rf $ECM_JBOSS/standalone/{log,tmp,data}
 79+	rm -rf $ECM_JBOSS/solr/zoo_data
 80 }
 81 
 82 # start jboss server
 83 ecmstart() {
 84 	# why shall I start server if i just gen a installer?
 85-	if [[ "$INSTALLER" == "n" ]]; then
 86+	if [[ "$INSTALLER" == "y" ]]; then
 87+		ecmruninstall
 88+	else
 89 		echo "starting jboss"
 90 		cd $ECM_JBOSS/bin
 91 		JAVA_OPTS="-Xmx2048m -XX:MaxPermSize=512m -DzkRun -Dbootstrap_conf=true" ./standalone.sh
 92 	fi
 93 }
 94 
 95+ecmruninstall() {
 96+	echo "ok, lets install this crap :)"
 97+	cd $VOLDEMORT/ecm/installer/izpack/target
 98+	if [[ -f ECM-Linux64.zip ]]; then
 99+		mkdir -p /tmp/ecmi
100+		rm -rf /tmp/ecmi/*
101+		unzip ECM-Linux64 -d /tmp/ecmi/
102+		cd /tmp/ecmi/
103+		chmod a+x ECM-Installer-64.sh
104+		./ECM-Installer-64.sh