Jenkins and the CLI

45 minutes
  • 5 Learning Objectives

About this Hands-on Lab

In this lab, you will be provided with a server that has Jenkins pre-installed but not fully configured.

As part of this lab, you will need to configure it for first use. Once configured and you can access the GUI, you will then need to configure it so you can use the Jenkins CLI.

Once configured, you will use the Jenkins CLI from the provided server and run a command to show it is configured properly for use.

Learning Objectives

Successfully complete this lab by achieving the following learning objectives:

Log In to the Provided Server

Log in to the server as cloud_user with the provided password to ensure you can log in. When the file SERVER-READY is shown in the /home/cloud_user folder, then you can follow along with the tasks.

Log In to the Jenkins Instance on Port 8080

The supplied CentOS 8 server has Jenkins pre-installed. Use the same username and password as the provided server to log into the GUI.

Configure Jenkins for First Use
  • Connect to the provided Jenkins server at port 8080.
  • Configure the Jenkins server for first use by adding the key as mentioned on the initial landing page, creating a user called admin, and then installing the default plugins.
Enable and Configure the Jenkins SSH Server via the GUI
  • Enable the SSH server built into Jenkins to use the fixed port 53801.
  • Create an SSH key using cloud_user and the ssh-keygen command.
  • Copy and then paste the generated id_rsa.pub from the cloud_user into the relevant location for the admin user in the GUI.
  • Save this configuration.
Test the Jenkins CLI

Test you can use the Jenkins CLI by running the Jenkins CLI help command through an SSH connection to the Jenkins server.

Additional Resources

Your development team needs to know how to work with Jenkins jobs and tasks in Jenkins using the CLI. Your manager would like someone to have experience configuring and using the Jenkins CLI.

You have been asked to perform this task and test the Jenkins CLI.

The server you have been provided has Jenkins installed and available on port 8080. The Jenkins user has been configured with sudo permissions and an SSH key but has not otherwise been configured.

You will need to do the following tasks.

  1. Connect to the provided Jenkins server at port 8080.
  2. Configure the Jenkins server for first use by adding the key as mentioned on the initial landing page and creating a user called admin then installing the default plugins.
  3. You will then enable the SSH server built into Jenkins to use the fixed port 53801. You will then create an SSH key using the cloud_user and the ssh-keygen command. Once that is completed, paste the generated id_rsa.pub into the relevant location for the admin user in the GUI.
  4. Test you can use the Jenkins CLI by running the help command through an SSH connection to the Jenkins server.

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?