This repository has been archived by the owner on Jun 13, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathbuild.gradle
121 lines (104 loc) · 3.5 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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.avast.gradle:gradle-docker-compose-plugin:0.7.1'
classpath 'com.github.ben-manes:gradle-versions-plugin:0.17.0'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.0'
classpath 'com.jcabi:jcabi-github:0.38'
}
}
group 'com.avast'
version = version == 'unspecified' ? '1.0-SNAPSHOT' : version
apply plugin: 'java'
apply plugin: 'scala'
apply plugin: 'maven'
apply plugin: 'com.github.ben-manes.versions'
apply plugin: 'docker-compose'
apply plugin: 'com.jfrog.bintray'
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
repositories {
mavenCentral()
jcenter()
maven {
url "http://downloads.mesosphere.io/maven"
}
}
task bundle(type: Tar) {
into("") {
from project.configurations.runtime
from project.tasks.jar
}
}
dockerCompose.isRequiredBy(test)
composeUp.dependsOn(bundle)
dockerCompose.environment.put('APP_VERSION', version)
dockerCompose {
waitForTcpPortsTimeout = java.time.Duration.ofMinutes(1)
captureContainersOutput = true
stopContainers = true
}
test.doFirst {
dockerCompose.exposeAsSystemProperties(test)
}
ext {
scalaVersion = System.getenv('SCALA_VERSION') ?: '2.12'
scalaLibraryVersion = System.getenv('SCALA_LIBRARY_VERSION') ?: '2.12.6'
marathonVersion = (System.getenv('MARATHON_VERSION') ?: '1.6.352').replace("v", "")
}
archivesBaseName = "marathon-vault-plugin_v${marathonVersion}"
dependencies {
compileOnly "org.scala-lang:scala-library:${scalaLibraryVersion}"
compileOnly "org.slf4j:slf4j-api:1.7.10"
compileOnly "mesosphere.marathon:plugin-interface_${scalaVersion}:${marathonVersion}"
compile "com.bettercloud:vault-java-driver:3.1.0"
testCompile "org.scalatest:scalatest_${scalaVersion}:3.0.5"
testCompile "junit:junit:4.12"
testCompile 'org.mockito:mockito-core:2.18.3'
testCompile 'org.asynchttpclient:async-http-client:2.4.7'
testCompile 'io.github.openfeign:feign-core:9.7.0'
testCompile 'io.github.openfeign:feign-gson:9.7.0'
}
test {
testLogging {
events 'failed'
exceptionFormat 'full'
}
}
task sourcesJar(type: Jar) {
from sourceSets.main.allSource
classifier = 'sources'
}
artifacts {
archives sourcesJar
}
bintray {
user = System.getenv('BINTRAY_USER')
key = System.getenv('BINTRAY_KEY')
configurations = ['archives']
publish = true
pkg {
repo = 'maven'
name = 'marathon-vault-plugin'
desc = 'Marathon plugin which injects Vault secrets via environment variables.'
userOrg = 'avast'
licenses = ['MIT']
vcsUrl = 'https://github.com/avast/marathon-vault-plugin.git'
websiteUrl = 'https://github.com/avast/marathon-vault-plugin'
issueTrackerUrl = 'https://github.com/avast/marathon-vault-plugin/issues'
labels = ['marathon', 'vault', 'secrets']
version {
name = project.version
vcsTag = project.version
}
}
}
import com.jcabi.github.*
task githubUpload {
dependsOn tasks.bundle
doLast {
new RtGithub(System.getenv("GITHUB_TOKEN")).repos().get(new Coordinates.Simple("avast", "marathon-vault-plugin")).releases().iterate().sort { -it.number() }.find().assets().upload(file(tasks.bundle.archivePath).bytes, 'application/tar+gzip', "bundle_${marathonVersion}.tar")
}
}