forked from stephen-fox/chrome-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
30 lines (25 loc) · 898 Bytes
/
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
apply plugin: 'base'
version = externalVersion
def imageName = rootProject.name + ':' + version
def localImageTag = 'local/' + imageName
def registryImageTag = deployRepoUrl + '/' + imageName
task buildImage(type: Exec) {
description 'Builds the Docker image.'
group 'build'
def resources = file(projectDir.absolutePath + File.separator + 'image')
workingDir resources.absolutePath
commandLine 'docker', 'build', '-t', localImageTag, resources.absolutePath
}
task tagLocalImage(type: Exec) {
mustRunAfter 'buildImage'
description 'Tags the image.'
group 'publish'
commandLine 'docker', 'tag', localImageTag, registryImageTag
}
task pushImage(type: Exec) {
dependsOn 'buildImage', 'tagLocalImage'
mustRunAfter 'clean'
description 'Pushes the image to the Docker registry.'
group 'publish'
commandLine 'docker', 'push', registryImageTag
}