Skip to content

Validate Jenkins

That's it! You've now deployed and configured a local Jenkins instance.

We're going to run through a couple quick steps to ensure that the deployed Jenkins can launch containers as part of the pipeline.

Create a Pipeline Job

  • From the Jenkins home page, select New Item in the left-hand navigation menu.
  • Enter a name for the job. "validate" will do.
  • Select the Pipeline job type.
  • Click the OK button at the bottom of the screen.

Configure a Pipeline

  • Scroll down to the Pipeline Configuration section.
  • The Definition drop down should already be set to Jenkins Templating Engine.

Important

This confirms that JTE has been installed successfully!

  • Check the box "Provide a pipeline template (Jenkinsfile)".
  • In the Jenkinsfile text box, enter:
docker.image("maven").inside{
    sh "mvn -v" 
}

Note

This Jenkinsfile pulls the latest maven image from Docker Hub and executes the command mvn -v within that container image.

This will validate that your local Jenkins can pull container images, run them, and then execute pipeline commands inside the launched container.

Jenkins Job Configuration

  • Click the Save button at the bottom of the screen.
  • This will redirect you back to the job's main page. Click Build Now in the left-hand navigation menu.
  • Under Build History select #1 to navigate to the Build page.
  • In the left-hand navigation menu, select Console Output to read the build logs.
  • Confirm that the pipeline successfully pulled the maven container image.
  • Confirm that the command mvn -v executed successfully and shows the Maven version.
  • Validate that the build finished successfully.

If all went well, the console output should show something like:

Jenkins Simple Job Console Logs

Back to top