-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathbuild.gradle
89 lines (75 loc) · 2.95 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
/*
* (c) Copyright 2018 Palantir Technologies Inc. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
buildscript {
repositories {
mavenCentral() { metadataSources { mavenPom(); ignoreGradleMetadataRedirection() } }
gradlePluginPortal() { metadataSources { mavenPom(); ignoreGradleMetadataRedirection() } }
}
dependencies {
classpath 'com.palantir.gradle.externalpublish:gradle-external-publish-plugin:1.4.0'
classpath 'com.palantir.gradle.docker:gradle-docker:0.27.0'
classpath 'com.palantir.gradle.gitversion:gradle-git-version:0.13.0'
}
}
// Because controlling dependency flow between the ant and gradle tasks is complex and error-prone,
// it is up to the user to ensure that the artifacts desired by the varios publish tasks in this
// repo have already been generated.
apply plugin: 'com.palantir.external-publish'
apply plugin: 'com.palantir.external-publish-custom'
apply plugin: 'com.palantir.git-version'
repositories {
mavenCentral() { metadataSources { mavenPom(); ignoreGradleMetadataRedirection() } }
}
allprojects {
ant.importBuild("${project.rootDir}/build.xml") { antTaskName ->
'ant-' + antTaskName
}
version ant.'base.version' + '-' + gitVersion()
group 'com.palantir.cassandra'
// so the artifacts have our name and version, not apache's
ant.'version' = project.version
ant.'final.name' = 'palantir-cassandra-' + project.version
}
task distTar (type: Tar) {
from tarTree(file("${project.rootDir}/build/${ant.'final.name'}-bin.tar.gz"))
destinationDir file("${project.rootDir}/build/distributions")
baseName 'palantir-cassandra'
version project.version
extension 'tgz'
compression = Compression.GZIP
}
externalPublishing {
publication('dist') {
artifactId 'palantir-cassandra'
artifact distTar
}
}
apply plugin: 'com.palantir.docker'
docker {
name "palantirtechnologies/${rootProject.name}:${project.version}"
dockerfile file("${project.rootDir}/docker/Dockerfile")
tags 'latest', 'snapshot'
buildArgs([BUILD_VERSION: project.version])
files distTar.outputs,
file("${project.rootDir}/docker/cassandra.yaml"),
file("${project.rootDir}/docker/logback.xml"),
file("${project.rootDir}/docker/docker-entrypoint.sh"),
file("${project.rootDir}/conf/cassandra-env.sh")
}
publish.dependsOn dockerPush
dockerPush.onlyIf {
versionDetails().isCleanTag
}