Commit 7da2ab3f authored by Misagh Moayyed's avatar Misagh Moayyed

working on overlay

parent abab408c
# Versions
casVersion=6.0.0-RC1-SNAPSHOT
appServer=-tomcat
springBootVersion=2.0.3.RELEASE
tomcatVersion=9
tomcatFullVersion=${tomcat.version}.0.10
# Build
appServer=-tomcat
tomcatVersion=9
tomcatFullVersion=9.0.10
sourceCompatibility=10
targetCompatibility=10
# Maven
# ...
# Gradle
gradle.version=4.9
cas.run.jvmArgs=-Xmx2048M
cas.debug.jvmArgs=-Xmx2048M -XX:+TieredCompilation -XX:TieredStopAtLevel=1 -Xdebug -Xrunjdwp:transport=dt_socket,address=5005,server=y,suspend=y
org.gradle.daemon=true
org.gradle.jvmargs=-Xmx2048M -XX:+TieredCompilation -XX:TieredStopAtLevel=1
\ No newline at end of file
targetCompatibility=10
\ No newline at end of file
......@@ -5,7 +5,7 @@ while IFS='' read -r line || [[ -n "$line" ]]; do
IFS='=' read -r -a array <<< "$line"
varName=${array[0]}
varValue=${array[1]}
export "$varName"="$varValue" 2>/dev/null
export "$varName"="$varValue"
fi
done < ./build.properties
......@@ -53,11 +53,10 @@ function clean() {
}
function package() {
clean
if [ "$buildTool" = "maven" ]; then
./mvnw package "$@"
./mvnw clean package "$@"
else
./gradlew build "$@"
./gradlew clean build "$@"
fi
}
......@@ -79,16 +78,38 @@ function dependencies() {
}
function tomcat() {
# if [ "$buildTool" = "maven" ]; then
# ./mvnw clean package -P external "$@"
# else
# ./gradlew clean build -Pexternal=true "$@"
# fi
pushd ..
if [ ! -f apache-tomcat.zip ]; then
wget -O apache-tomcat.zip "http://www-eu.apache.org/dist/tomcat/tomcat-${tomcatVersion}/v${tomcatFullVersion}/bin/apache-tomcat-${tomcatFullVersion}.zip"
fi
rm -Rf ./apache-tomcat
unzip -o apache-tomcat.zip >/dev/null
mv apache-tomcat-${tomcatFullVersion} apache-tomcat
export CATALINA_HOME=./apache-tomcat/
chmod +x ./apache-tomcat/bin/*.sh
echo "Attempting to shutdown Apache Tomcat..."
./apache-tomcat/bin/shutdown.sh 2>/dev/null
ps -ef | grep tomcat
rm -Rf ./apache-tomcat
./mvnw clean package -P external -T 5 "$@" && cp target/cas.war apache-tomcat/webapps/
chmod +x ./apache-tomcat/bin/*.sh
popd
if [ "$buildTool" = "maven" ]; then
cp target/cas.war .../apache-tomcat/webapps/
else
cp build/libs/cas.war ../apache-tomcat/webapps/
fi
pushd ..
./apache-tomcat/bin/startup.sh
tail -F ./apache-tomcat/logs/catalina.out
popd
tail -F ../apache-tomcat/logs/catalina.out
}
function debug() {
......
......@@ -4,7 +4,7 @@ buildscript {
jcenter()
}
dependencies {
classpath "org.springframework.boot:spring-boot-gradle-plugin:${project.'springboot.version'}"
classpath "org.springframework.boot:spring-boot-gradle-plugin:$System.env.springBootVersion"
}
}
......@@ -22,8 +22,11 @@ apply plugin: "org.springframework.boot"
apply plugin: "eclipse"
apply plugin: "idea"
sourceCompatibility=System.env.sourceCompatibility
targetCompatibility=System.env.targetCompatibility
def currentBranch = "master"
def currentVersion = "${project.'cas.version'}"
def currentVersion = "$System.env.casVersion"
if (!currentVersion.contains("RC")) {
def matcher = currentVersion =~ /(\d+\.\d+\.).+/
if (matcher.find()) {
......@@ -73,28 +76,25 @@ bootRun {
}
dependencies {
compile "org.apereo.cas:cas-server-webapp${project.'app.server'}:${project.'cas.version'}@war"
// Other dependencies may be listed here...
}
if (project.hasProperty("external")) {
compile "org.apereo.cas:cas-server-webapp$System.env.appServer:$System.env.casVersion@war"
} else {
compile "org.apereo.cas:cas-server-webapp:$System.env.casVersion@war"
}
task copyConfig(type: Copy, description: "Copy CAS configuration over to /etc/cas/config") {
doLast {
from "${project.rootDir}/etc/cas/config"
into '/etc/cas/config'
}
// Other dependencies may be listed here...
}
task explodeWar(type: Copy, group: "build", description: "Explodes the cas.war") {
dependsOn build
from zipTree("build/libs/cas.war")
into "${buildDir}/cas"
println "CAS web application artifact exploded into [cas/build/cas]"
}
task run(group: "build", description: "Run the CAS web application in embedded container mode") {
dependsOn build
doLast {
def casRunArgs = Arrays.asList(project.'cas.run.jvmArgs'.split(" "))
def casRunArgs = Arrays.asList("-Xmx2048M -XX:+TieredCompilation -XX:TieredStopAtLevel=1 -Xdebug -Xrunjdwp:transport=dt_socket,address=5005,server=y,suspend=y".split(" "))
javaexec {
main = "-jar";
jvmArgs = casRunArgs
......@@ -104,10 +104,10 @@ 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 5005") {
task debug(group: "build", description: "Debug the CAS web application in embedded mode on port 5000") {
dependsOn build
doLast {
def casDebugArgs = Arrays.asList(project.'cas.debug.jvmArgs'.split(" "))
def casDebugArgs = Arrays.asList("-Xmx2048M".split(" "))
javaexec {
main = "-jar";
......@@ -120,12 +120,12 @@ task debug(group: "build", description: "Debug the CAS web application in embedd
}
task wrapper(type: Wrapper, description: "Update the Gradle wrapper") {
gradleVersion = project."gradle.version"
gradleVersion = "4.9"
}
task casVersion(group: "build", description: "Display the current CAS version") {
doFirst {
println "${project.'cas.version'}"
println "$System.env.casVersion"
}
}
......@@ -137,4 +137,4 @@ task showConfiguration(group: "build", description: "Show configurations for eac
}
task allDependenciesInsight(type: DependencyInsightReportTask, description: "Produce insight information for all dependencies") {}
task allDependencies(type: DependencyReportTask, description: "Display a graph of all project dependencies") {}
\ No newline at end of file
task allDependencies(type: DependencyReportTask, description: "Display a graph of all project dependencies") {}
\ No newline at end of file
......@@ -177,54 +177,12 @@
<dependencies>
<dependency>
<groupId>org.apereo.cas</groupId>
<artifactId>cas-server-webapp</artifactId>
<artifactId>cas-server-webapp${appServer}</artifactId>
<version>${casVersion}</version>
<type>war</type>
<scope>compile</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>com.googlecode.maven-download-plugin</groupId>
<artifactId>download-maven-plugin</artifactId>
<version>1.4.1</version>
<executions>
<execution>
<id>download-tomcat</id>
<phase>package</phase>
<goals>
<goal>wget</goal>
</goals>
<configuration>
<url>http://www-eu.apache.org/dist/tomcat/tomcat-${tomcatVersion}/v${tomcatFullVersion}/bin/apache-tomcat-${tomcatFullVersion}.zip</url>
<unpack>true</unpack>
<outputDirectory>${project.basedir}</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.coderplus.maven.plugins</groupId>
<artifactId>copy-rename-maven-plugin</artifactId>
<version>1.0</version>
<executions>
<execution>
<id>rename-file</id>
<phase>package</phase>
<goals>
<goal>rename</goal>
</goals>
<configuration>
<sourceFile>${project.basedir}/apache-tomcat-${tomcat.fullversion}</sourceFile>
<destinationFile>${project.basedir}/apache-tomcat</destinationFile>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
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