-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdeploy.gradle
48 lines (41 loc) · 1.34 KB
/
deploy.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
apply plugin: 'com.novoda.bintray-release'
ext {
travisRepoSlug = System.getenv('TRAVIS_REPO_SLUG')
travisPullRequest = System.getenv('TRAVIS_PULL_REQUEST')
travisTag = System.getenv('TRAVIS_TAG')
bintrayUser = System.getenv('BINTRAY_USER')
bintrayKey = System.getenv('BINTRAY_KEY')
}
project.version = travisTag ?: project.version
task ci {
if (travisRepoSlug != project.repoSlog) {
doLast {
println("Skipping snapshot deployment: wrong repository. Expected '$project.repoSlog' but was '$travisRepoSlug'.")
}
} else if (travisPullRequest != "false") {
doLast {
println("Skipping snapshot deployment: was pull request.")
}
} else if (travisTag == null || travisTag == '') {
doLast {
println("Skipping snapshot deployment: tag not set as x.y.z but was '$travisTag'.")
}
} else if (bintrayUser == null || bintrayKey == null) {
doLast {
println("Skipping snapshot deployment: bintray credentials not set.")
}
} else {
dependsOn 'bintrayUpload'
}
}
publish {
userOrg = project.user
groupId = project.group
artifactId = project.artifactId
publishVersion = project.version
desc = ''
website = project.website
bintrayUser = bintrayUser
bintrayKey = bintrayKey
dryRun = false
}