Commit 339888ee authored by Misagh Moayyed's avatar Misagh Moayyed

Merge branches 'master' and 'master' of github.com:apereo/cas-overlay-template

parents c73c4d5f 9611bf66
# Set line endings to LF, even on Windows. Otherwise, execution within Docker fails.
# See https://help.github.com/articles/dealing-with-line-endings/
*.sh text eol=lf
*.cmd text eol=crlf
\ No newline at end of file
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
@set CONFIG_DIR=\etc\cas\config @set CONFIG_DIR=\etc\cas\config
@set SHELL_DIR=build\libs @set SHELL_DIR=build\libs
@set BUILD_DIR=build\libs @set BUILD_DIR=build\libs
@set DOCKER_ORG=org.apereo.cas
@if "%PROFILES%" == "" @set PROFILES=standalone @if "%PROFILES%" == "" @set PROFILES=standalone
@rem Call this script with DNAME and CERT_SUBJ_ALT_NAMES already set to override @rem Call this script with DNAME and CERT_SUBJ_ALT_NAMES already set to override
...@@ -34,6 +35,10 @@ ...@@ -34,6 +35,10 @@
@if "%1" == "cli" call:cli @if "%1" == "cli" call:cli
@if "%1" == "debugcli" call:debugcli @if "%1" == "debugcli" call:debugcli
@if "%1" == "dependencies" call:dependencies @if "%1" == "dependencies" call:dependencies
@if "%1" == "dockerimage" call:dockerimage
@if "%1" == "dockerrun" call:dockerrun
@if "%1" == "dockerrunsh" call:dockerrunsh
@if "%1" == "dockerexecsh" call:dockerexecsh
@rem function section starts here @rem function section starts here
@goto :EOF @goto :EOF
...@@ -47,7 +52,7 @@ ...@@ -47,7 +52,7 @@
@goto :EOF @goto :EOF
:help :help
@echo "Usage: build.cmd [copy|clean|package|refresh|run|debug|gencert] [optional extra args for gradle]" @echo "Usage: build.cmd [copy|clean|package|refresh|run|debug|gencert|dockerimage|dockerrunsh|dockerexecsh] [optional extra args for gradle]"
@echo "To get started on a clean system, run 'build.cmd gencert && build.cmd copy && build.cmd run'" @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" @echo "Note that using the copy or gencert arguments will create and/or overwrite the %CAS_DIR% which is outside this project"
@goto :EOF @goto :EOF
...@@ -74,6 +79,27 @@ ...@@ -74,6 +79,27 @@
call:package --refresh-dependencies %1 %2 call:package --refresh-dependencies %1 %2
@goto :EOF @goto :EOF
:dockerimage
call %GRADLE_CMD% clean build jibDockerBuild
@goto :EOF
:dockerrun
docker stop cas
docker rm cas
docker run --name cas %DOCKER_ORG%/cas:latest
@goto :EOF
:dockerrunsh
@rem run image to look around, delete container on exit
docker run --rm -it --entrypoint /bin/sh %DOCKER_ORG%/cas:latest
@goto :EOF
:dockerexecsh
@rem exec into runing container to look around, run jstack, check config, etc
docker exec -it cas /bin/sh
@goto :EOF
:gencert :gencert
where /q keytool where /q keytool
if ERRORLEVEL 1 ( if ERRORLEVEL 1 (
......
...@@ -95,7 +95,7 @@ dependencies { ...@@ -95,7 +95,7 @@ dependencies {
jib { jib {
from { from {
image = "adoptopenjdk/openjdk11:jdk11-alpine-nightly-slim" image = project.baseDockerImage
} }
to { to {
image = "${project.group}/${project.name}" image = "${project.group}/${project.name}"
......
...@@ -14,3 +14,7 @@ targetCompatibility=11 ...@@ -14,3 +14,7 @@ targetCompatibility=11
# Location of the downloaded CAS shell JAR # Location of the downloaded CAS shell JAR
shellDir=build/libs shellDir=build/libs
# use without "-slim" in tag name if you want tools like jstack, adds about 100MB to image size
# (https://hub.docker.com/r/adoptopenjdk/openjdk11/tags/)
baseDockerImage=adoptopenjdk/openjdk11:jdk11-alpine-nightly-slim
\ No newline at end of file
...@@ -19,4 +19,4 @@ mv docker/cas/services/*.* /etc/cas/services 2>/dev/null ...@@ -19,4 +19,4 @@ mv docker/cas/services/*.* /etc/cas/services 2>/dev/null
#ls -R /etc/cas #ls -R /etc/cas
echo -e "\nRunning CAS..." echo -e "\nRunning CAS..."
java -Xms512m -Xmx2048M -XX:+TieredCompilation -XX:TieredStopAtLevel=1 -jar docker/cas/war/cas.war exec java -Xms512m -Xmx2048M -XX:+TieredCompilation -XX:TieredStopAtLevel=1 -jar docker/cas/war/cas.war
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment