Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cas-server
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Khalid Ali
cas-server
Commits
13e41605
Commit
13e41605
authored
Oct 30, 2018
by
hdeadman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add windows build.cmd, add tasks to gradle to download/run CAS shell
parent
74d22f49
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
173 additions
and
6 deletions
+173
-6
build.cmd
build.cmd
+103
-0
build.gradle
build.gradle
+67
-6
gradle.properties
gradle.properties
+3
-0
No files found.
build.cmd
0 → 100644
View file @
13e41605
@echo
off
@set
JAVA_ARGS
=
-Xms
500
m
-Xmx
1
g
@set
CAS_DIR
=
\etc\cas
@set
CONFIG_DIR
=
\etc\cas\config
@set
SHELL_DIR
=
build
\libs
@set
BUILD_DIR
=
build
\libs
@if
"
%PROFILES%
"
==
""
@set
PROFILES
=
standalone
@rem Call this script with DNAME and CERT_SUBJ_ALT_NAMES already set to override
@if
"
%DNAME%
"
==
""
set
DNAME
=
CN
=
cas
.example.org
,
OU
=
Example
,
OU
=
Org
,
C
=
US
@rem List other host names or ip addresses you want in your certificate, may help with host name verification,
@rem if client apps make https connection for ticket validation and compare name in cert (include sub. alt. names)
@rem to name used to access CAS
@if
"
%CERT_SUBJ_ALT_NAMES%
"
==
""
set
CERT_SUBJ_ALT_NAMES
=
dns
:example
.org
,
dns
:localhost
,
dns
:
%COMPUTERNAME%
,
ip
:127.0.0.1
@rem Check for gradle in path, use it if found, otherwise use gradle wrapper
@set
GRADLE_CMD
=
gradle
.bat
@where
/q
gradle
@if
%ERRORLEVEL%
neq
0
set
GRADLE_CMD
=
.\gradlew.bat
@if
"
%
1"
==
""
call
:help
@if
"
%
1"
==
"clean"
(
call
:clean
shift
)
@if
"
%
1"
==
"copy"
call
:copy
@if
"
%
1"
==
"package"
call
:package
%
2
%
3
%
4
@if
"
%
1"
==
"debug"
call
:debug
%
2
%
3
%
4
@if
"
%
1"
==
"run"
call
:run
%
2
%
3
%
4
&
goto
:EOF
@if
"
%
1"
==
"refresh"
call
:refresh
%
2
%
3
%
4
@if
"
%
1"
==
"help"
call
:help
@if
"
%
1"
==
"gencert"
call
:gencert
@if
"
%
1"
==
"cli"
call
:cli
@if
"
%
1"
==
"debugcli"
call
:debugcli
@if
"
%
1"
==
"dependencies"
call
:dependencies
@rem function section starts here
@goto
:EOF
:copy
@echo
"Creating configuration directory under
%CONFIG_DIR%
"
if
not
exist
%CONFIG_DIR%
mkdir
%CONFIG_DIR%
@echo
"Copying configuration files from etc/cas to /etc/cas"
xcopy
/S /Y
etc
\cas\
*
\etc\cas
@goto
:EOF
:help
@echo
"Usage: build.cmd [copy|clean|package|refresh|run|debug|gencert] [optional extra args for gradle]"
@echo
"To get started on a clean system, run 'build.cmd gencert && build.cmd copy && build.cmd run'"
@echo
"Note that using the copy or gencert arguments will create and/or overwrite the
%CAS_DIR%
which is outside this project"
@goto
:EOF
:clean
call
%GRADLE_CMD%
clean
%
1
%
2
%
3
exit
/B
%ERRORLEVEL%
@goto
:EOF
:package
call
%GRADLE_CMD%
build
%
1
%
2
%
3
exit
/B
%ERRORLEVEL%
@goto
:EOF
:debug
call
:package
%
1
%
2
%
3
&
java
%JAVA_ARGS%
-Xdebug -Xrunjdwp
:transport
=
dt_socket
,
address
=
5005
,
server
=
y
,
suspend
=
n
-jar
%BUILD_DIR%
\cas.war
--spring
.profiles.active
=
%PROFILES%
@goto
:EOF
:run
call
:package
%
1
%
2
%
3
&
java
%JAVA_ARGS%
-jar
%BUILD_DIR%
\cas.war
--spring
.profiles.active
=
%PROFILES%
@goto
:EOF
:refresh
call
:package
--refresh-dependencies
%
1
%
2
@goto
:EOF
:gencert
where
/q
keytool
if
ERRORLEVEL
1
(
@echo
Java
keytool
.exe
not
found
in
path
.
exit
/b
1
)
else
(
if
not
exist
%CAS_DIR%
mkdir
%CAS_DIR%
@echo
on
@echo
Generating
self
-signed
SSL
cert
for
%DNAME%
in
%CAS_DIR%
\thekeystore
keytool
-genkeypair -alias
cas
-keyalg
RSA
-keypass
changeit
-storepass
changeit
-keystore
%CAS_DIR%
\thekeystore
-dname
%DNAME%
-ext
SAN
=
%CERT_SUBJ_ALT_NAMES%
@echo
Exporting
cert
for
use
in
trust
store
(
used
by
cas
clients
)
keytool
-exportcert -alias
cas
-storepass
changeit
-keystore
%CAS_DIR%
\thekeystore
-file
%CAS_DIR%
\cas.cer
)
@goto
:EOF
:cli
call
%GRADLE_CMD%
runShell
@goto
:EOF
:debugcli
call
%GRADLE_CMD%
debugShell
@goto
:EOF
:dependencies
call
%GRADLE_CMD%
allDependencies
@goto
:EOF
build.gradle
View file @
13e41605
...
...
@@ -6,6 +6,8 @@ buildscript {
}
dependencies
{
classpath
"org.springframework.boot:spring-boot-gradle-plugin:${project.springBootVersion}"
classpath
'de.undercouch:gradle-download-task:3.4.3'
// used to download CAS shell
classpath
'org.apache.ivy:ivy:2.4.0'
// used to download CAS shell from snapshot repo
}
}
...
...
@@ -25,7 +27,7 @@ apply plugin: "war"
apply
plugin:
"org.springframework.boot"
apply
plugin:
"eclipse"
apply
plugin:
"idea"
apply
plugin:
'de.undercouch.download'
eclipse
{
classpath
{
...
...
@@ -42,10 +44,13 @@ idea {
}
war
{
includeWarJars
=
true
entryCompression
=
ZipEntryCompression
.
STORED
}
warOverlay
{
includeWarJars
=
true
}
springBoot
{
mainClassName
=
"org.apereo.cas.web.CasWebApplication"
}
...
...
@@ -89,7 +94,7 @@ task explodeWar(type: Copy, group: "build", description: "Explodes the cas.war")
task
run
(
group:
"build"
,
description:
"Run the CAS web application in embedded container mode"
)
{
dependsOn
build
doLast
{
def
casRunArgs
=
Arrays
.
asList
(
"-Xmx2048M "
.
split
(
" "
))
def
casRunArgs
=
Arrays
.
asList
(
"-Xmx2048M
-XX:+TieredCompilation -XX:TieredStopAtLevel=1
"
.
split
(
" "
))
javaexec
{
main
=
"-jar"
jvmArgs
=
casRunArgs
...
...
@@ -99,13 +104,14 @@ task run(group: "build", description: "Run the CAS web application in embedded c
}
}
task
debug
(
group:
"build"
,
description:
"Debug the CAS web application in embedded mode on port 500
0
"
)
{
task
debug
(
group:
"build"
,
description:
"Debug the CAS web application in embedded mode on port 500
5
"
)
{
dependsOn
build
doLast
{
def
cas
DebugArgs
=
Arrays
.
asList
(
"-Xmx2048M -XX:+TieredCompilation -XX:TieredStopAtLevel=1 -Xdebug -Xrunjdwp:transport=dt_socket,address=5005,server=y,suspend=y
"
.
split
(
" "
))
def
cas
Args
=
Arrays
.
asList
(
"-Xmx2048M
"
.
split
(
" "
))
javaexec
{
main
=
"-jar"
jvmArgs
=
casDebugArgs
jvmArgs
=
casArgs
debug
=
true
args
=
[
"build/libs/cas.war"
]
logger
.
info
"Started ${commandLine}"
}
...
...
@@ -118,6 +124,61 @@ task casVersion(group: "build", description: "Display the current CAS version")
}
}
task
downloadShell
(
description:
"Download CAS shell jar from snapshot or release maven repo"
)
{
doLast
{
def
downloadFile
if
(
"${project.'cas.version'}"
.
contains
(
"SNAPSHOT"
))
{
def
snapshotDir
=
"https://oss.sonatype.org/content/repositories/snapshots/org/apereo/cas/cas-server-support-shell/${project.'cas.version'}/"
def
files
=
new
org
.
apache
.
ivy
.
util
.
url
.
ApacheURLLister
().
listFiles
(
new
URL
(
snapshotDir
))
files
=
files
.
sort
{
it
.
path
}
files
.
each
{
if
(
it
.
path
.
endsWith
(
'.jar'
))
{
downloadFile
=
it
}
}
}
else
{
downloadFile
=
"https://repo1.maven.org/maven2/org/apereo/cas/cas-server-support-shell/${project.'cas.version'}/cas-server-support-shell-${project.'cas.version'}.jar"
}
println
(
"Downloading file: ${downloadFile}"
)
download
{
src
downloadFile
dest
new
File
(
"${project.shellDir}"
,
"cas-server-support-shell-${project.'cas.version'}.jar"
)
overwrite
false
}
}
}
downloadShell
.
doFirst
{
mkdir
"${project.shellDir}"
}
task
runShell
(
description:
"Run the CAS shell"
)
{
dependsOn
downloadShell
doLast
{
def
casShellArgs
=
Arrays
.
asList
(
"-Xmx1500M"
.
split
(
" "
))
javaexec
{
main
=
"-jar"
jvmArgs
=
casShellArgs
standardInput
=
System
.
in
args
=
[
"${project.shellDir}/cas-server-support-shell-${project.'cas.version'}.jar"
,
"--shell"
]
}
}
}
task
debugShell
(
description:
"Run the CAS shell with debug options, wait for debugger on port 5005"
)
{
dependsOn
downloadShell
doLast
{
def
casArgs
=
Arrays
.
asList
(
"-Xmx1500M "
.
split
(
" "
))
javaexec
{
main
=
"-jar"
jvmArgs
=
casArgs
debug
=
true
standardInput
=
System
.
in
args
=
[
"${project.shellDir}/cas-server-support-shell-${project.'cas.version'}.jar"
,
"--shell"
]
}
}
}
task
showConfiguration
(
group:
"build"
,
description:
"Show configurations for each dependency, etc"
)
{
doLast
()
{
def
cfg
=
project
.
hasProperty
(
"configuration"
)
?
project
.
property
(
"configuration"
)
:
"compile"
...
...
gradle.properties
View file @
13e41605
...
...
@@ -12,3 +12,6 @@ sourceCompatibility=10
targetCompatibility
=
10
gradleVersion
=
4.10.2
# where do download cas shell jar
shellDir
=
build/libs
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment