Automating builds

Once we have Jenkins up and running, it is time to start using it. We are going to create a task on Jenkins that will download the thimblerig-service master branch, execute the tests, build it, and archive the resultant artifact.

Let's start by creating a Freestyle project:

We have to tell Jenkins where the repository is located. In this example, we don't need authentication, but is very likely we would need it in a real-world scenario:

The thimblerig-service project is a Gradle project. We are going to use the Jenkins Gradle plugin for compiling, testing, and building our service:

Finally, we have to specify the location of the test reports and the artifact built:

And we are done. This is not very different when compared to what we usually do in our local environment. It downloads the code from the master branch and uses Gradle for building the service, as developers were doing, according to John in the story.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.223.171.168