Jump to content

Set Up a Jenkins Build Server – AWS


Linux Hint

Recommended Posts

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:

word-image-311082-1.png

Update the yum packages:

sudo yum update -y

word-image-311082-2.png

Get extra packages from the Jenkins repository:

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

word-image-311082-3.png

Import packages from the link:

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

Upgrade the yum packages:

sudo yum upgrade

word-image-311082-4.png

Install Java JDK 11 on the Amazon Linux instance:

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

word-image-311082-5.png

Install Jenkins using the following command:

sudo yum install jenkins -y

word-image-311082-6.png

Enable Jenkins service:

sudo systemctl enable jenkins

Start Jenkins service:

sudo systemctl start jenkins

Verify that the Jenkins is started:

sudo systemctl status jenkins

word-image-311082-7.png

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

word-image-311082-8.png

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

word-image-311082-9.png

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:

word-image-311082-10.png

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

word-image-311082-11.png

Select the plugins to be installed on the Jenkins server:

word-image-311082-12.png

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

word-image-311082-13.png

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

word-image-311082-14.png

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

word-image-311082-15.png

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

word-image-311082-16.png

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

word-image-311082-17.png

How to Set up a Build Server Using Jenkins?

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

word-image-311082-18.png

Install cloud plugins by clicking on the link:

word-image-311082-19.png

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

word-image-311082-20.png

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

word-image-311082-21.png

Click on the “Manage Nodes and Clouds” button:

word-image-311082-22.png

Click on the “Configure Clouds” button:

word-image-311082-23.png

Add Amazon EC2 service to be used in Jenkins server:

word-image-311082-24.png

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

word-image-311082-25.png

Provide the IAM credentials to the Server:

word-image-311082-26.png

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

word-image-311082-27.png

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

word-image-311082-28.png

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

word-image-311082-29.png

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

word-image-311082-30.png

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

word-image-311082-31.png

Built-In node has been created successfully:

word-image-311082-32.png

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.

View the full article

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...