-
Notifications
You must be signed in to change notification settings - Fork 0
/
s3.gradle
33 lines (30 loc) · 918 Bytes
/
s3.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
apply plugin: "maven-publish"
def prop(name) {
return findProperty(name) ?: System.getenv(name)
}
//gradle tm
if(prop("s3Endpoint") != null) {
System.setProperty("org.gradle.s3.endpoint", prop("s3Endpoint"))
}
publishing {
publications {
Release(MavenPublication) {
from components.java
groupId project.group
artifactId project.name
version version
repositories {
maven {
url "s3://${prop("s3Bucket")}/releases"
credentials(AwsCredentials) {
accessKey prop("s3AccessKey") ?: ""
secretKey prop("s3SecretKey") ?: ""
}
}
}
}
}
}
publishReleasePublicationToMavenRepository.onlyIf {
prop("s3AccessKey") != null && prop("s3SecretKey") != null && prop("s3Bucket") != null
}