aaca1c25582fce211d8f94179e93d736961ea2fd

Author
Robby Russell <robby@planetargon.com>
Committer
Robby Russell <robby@planetargon.com>
Date

Message

Merge pull request #1395 from caarlos0/master

added some maven love <3

Diff

This diff is truncated to protect this page.

  1diff --git a/.gitignore b/.gitignore
  2index 51a5ee6c396f012ae162d0d63006d4d8e765b92f..4cb1720e7ca778b4104c88447a9b312b6516289b 100644
  3--- a/.gitignore
  4+++ b/.gitignore
  5@@ -1,7 +1,6 @@
  6 locals.zsh
  7 log/.zsh_history
  8 projects.zsh
  9-custom/*
 10 !custom/example
 11 !custom/example.zsh
 12 *.swp
 13diff --git a/custom/totvs.zsh b/custom/totvs.zsh
 14new file mode 100644
 15index 0000000000000000000000000000000000000000..883bdf7ddd09adc3b570319c68597afd49735c31
 16--- /dev/null
 17+++ b/custom/totvs.zsh
 18@@ -0,0 +1,124 @@
 19+#
 20+# Just some utilities for use in ecm development.
 21+#
 22+
 23+setopt rmstarsilent
 24+
 25+HOME="/home/carlos"
 26+ECM_WS="$HOME/totvs/ws"
 27+ECM_JBOSS="$HOME/Public/ecm/JBoss-7.1.1"
 28+ECM_PORT="8080"
 29+VOLDEMORT=$ECM_WS/voldemort
 30+ECM=$ECM_WS/ecm
 31+INSTALLER="n"
 32+DRY_CLEAN="n"
 33+
 34+# fuckin aliases
 35+alias ecmu=ecmup
 36+alias ecmb=ecmbuild
 37+alias ecmc=ecmclean
 38+alias ecms=ecmstart
 39+alias ecmo=ecmstop
 40+alias ecmi=ecminstall
 41+alias ecmri=ecmruninstall
 42+alias ecm=ecmfull
 43+alias e='MAVEN_OPTS="-Xmx2048m -XX:MaxPermSize=512m -DskipTests=true" ecm'  
 44+
 45+
 46+# update ecm
 47+ecmup() {
 48+	echo "update all the things!"
 49+	cd $VOLDEMORT && svn up
 50+	cd $ECM && svn up
 51+}
 52+
 53+# build it!
 54+ecmbuild() {
 55+	echo "build? no problem sir..."
 56+	cd $VOLDEMORT && mvncie && \
 57+	cd $VOLDEMORT/social-ecm && \
 58+	cd $VOLDEMORT/wcm && mvncie && \
 59+	cd $ECM/wecmpackage && mvncie && \
 60+	cd $VOLDEMORT/ecm && mvncie && \
 61+	ecminstall
 62+}
 63+
 64+# gen installer or cp wars...
 65+ecminstall() {
 66+	case $@ in
 67+	-*i*)
 68+		INSTALLER=y
 69+		;;
 70+	esac	
 71+  if [[ "$INSTALLER" == "y" ]]; then
 72+  	echo "generating installer..."
 73+    cd $VOLDEMORT/ecm/installer
 74+          mvnci -am -Drun=installer -DLinux64=true -DappServer=jboss
 75+  else
 76+		echo "cpying wars..."
 77+    cd $VOLDEMORT/ecm/build && mvnci && \
 78+		cd $VOLDEMORT/wcm/build && mvnci && \
 79+    cd $VOLDEMORT/social-ecm/build && mvnci
 80+	fi
 81+}
 82+
 83+# clean jboss trash folders
 84+ecmclean() {
 85+	echo "cleaning jboss shit"
 86+	case $@ in
 87+	-*d*)
 88+		DRY_CLEAN="y"
 89+		;;
 90+	esac
 91+	if [[ "$DRY_CLEAN" == "y" ]]; then
 92+		rm -rf $ECM_JBOSS/standalone/deployments/*.{failed,deployed,dodeploy,deploying}
 93+	else
 94+		rm -rf $ECM_JBOSS/standalone/deployments/*
 95+	fi
 96+	rm -rf $ECM_JBOSS/standalone/{log,tmp,data}
 97+	rm -rf $ECM_JBOSS/solr/zoo_data
 98+}
 99+
100+# start jboss server
101+ecmstart() {
102+	# why shall I start server if i just gen a installer?
103+	if [[ "$INSTALLER" == "y" ]]; then
104+		ecmruninstall
105+	else
106+		echo "starting jboss"
107+		cd $ECM_JBOSS/bin
108+		JAVA_OPTS="-Xmx2048m -XX:MaxPermSize=512m -DzkRun -Dbootstrap_conf=true" ./standalone.sh
109+	fi
110+}
111+
112+ecmruninstall() {
113+	echo "ok, lets install this crap :)"
114+	cd $VOLDEMORT/ecm/installer/izpack/target
115+	if [[ -f ECM-Linux64.zip ]]; then
116+		mkdir -p /tmp/ecmi
117+		rm -rf /tmp/ecmi/*
118diff --git a/plugins/debian/debian.plugin.zsh b/plugins/debian/debian.plugin.zsh
119index 39d3ef36a05280e9e285412afecba861278bd73c..71f22f7bdd65a3801b5ba1175148b9ff63630081 100644
120--- a/plugins/debian/debian.plugin.zsh
121+++ b/plugins/debian/debian.plugin.zsh
122@@ -61,7 +61,8 @@ if [[ $use_sudo -eq 1 ]]; then
123     # Install all .deb files in the current directory.
124     # Warning: you will need to put the glob in single quotes if you use:
125     # glob_subst
126-    alias di='sudo dpkg -i ./*.deb'
127+    alias dia='sudo dpkg -i ./*.deb'
128+    alias di='sudo dpkg -i'
129 
130     # Remove ALL kernel images and headers EXCEPT the one in use
131     alias kclean='sudo aptitude remove -P ?and(~i~nlinux-(ima|hea) \
132@@ -100,7 +101,8 @@ else
133 
134     # Install all .deb files in the current directory
135     # Assumes glob_subst is off
136-    alias di='su -lc "dpkg -i ./*.deb" root'
137+    alias dia='su -lc "dpkg -i ./*.deb" root'
138+    alias di='su -lc "dpkg -i" root'
139 
140     # Remove ALL kernel images and headers EXCEPT the one in use
141     alias kclean='su -lc '\''aptitude remove -P ?and(~i~nlinux-(ima|hea) \
142diff --git a/plugins/mvn/mvn.plugin.zsh b/plugins/mvn/mvn.plugin.zsh
143index e8af2f49d5d2f87daeae99b23d59fecdc7b44d26..f250c2a27c183af730dcad34993bc15016aaec02 100644
144--- a/plugins/mvn/mvn.plugin.zsh
145+++ b/plugins/mvn/mvn.plugin.zsh
146@@ -1,6 +1,59 @@
147+# mvn-color based on https://gist.github.com/1027800
148+export BOLD=`tput bold`
149+export UNDERLINE_ON=`tput smul`
150+export UNDERLINE_OFF=`tput rmul`
151+export TEXT_BLACK=`tput setaf 0`
152+export TEXT_RED=`tput setaf 1`
153+export TEXT_GREEN=`tput setaf 2`
154+export TEXT_YELLOW=`tput setaf 3`
155+export TEXT_BLUE=`tput setaf 4`
156+export TEXT_MAGENTA=`tput setaf 5`
157+export TEXT_CYAN=`tput setaf 6`
158+export TEXT_WHITE=`tput setaf 7`
159+export BACKGROUND_BLACK=`tput setab 0`
160+export BACKGROUND_RED=`tput setab 1`
161+export BACKGROUND_GREEN=`tput setab 2`
162+export BACKGROUND_YELLOW=`tput setab 3`
163+export BACKGROUND_BLUE=`tput setab 4`
164+export BACKGROUND_MAGENTA=`tput setab 5`
165+export BACKGROUND_CYAN=`tput setab 6`
166+export BACKGROUND_WHITE=`tput setab 7`
167+export RESET_FORMATTING=`tput sgr0`
168+
169+ 
170+# Wrapper function for Maven's mvn command.
171+mvn-color()
172+{
173+  # Filter mvn output using sed
174+  mvn $@ | sed -e "s/\(\[INFO\]\ \-.*\)/${TEXT_BLUE}${BOLD}\1/g" \
175+               -e "s/\(\[INFO\]\ \[.*\)/${RESET_FORMATTING}${BOLD}\1${RESET_FORMATTING}/g" \
176+               -e "s/\(\[INFO\]\ BUILD SUCCESSFUL\)/${BOLD}${TEXT_GREEN}\1${RESET_FORMATTING}/g" \
177+               -e "s/\(\[WARNING\].*\)/${BOLD}${TEXT_YELLOW}\1${RESET_FORMATTING}/g" \
178+               -e "s/\(\[ERROR\].*\)/${BOLD}${TEXT_RED}\1${RESET_FORMATTING}/g" \