-
Notifications
You must be signed in to change notification settings - Fork 111
/
build.gradle
60 lines (49 loc) · 1.8 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
import groovy.json.JsonSlurper
plugins {
id 'io.github.gradle-nexus.publish-plugin' version '1.0.0'
}
allprojects {
repositories {
mavenCentral()
}
project.ext.set("publishGroupId", group)
}
nexusPublishing {
transitionCheckOptions {
maxRetries.set(150)
delayBetween.set(Duration.ofSeconds(5))
}
repositories {
sonatype {
username = project.hasProperty("ossrhToken") ? project.ext["ossrhToken"] : ""
password = project.hasProperty("ossrhTokenPassword") ? project.ext["ossrhTokenPassword"] : ""
}
}
}
tasks.create('createTestSubAccount') {
doFirst {
println("Task createTestSubAccount called with module $moduleName")
def cloudinaryUrl = ""
// core does not use test clouds, skip (keep empty file for a more readable generic travis test script)
if (moduleName != "core") {
println "Creating test cloud..."
def baseUrl = new URL('https://sub-account-testing.cloudinary.com/create_sub_account')
def connection = baseUrl.openConnection()
connection.with {
doOutput = true
requestMethod = 'POST'
def json = new JsonSlurper().parseText(content.text)
def cloud = json["payload"]["cloudName"]
def key = json["payload"]["cloudApiKey"]
def secret = json["payload"]["cloudApiSecret"]
cloudinaryUrl = "CLOUDINARY_URL=cloudinary://$key:$secret@$cloud"
}
}
def dir = new File("${projectDir.path}${File.separator}tools")
dir.mkdir()
def file = new File(dir, "cloudinary_url.txt")
file.createNewFile()
file.text = cloudinaryUrl
println("Test sub-account created succesfully!")
}
}