-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathbuild.gradle
63 lines (57 loc) · 1.97 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
buildscript {
repositories {
maven { url "http://maven.aliyun.com/nexus/content/groups/public/" }
maven { url "https://oss.sonatype.org/content/groups/public/" }
maven { url "https://repo.spring.io/libs-milestone/" }
jcenter()
mavenCentral()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
classpath "se.transmode.gradle:gradle-docker:${transmodeGradleDockerVersion}"
}
}
allprojects {
apply plugin: 'java'
apply plugin: 'org.springframework.boot'
apply plugin: 'idea'
group = 'com.example'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = 1.8
repositories {
maven { url "http://maven.aliyun.com/nexus/content/groups/public/" }
maven { url "https://oss.sonatype.org/content/groups/public/" }
maven { url "https://repo.spring.io/libs-milestone/" }
jcenter()
mavenCentral()
}
dependencies {
testCompile "org.springframework.boot:spring-boot-starter-test"
}
dependencyManagement {
imports {
mavenBom "org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}"
}
}
if (project.subprojects) {
bootRepackage {
enabled = false
}
} else {
apply plugin: 'docker'
docker {
maintainer = 'happyyangyuan <happyyangyuan@163.com>'
baseImage = 'openjdk:8-jre-alpine'
}
task dockerBuild(type: Docker, dependsOn: build) {
applicationName = project.name
addFile {
from configurations.archives.artifacts.files
into '/data/workspace/' + project.name
}
workingDir '/data/workspace/' + project.name
setEnvironment('HOST_MACHINE_IP', hostMachineIp)
defaultCommand(['java', '-jar', '-Dspring.profiles.active=docker', "${project.name}-${project.version}.jar"])
}
}
}