The following Gradle config lets me run gradle bootBuildImage
inside of bitbucket-pipelines. But the same config settings also break the same command gradle bootBuildImage
when run outside of bitbucket-pipelines.
I want one Gradle task to run locally (outside of bitbucket) and a second Gradle task to run within bitbucket. How do I do this? Can I copy the Gradle task? Or inherit it?
tasks.named<BootBuildImage>("bootBuildImage") {
docker {
host.set("tcp://172.17.0.1:2375")
bindHostToBuilder.set(true)
securityOptions.set(listOf())
buildWorkspace {
bind {
source.set("/opt/atlassian/bitbucketci/agent/build/cache-${project.name}.work")
}
}
buildCache {
bind {
source.set("/opt/atlassian/bitbucketci/agent/build/cache-${project.name}.build")
}
}
launchCache {
bind {
source.set("/opt/atlassian/bitbucketci/agent/build/cache-${project.name}.launch")
}
}
}
}
I tried the following, registering the same BootBuildImage
class with a new task name:
tasks.register<BootBuildImage>("localBuildImage") {
}
However this fails because it lacks the config settings that the spring plugins give to bootBuildImage
. I was hoping to be able to copy bootBuildImage
or make a derived version that inherits from bootBuildImage
. Are either of those possible?