-
Notifications
You must be signed in to change notification settings - Fork 4
/
build.gradle
98 lines (83 loc) · 3.67 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
import com.github.jk1.license.filter.LicenseBundleNormalizer
import com.github.jk1.license.render.CsvReportRenderer
import com.github.jk1.license.render.InventoryHtmlReportRenderer
import com.github.jk1.license.render.TextReportRenderer
plugins {
id 'idea'
id 'com.bmuschko.docker-remote-api' version '6.4.0' apply false
id 'com.github.jk1.dependency-license-report' version '1.11'
id "com.gorylenko.gradle-git-properties" version "2.2.0"
id 'maven-publish'
}
ext {
registryInsecure = project.hasProperty("registryInsecure")
registryUrl = project.hasProperty("registryUrl") ? project.getProperty("registryUrl") : System.getenv("DOCKER_URL")
registryUsername = project.hasProperty("registryUsername") ? project.getProperty("registryUsername") : System.getenv("DOCKER_USERNAME")
registryPassword = project.hasProperty("registryPassword") ? project.getProperty("registryPassword") : System.getenv("DOCKER_PASSWORD")
println "registryUrl=$registryUrl"
println "registryInsecure=$registryInsecure"
println "registryUsername=$registryUsername"
repoUsername = project.hasProperty("repoUsername") ? project.getProperty("repoUsername") : System.getenv("NEXUS_USERNAME")
repoPassword = project.hasProperty("repoPassword") ? project.getProperty("repoPassword") : System.getenv("NEXUS_PASSWORD")
println "repoUsername=$repoUsername"
connectionString = project.hasProperty("connectionString") ? project.getProperty("connectionString") : System.getenv("AZURE_CONNECTION_STRING")
}
configure(subprojects.findAll { it.name.contains("docker") || it.name.contains("reaper") }) {
apply plugin: 'com.bmuschko.docker-remote-api'
docker {
registryCredentials {
url = registryUrl
username = registryUsername
password = registryPassword
}
}
}
def getGitCommitHash = { ->
def stdout = new ByteArrayOutputStream()
exec {
commandLine 'git', 'rev-parse', '--short', 'HEAD'
standardOutput = stdout
}
return stdout.toString().trim()
}
ext.gitCommitHash = getGitCommitHash()
ext.latestElassandraVersion = (new File("${rootDir}/docker/supportedElassandraVersions.txt") as String[])[0]
if (!ext.javaElassandraVersion) {
// the elassandra version used to build k8s-addons (seedProvider, config loader...)
ext.javaElassandraVersion = ext.latestElassandraVersion
}
task prepareDependenciesSources(type:Exec) {
// download the source code of the thirdparty libraries under GPL & LGPL license
commandLine './download-sources.sh', 'sources-url.csv'
}
licenseReport {
renderers = [new CsvReportRenderer(separator:';'), new TextReportRenderer(), new InventoryHtmlReportRenderer('index.html', 'Elassandra Operator License Report')]
filters = [new LicenseBundleNormalizer(bundlePath: rootProject.file('license-normalizer-bundle.json'))]
projects = [project] + project.subprojects
excludes = [ ]
}
// see storage account -> access keys for connectionString
task uploadLicenseReport(type: com.strapdata.gradle.AzureStorageDeployTask) {
dependsOn generateLicenseReport
connectionString connectionString
container 'elassandra-operator'
fileToDeploy 'build/reports/dependency-license/index.html'
mimeType 'text/html'
}
task uploadLicenseNotices(type: com.strapdata.gradle.AzureStorageDeployTask) {
dependsOn generateLicenseReport
connectionString connectionString
container 'elassandra-operator'
fileToDeploy 'build/reports/dependency-license/THIRD-PARTY-NOTICES.txt'
mimeType 'text/plain'
}
task dockerBuild {
dependsOn 'prepareDependenciesSources'
dependsOn ':java:operator:jibDockerBuild'
dependsOn ':docker:dockerBuildAllVersions'
}
task dockerPush {
dependsOn ':java:operator:jib'
dependsOn ':docker:dockerPushAllVersions'
dependsOn ':reaper:pushImage'
}