forked from NuVotifier/NuVotifier
-
Notifications
You must be signed in to change notification settings - Fork 0
/
publish.gradle
52 lines (48 loc) · 1.6 KB
/
publish.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
// This file contains special build instructions specifically for the ParallelBlock CI in order to instruct it how to
// build the project. Usually, this shouldn't be interacted with by a human.
import com.mashape.unirest.http.*
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.mashape.unirest:unirest-java:1.4.9'
}
}
subprojects {
apply plugin: "maven-publish"
publishing {
repositories {
maven {
name 'ibj'
if (project.version.endsWith("-SNAPSHOT"))
url "$System.env.SNAPSHOT_REPO"
else
url "$System.env.RELEASE_REPO"
credentials {
username "$System.env.REPO_USR"
password "$System.env.REPO_PSW"
}
}
}
publications {
versioned(MavenPublication) {
from components.java
}
}
}
if (System.env.LATEST_BUILD) {
task publishLatestToIbjBlockRaw {
inputs.files(configurations.archives.artifacts.files)
outputs.upToDateWhen {false}
doLast {
configurations.archives.artifacts.each {
def resp = Unirest.put("$System.env.RAW_UPLOAD_PATH/${it.name}.${it.extension}")
.basicAuth("$System.env.REPO_USR", "$System.env.REPO_PSW")
.body(it.file.bytes).asString()
assert resp.status >= 200 && resp.status <= 299
}
}
}
}
}