Transmode / gradle-docker

A Gradle plugin to build Docker images from the build script.
Apache License 2.0
647 stars 142 forks source link

do not fail the build when can't push #100

Closed ghost closed 7 years ago

ghost commented 7 years ago

I do most of my dev locally I do not need to push my images to docker hub. Is it possible to skip this step so I do not get gradle failed build ?

bjornmagnusson commented 7 years ago

yes, it is possible to push based on gradle properties. In your docker task e.g. buildDocker, add push = project.hasProperty('push')

This means that if your gradle command includes -Ppush it will push to registry, otherwise it will not. Then you can... In development run gradle buildDocker, And in CI, run gradle buildDocker -Ppush