forked from apereo/cas-overlay-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
163 lines (140 loc) · 4.77 KB
/
build.gradle
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
161
162
163
buildscript {
repositories {
mavenLocal()
mavenCentral()
jcenter()
maven { url "https://repo.spring.io/libs-milestone" }
maven { url "https://plugins.gradle.org/m2/" }
}
dependencies {
classpath "de.undercouch:gradle-download-task:${project.gradleDownloadTaskVersion}"
classpath "org.springframework.boot:spring-boot-gradle-plugin:${project.springBootVersion}"
classpath "gradle.plugin.com.google.cloud.tools:jib-gradle-plugin:${project.jibVersion}"
classpath "com.boazj.gradle:gradle-log-plugin:${project.gradleLogVersion}"
}
}
repositories {
mavenLocal()
mavenCentral()
jcenter()
maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
maven { url "https://build.shibboleth.net/nexus/content/repositories/releases/" }
maven { url "https://repo.spring.io/milestone/" }
maven { url "https://oss.jfrog.org/artifactory/oss-snapshot-local" }
}
def casServerVersion = project.'cas.version'
def casWebApplicationBinaryName = "cas.war"
project.ext."casServerVersion" = casServerVersion
project.ext."casWebApplicationBinaryName" = casWebApplicationBinaryName
apply from: rootProject.file("gradle/waroverlay.gradle")
apply from: rootProject.file("gradle/tasks.gradle")
apply plugin: "war"
apply plugin: "org.springframework.boot"
apply plugin: "eclipse"
apply plugin: "idea"
apply plugin: "com.google.cloud.tools.jib"
dependencies {
compile "org.apereo.cas:cas-server-webapp${project.appServer}:${casServerVersion}"
// Other CAS dependencies/modules may be listed here...
// https://apereo.github.io/cas/development/installation/Configuring-SAML2-Authentication.html
compile "org.apereo.cas:cas-server-support-saml-idp:${casServerVersion}"
// https://apereo.github.io/cas/development/installation/LDAP-Authentication.html
compile "org.apereo.cas:cas-server-support-ldap:${casServerVersion}"
// https://apereo.github.io/cas/development/services/JSON-Service-Management.html#json-service-registry
compile "org.apereo.cas:cas-server-support-json-service-registry:${casServerVersion}"
// https://apereo.github.io/cas/development/integration/Configuring-SAML-SP-Integrations.html#saml-sp-integrations
compile "org.apereo.cas:cas-server-support-saml-sp-integrations:${casServerVersion}"
}
tasks.findByName("jibDockerBuild")
.dependsOn(copyWebAppIntoJib, copyConfigIntoJib)
.finalizedBy(deleteWebAppFromJib)
configurations.all {
resolutionStrategy {
cacheChangingModulesFor 0, "seconds"
cacheDynamicVersionsFor 0, "seconds"
preferProjectModules()
def failIfConflict = project.hasProperty("failOnVersionConflict") && Boolean.valueOf(project.getProperty("failOnVersionConflict"))
if (failIfConflict) {
failOnVersionConflict()
}
}
}
eclipse {
classpath {
downloadSources = true
downloadJavadoc = true
}
}
idea {
module {
downloadJavadoc = true
downloadSources = true
}
}
war {
includeWarJars = true
entryCompression = ZipEntryCompression.STORED
}
bootRun.enabled = false
bootRun.onlyIf { return false }
tasks.remove(tasks['bootRun'])
springBoot {
mainClassName = "org.apereo.cas.web.CasWebApplication"
}
bootWar {
doFirst {
def executable = project.hasProperty("executable") && Boolean.valueOf(project.getProperty("executable"))
if (executable) {
logger.info "Including launch script for executable WAR artifact"
launchScript()
} else {
logger.info "WAR artifact is not marked as an executable"
}
archiveName "${casWebApplicationBinaryName}"
baseName "cas"
excludeDevtools = true
}
}
/*
bootRun {
sourceResources sourceSets.main
classpath = sourceSets.main.runtimeClasspath
}
*/
wrapper {
distributionType = Wrapper.DistributionType.BIN
gradleVersion = "${project.gradleVersion}"
}
jib {
from {
image = project.baseDockerImage
}
to {
image = "${project.group}/${project.name}"
/**
ecr-login: Amazon Elastic Container Registry (ECR)
gcr: Google Container Registry (GCR)
osxkeychain: Docker Hub
*/
credHelper = "osxkeychain"
/**
auth {
username = "*******"
password = "*******"
}
tags = [casServerVersion]
*/
}
container {
useCurrentTimestamp = true
entrypoint = ['docker/entrypoint.sh']
ports = ['80', '443', '8080', '8443']
labels = [version:casServerVersion, name:project.name, group:project.group]
}
extraDirectory {
path = file('src/main/jib')
permissions = [
'/docker/entrypoint.sh': '755'
]
}
}