totvs.zsh 1.84 KB
Newer Older
Carlos Alexandro Becker's avatar
Carlos Alexandro Becker committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#
# 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
21
22
alias ecmi=ecminstall
alias ecm=ecmfull
Carlos Alexandro Becker's avatar
Carlos Alexandro Becker committed
23
24
25
26
27
28
29
30
31
32

# update ecm
ecmup() {
	echo "update all the things!"
	cd $VOLDEMORT && svn up
	cd $ECM && svn up
}

# build it!
ecmbuild() {
33
34
35
36
37
38
39
40
	echo "build? no problem sir..."
	
	case $@ in
	-*i*)
		INSTALLER=y
		;;
	esac	

41
42
43
44
45
	cd $VOLDEMORT && mvncie && \
	cd $VOLDEMORT/social-ecm && \
	cd $VOLDEMORT/wcm && mvncie && \
	cd $ECM/wecmpackage && mvncie && \
	cd $VOLDEMORT/ecm && mvncie && \
46
47
48
49
50
51
	ecminstall
}

# gen installer or cp wars...
ecminstall() {
        if [[ "$INSTALLER" == "y" ]]; then
Carlos Alexandro Becker's avatar
go    
Carlos Alexandro Becker committed
52
53
        	echo "generating installer..."
	        cd $VOLDEMORT/ecm/installer
54
55
                mvnci -am -Drun=installer -DLinux64=true -DappServer=jboss
        else
Carlos Alexandro Becker's avatar
go    
Carlos Alexandro Becker committed
56
		echo "cpying wars..."
57
58
                cd $VOLDEMORT/ecm/build && mvnci && \
		cd $VOLDEMORT/wcm/build && mvnci && \
59
60
                cd $VOLDEMORT/social-ecm/build && mvnci
        fi
Carlos Alexandro Becker's avatar
Carlos Alexandro Becker committed
61
62
63
64
65
66
67
68
69
70
}

# clean jboss trash folders
ecmclean() {
	echo "cleaning jboss shit"
	rm -rf $ECM_JBOSS/standalone/{deployments/*,log,tmp} 2> /dev/null
}

# start jboss server
ecmstart() {
71
	# why shall I start server if i just gen a installer?
72
	if [[ "$INSTALLER" == "n" ]]; then
73
		echo "starting jboss"
74
75
		cd $ECM_JBOSS/bin
		JAVA_OPTS="-Xmx2048m -XX:MaxPermSize=512m -DzkRun -Dbootstrap_conf=true" ./standalone.sh
76
	fi
Carlos Alexandro Becker's avatar
Carlos Alexandro Becker committed
77
78
79
80
81
82
83
84
85
}

# 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
86
ecmfull() {
Carlos Alexandro Becker's avatar
Carlos Alexandro Becker committed
87
88
89
	echo "serious business here. let's have a coffee.."
	ecmstop
	ecmclean
Carlos Alexandro Becker's avatar
oops    
Carlos Alexandro Becker committed
90
91
	ecmup
	ecmbuild && ecmstart
Carlos Alexandro Becker's avatar
Carlos Alexandro Becker committed
92
93
94
}