-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.sh
executable file
·160 lines (138 loc) · 3.36 KB
/
build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
#!/bin/bash
function copy() {
./gradlew copyCasConfiguration "$@"
}
function help() {
casVersion=$(./gradlew casVersion --quiet)
clear
echo "******************************************************************"
tput setaf 2
echo "Apereo CAS $casVersion"
echo "Enterprise Single SignOn for all earthlings and beyond"
tput sgr 0
echo "- https://github.com/apereo/cas"
echo "- https://apereo.github.io/cas"
echo "******************************************************************"
echo -e "Usage: build.sh [command]\n"
echo -e "\tThe following commands are available:\n"
echo -e "\tclean: \t\tClean Maven build directory"
echo -e "\tcli: \t\tRun the CAS command line shell and pass commands"
echo -e "\tcopy: \t\tCopy config from the project's local etc/cas/config directory to the root /etc/cas/config"
echo -e "\tdebug: \t\tRun cas.war and listen for Java debugger on port 5000"
echo -e "\tdependencies: \tGet a report of all dependencies configured in the build"
echo -e "\tdocker: \tBuild a Docker image based on the current build and configuration"
echo -e "\tgencert: \tCreate keystore with SSL certificate in location where CAS looks by default"
echo -e "\tgetview: \tAsk for a view name to be included in the overlay for customizations"
echo -e "\tgetresource: \tAsk for a resource name (properties/json/etc file) to be included in the overlay for customizations"
echo -e "\tlistviews: \tList all CAS views that ship with the web application and can be customized in the overlay"
echo -e "\tpackage: \tClean and build CAS war"
echo -e "\texplode: \tExplode and unzip and packaged CAS war"
echo -e "\trun: \t\tBuild and run cas.war via Java as an executable war"
echo -e "\trunalone: \tBuild and run cas.war on its own as a standalone executable"
echo -e "\ttomcat: \tDeploy the CAS web application to an external Apache Tomcat server"
echo -e "\tupdate: \tPackage the CAS overlay by force-updating dependencies and SNAPSHOT versions"
}
function clean() {
./gradlew clean "$@"
}
function package() {
./gradlew clean build "$@"
}
function update() {
./gradlew clean build --refresh-dependencies "$@"
}
function dependencies() {
./gradlew allDependencies
}
function tomcat() {
./gradlew tomcatDeploy "$@"
}
function debug() {
./gradlew debug "$@"
}
function run() {
./gradlew run "$@"
}
function runalone() {
./gradlew clean executable
}
function jibdocker() {
./gradlew clean build jibDockerBuild "$@"
}
function listviews() {
./gradlew listTemplateViews "$@"
}
function explodeApp() {
./gradlew explodeWar
}
function getresource() {
./gradlew getResource -PresourceName="$@"
}
function getview() {
./gradlew getResource -PresourceName="$@"
}
function gencert() {
./gradlew createKeystore "$@"
}
function cli() {
./gradlew downloadShell runShell "$@"
}
command=$1
if [ -z "$command" ]; then
echo "No commands provided. Defaulting to [run]"
command="run"
fi
shift 1
case "$command" in
"copy")
copy
;;
"help")
help
;;
"clean")
clean "$@"
;;
"package"|"build")
package "$@"
;;
"debug")
debug "$@"
;;
"run")
run "$@"
;;
"explode")
explodeApp "$@"
;;
"docker")
jibdocker "$@"
;;
"gencert")
gencert "$@"
;;
"cli")
cli "$@"
;;
"update")
update "$@"
;;
"dependencies")
update "$@"
;;
"runalone")
runalone "$@"
;;
"listviews")
listviews "$@"
;;
"getview")
getview "$@"
;;
"getresource")
getresource "$@"
;;
"tomcat")
tomcat
;;
esac