| by Arround The Web | No comments

Set Up a Jenkins Build Server – AWS

Jenkins is a server utilized to build and test software projects and make them efficient by integrating with alterations to the project. After that, these changes will be attached to the original code to be used with the application. Amazon’s cloud platform offers its users to set up a Jenkins Build server using its services.

This guide contains the following sections:

How to Install and Set up Jenkins on AWS EC2?

To set up a Jenkins Build Server, create and connect to the EC2 instance. To look at the creation and connection process, click here:

Update the yum packages:

sudo yum update -y

Get extra packages from the Jenkins repository:

sudo wget -O /etc/yum.repos.d/jenkins.repo https://pkg.jenkins.io/redhat-stable/jenkins.repo

Import packages from the link:

sudo rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io.key

Upgrade the yum packages:

sudo yum upgrade

Install Java JDK 11 on the Amazon Linux instance:

sudo amazon-linux-extras install java-openjdk11 -y

Install Jenkins using the following command:

sudo yum install jenkins -y

Enable Jenkins service:

sudo systemctl enable jenkins

Start Jenkins service:

sudo systemctl start jenkins

Verify that the Jenkins is started:

sudo systemctl status jenkins

Head into the EC2 dashboard and copy the IP address of the instance:

Paste the IP address with port 8080 on the web browser:

Get the password to log in to the Jenkins Server:

sudo cat /var/lib/jenkins/secrets/initialAdminPassword

Copy the password provided upon the execution of the above command:

Paste the password and click on the “Continue” button:

Select the plugins to be installed on the Jenkins server:

Type GitHub in the search bar of Jenkins and click on the “Install” button:

It will take a few moments to install the plugins on Jenkins:

Create a user on Jenkins by providing credentials and then clicking on the “Save and Continue” button:

Verify the address and click on the “Save and Finish” button:

The Jenkins server is ready to be used by clicking on the “Start using Jenkins” button:

How to Set up a Build Server Using Jenkins?

To build a server click on the “Configure a cloud” tab:

Install cloud plugins by clicking on the link:

Search for the EC2 instance and install its plugins by clicking on the “Install without restart” button:

After installing plugins, locate “Manage Jenkins” from the left menu and click on it:

Click on the “Manage Nodes and Clouds” button:

Click on the “Configure Clouds” button:

Add Amazon EC2 service to be used in Jenkins server:

Click on the “Add” button under the EC2 credentials tab:

Provide the IAM credentials to the Server:

Add Access and Secret keys and then click on the “Add” button:

After that, provide the Region and click on the “Add” button for EC2 private key pair section:

Select the “SSH Username with private key” and enter “ec2-user” as Username:

Select the “Enter directly” option and paste the contents of the private key pair:

Click on the “Test Connection” button and press the “Save” button:

Built-In node has been created successfully:

This was all about setting up a Jenkins Build server with AWS service.

Conclusion

To set up a Jenkins Server, install Jenkins on the EC2 instance and then access it using the IP address with port 8080 on the web browser. After that, install plugins from the cloud configuration and configure EC2 settings. After the configuration, test the connection to get the success message which indicates that the setup has been created. This guide has demonstrates the process of installing the Jenkins on EC2 and then setting up Build server on it.

Share Button

Source: linuxhint.com

Leave a Reply