How To Setup Jenkin on Rocky Linux 8.

Brief Introduction to Jenkins
Jenkins is an open-source automation server that enables developers to build, test, and deploy their software reliably. It facilitates continuous integration and continuous delivery (CI/CD) by automating the parts of software development related to building, testing, and deploying, thereby allowing teams to integrate changes more frequently and with higher confidence.

VM Specifications
  • Hostname: Rocky
  • CPU: 1
  • Memory: 1 GB
  • Disk: 16 GB
  • Internal IP: 172.16.1.252
  • External IP: 172.16.1.252
  • User: root
  • Password: redhat
Installation and Setup Steps

1. Install Java, wget, and rsyslog:

# dnf install java-17-openjdk-devel wget rsyslog

2. Start rsyslog service:

# systemctl start rsyslog

3. Add Jenkins repository:

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

4. Import Jenkins GPG key:

# rpm --import https://pkg.jenkins.io/redhat/jenkins.io-2023.key

5. Install Jenkins:

# dnf install jenkins

6. Start Jenkins service:

# systemctl start jenkins

7. Enable Jenkins to start on boot:

# systemctl enable jenkins

8. Check Jenkins service status:

# systemctl status jenkins

9. Access Jenkins

Open a browser and navigate to http://jen01.darole.org:8080
Retrieve the Initial Admin Password
To unlock Jenkins, you need to retrieve the initial admin password from the Jenkins server.

# cat /var/lib/jenkins/secrets/initialAdminPassword

Copy the password displayed in the terminal.

 



10. Install Suggested Plugins
On the "Customize Jenkins" page, select "Install suggested plugins."
Jenkins will automatically install the recommended plugins. This may take a few minutes.


11. Create the First User
Once the plugins are installed, you will be prompted to create the first Jenkins user.
Fill in the following fields:
  • Username: (Enter your desired username)
  • Password: (Enter your desired password)
  • Full name: (Enter your full name)
  • Email: (Enter your email address)
Click "Save and Finish."



12. Configure Jenkins URL
On the "Instance Configuration" page, set the Jenkins URL to http://jen01.darole.org:8080/.
Click "Save and Finish."


13. Jenkins is Ready
You will see a confirmation page indicating that "Jenkins is ready!"
Click "Start using Jenkins" to proceed to the Jenkins dashboard.


14. Jenkins Dashboard
You will now be directed to the Jenkins dashboard, where you can start creating jobs, managing configurations, and utilizing all the features Jenkins offers.













Problem: 

Date: 26-May-2024

The DevOps team at xFusionCorp Industries is initiating the setup of CI/CD pipelines and has decided to utilize Jenkins as their server. Execute the task according to the provided requirements:

1. Install jenkins on jenkins server using yum utility only, and start its service. You might face timeout issue while starting the Jenkins service, please refer this link for help.

2. Jenkin's admin user name should be theadmin, password should be Adm!n321, full name should be Javed and email should be javed@jenkins.stratos.xfusioncorp.com.

Note:

1. For this task, access the Jenkins server by SSH using the root user and password S3curePass from the jump host.

2. Jenkin's admin user name should be theadmin, password should be Adm!n321, full name should be James and email should be james@jenkins.stratos.xfusioncorp.com.



# dnf install java-17-openjdk-devel wget rsyslog

# systemctl start rsyslog

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

# rpm --import https://pkg.jenkins.io/redhat/jenkins.io-2023.key

# sudo dnf install jenkins

# sudo systemctl start jenkins

# sudo systemctl enable jenkins

# sudo systemctl status jenkins


https://8080-port-5b716e355ad747c1.labs.kodekloud.com/

once plugin installation is completed, provide the user details and complete the installation.


Problem: 

Date: 27 May 2024

The Nautilus DevOps team has recently setup a Jenkins server, which they want to use for some CI/CD jobs. Before that they want to install some plugins which will be used in most of the jobs. Please find below more details about the task

1. Click on the Jenkins button on the top bar to access the Jenkins UI. Login using username admin and Adm!n321 password.

2. Once logged in, install the Git and GitLab plugins. Note that you may need to restart Jenkins service to complete the plugins installation, If required, opt to Restart Jenkins when installation is complete and no jobs are running on plugin installation/update page i.e update centre.

Note:

1. After restarting the Jenkins service, wait for the Jenkins login page to reappear before proceeding.

2. For tasks involving web UI changes, capture screenshots to share for review or consider using screen recording software like loom.com for documentation and sharing.


Problem

Date: 27 May 2024

The Nautilus team is integrating Jenkins into their CI/CD pipelines. After setting up a new Jenkins server, they're now configuring user access for the development team, Follow these steps:

1. Click on the Jenkins button on the top bar to access the Jenkins UI. Login with username admin and password Adm!n321.

2. Create a jenkins user named john with the passwordB4zNgHA7Ya. Their full name should match John.

3. Utilize the Project-based Matrix Authorization Strategy to assign overall read permission to the john user.

4. Remove all permissions for Anonymous users (if any) ensuring that the admin user retains overall Administer permissions.

5. For the existing job, grant john user only read permissions, disregarding other permissions such as Agent, SCM etc.

Note:

1. You may need to install plugins and restart Jenkins service. After plugins installation, select Restart Jenkins when installation is complete and no jobs are running on plugin installation/update page.

2. After restarting the Jenkins service, wait for the Jenkins login page to reappear before proceeding. Avoid clicking Finish immediately after restarting the service.

3. Capture screenshots of your configuration for review purposes. Consider using screen recording software like loom.com for documentation and sharing.

No comments:

Post a Comment