Building an App as a Freestyle Jenkins Project

45 minutes
  • 2 Learning Objectives

About this Hands-on Lab

Jenkins is a powerful tool for automating continuous integration. One of the simplest ways to implement CI for a software application is to configure a freestyle project in Jenkins. With a freestyle project, you can configure Jenkins to execute a build every time a change is made to the source code.

Learning to configure a freestyle Jenkins project will also prepare you for more advanced ways of utilizing Jenkins. After completing this exercise, you will know how to implement a freestyle Jenkins build for an application.

Learning Objectives

Successfully complete this lab by achieving the following learning objectives:

Create a New Jenkins Freestyle Project Called train-schedule

In Jenkins, click on New Item. For the item name, type train-schedule, and select freestyle project.
Then click the OK button.

Trigger a Successful train-schedule Build with a Change in GitHub

Once the train-schedule project is fully configured, let’s make a change to the source code in our GitHub fork. This should trigger a successful build of the train-schedule project.

Additional Resources

The team has asked us to configure a Jenkins project to build the train schedule app. The source code for the application is hosted in the GitHub repository. The app already has build automation set up using gradle wrapper, and can be built with ./gradlew build. The team wants Jenkins to execute this automated build every time changes are pushed to the GitHub repository.

We will need to:

  • Setup the jenkins user with a secure password if prompted.
  • Configure Jenkins to authenticate with GitHub
  • Create a freestyle project in Jenkins
  • Configure the project to build the train schedule app
  • Set up a webhook to trigger the build whenever changes are made to the repository in GitHub
  • Configure the build to archive trainSchedule.zip as a build artifact

Note

If your build fails with the status "Finished: FAILURE", please run it again without changing any configuration. This issue is under investigation and will be fixed as soon as possible.

What are Hands-on Labs

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Sign In
Welcome Back!

Psst…this one if you’ve been moved to ACG!

Get Started
Who’s going to be learning?