This repository has been archived by the owner on Feb 17, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 20
/
build.gradle
136 lines (124 loc) · 4.24 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
buildscript {
repositories {
mavenLocal()
jcenter()
maven { url "https://repo.spring.io/milestone/" }
maven { url "https://repo.spring.io/libs-milestone" }
maven { url "https://oss.jfrog.org/artifactory/oss-snapshot-local" }
maven { url "https://plugins.gradle.org/m2/" }
}
dependencies {
classpath "org.springframework.boot:spring-boot-gradle-plugin:${project.springBootVersion}"
classpath "io.freefair.gradle:maven-plugin:${project.gradleMavenPluginVersion}"
classpath "gradle.plugin.com.google.cloud.tools:jib-gradle-plugin:${project.jibVersion}"
}
}
repositories {
mavenLocal()
mavenCentral()
jcenter()
maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
maven { url "https://oss.jfrog.org/artifactory/oss-snapshot-local" }
maven { url 'https://build.shibboleth.net/nexus/content/repositories/releases/' }
maven { url "https://repo.spring.io/plugins-release/" }
maven { url "https://repo.spring.io/milestone/" }
maven { url "https://repo.spring.io/libs-milestone" }
maven { url "https://repo.spring.io/snapshot" }
}
apply plugin: "io.freefair.war-overlay"
apply plugin: "war"
apply plugin: "org.springframework.boot"
apply plugin: "eclipse"
apply plugin: "idea"
def currentBranch = "master"
def currentVersion = "$System.env.casVersion"
def casServerVersion = project.casVersion
if (!currentVersion.contains("RC")) {
def matcher = currentVersion =~ /(\d+\.\d+\.).+/
if (matcher.find()) {
currentBranch = matcher.group(1) + "x"
}
}
springBoot {
mainClassName = "org.apereo.cas.CasSpringBootAdminServerWebApplication"
}
bootBuildImage {
def tag = casVersion.endsWith("-SNAPSHOT") ? "latest" : "v${casVersion}"
imageName = "apereo/cas-bootadmin-server:${tag}"
}
bootWar {
if (project.hasProperty('executable')) {
launchScript()
}
entryCompression = ZipEntryCompression.STORED
archiveName 'casbootadminserver.war'
baseName 'casbootadminserver'
excludeDevtools = false
overlays {
// https://docs.freefair.io/gradle-plugins/current/reference/#_io_freefair_war_overlay
// Note: The "excludes" property is only for files in the war dependency.
// If a jar is excluded from the war, it could be brought back into the final war as a dependency
// of non-war dependencies. Those should be excluded via normal gradle dependency exclusions.
cas {
from "org.apereo.cas:cas-server-webapp-bootadmin-server:${project.casVersion}"
provided = false
//excludes = ["WEB-INF/lib/somejar-1.0*"]
}
}
}
bootRun {
sourceResources sourceSets.main
classpath = sourceSets.main.runtimeClasspath
}
dependencies {
implementation "org.apereo.cas:cas-server-webapp-init-bootadmin-server:${project.casVersion}"
implementation "org.apereo.cas:cas-server-webapp-bootadmin-server:${project.casVersion}"
}
apply plugin: "com.google.cloud.tools.jib"
jib {
from {
image = project.baseDockerImage
}
to {
image = "${project.imageorg}/${project.imagerepo}"
/**
ecr-login: Amazon Elastic Container Registry (ECR)
gcr: Google Container Registry (GCR)
osxkeychain: Docker Hub
*/
credHelper = "osxkeychain"
/**
auth {
username = "*******"
password = "*******"
}
*/
tags = ["v" + casServerVersion]
}
container {
creationTime = "USE_CURRENT_TIMESTAMP"
entrypoint = ['/docker/entrypoint.sh']
ports = ['80', '443', '8080', '8443']
labels = [version:casServerVersion, name:project.imagerepo, group:project.group, org:project.imageorg]
workingDirectory = '/docker/cas/war'
}
extraDirectories {
paths {
path {
from = file('src/main/jib')
}
path {
from = file('etc/cas')
into = '/etc/cas'
}
path {
from = file("build/libs")
into = "/docker/cas/war"
}
}
permissions = [
'/docker/entrypoint.sh': '755'
]
}
allowInsecureRegistries = project.allowInsecureRegistries
}