Building an app using gradle with jenkins in docker
I want to build my project with gradle.
To achieve this I have a docker file with installation details of Gradle and Java and I am trying to run it as a Jenkins job.
I have the docker file in the root of my project and I have configured Jenkins to pull code from git.
I have installed Jenkins in docker too..
But I am not sure hot to run the docker file as a Jenkins Job and then run Gradle as a Jenkins Job.
One Solution collect form web for “Building an app using gradle with jenkins in docker”
These would be a checking list you would need to follow:
- install the jenkins git plugin https://wiki.jenkins-ci.org/display/JENKINS/Git+Plugin
- install the jenkins gradle plugin https://wiki.jenkins-ci.org/display/JENKINS/Gradle+Plugin
- in your gradle build, add the gradle docker plugin that will allow you to handle the dockerfile. Make sure you have the docker client installed on the build machine https://github.com/bmuschko/gradle-docker-plugin
- create a task in your gradle build that will publish the artifact in the docker image (make this task dependent on the build task)
- fire this task from jenkins. After the image is built, you should push the docker container image to a local docker repository or you can start the container directly.