-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
31 lines (23 loc) · 718 Bytes
/
Copy pathbuild.gradle
File metadata and controls
31 lines (23 loc) · 718 Bytes
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
defaultTasks 'push'
project.group = 'cbd'
project.version = "${VERSION}"
ext {
env = System.getenv()
}
def imageName = "${env.DOCKER_REPO}/${project.group}/${project.name}:${env.TAG_VALUE}"
task build(type: Exec) {
workingDir '.'
commandLine 'docker', 'build', '-t', imageName, '-f', 'docker/Dockerfile', '.'
}
task push(type: Exec, dependsOn: 'build') {
commandLine 'docker', 'push', imageName
}
task rm(type: Exec) {
commandLine 'docker', 'image', 'rm', imageName
}
task stop(type: Exec) {
commandLine 'docker', 'rm', '-f', "${project.name}"
}
task test(type: Exec, dependsOn: 'build') {
commandLine 'docker', 'run', '-p', '8080:80', '-d', '--name', "${project.name}", imageName
}