Skip to content

Commit d7b094c

Browse files
authored
Added Jenkins Installation script
DevOps Tools - Added Jenkins Installation script
2 parents 3253faf + 5c46597 commit d7b094c

2 files changed

Lines changed: 68 additions & 0 deletions

File tree

DevOps-Tools/Jenkins/README.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Jenkins Installation
2+
3+
The bash script in `install-jenkins` files automates the installation of the Jenkins (LTS) version on a Debian-based Linux system that includes Ubuntu and more.<br>
4+
The script will first request for updates, then install Java which is a prerequisite for Jenkins after that it:
5+
- Installs Jenkins
6+
- Starts the service
7+
- Displays the initial admin password.
8+
9+
# How to use the Installation script
10+
11+
1. Open your terminal by pressing the `ctrl + alt + t` command on your keyboard.
12+
2. You can then clone this repo using the command:
13+
14+
```
15+
git clone https://github.com/the-1Riddle/packageInstallationHub.git
16+
```
17+
3. Move to the directory where the script is, you can use this command:
18+
19+
```
20+
cd packageInstallationHub/DevOps-Tools/Jenkins
21+
```
22+
4. Execute the file to install the package.
23+
24+
```
25+
sudo ./install-jenkins.sh
26+
```
27+
28+
Lastly, when the execution is done, the initial admin password will be displayed in the terminal.<br>
29+
Go to `http://<your_server_ip>:8080` to complete the initial setup using the displayed admin password.
30+
Then you can configure Jenkins according to your requirements after the initial setup.
31+
32+
33+
> **Option**\
34+
> Feel free to delete the cloned directory when you are done with the installation
35+
36+
**Good Luck**
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#!/bin/bash
2+
3+
# Update the system
4+
sudo apt-get update
5+
6+
# Install Java (required for Jenkins)
7+
sudo apt-get install -y openjdk-11-jdk
8+
9+
# Add the Jenkins repository to the system
10+
wget -q -O - https://pkg.jenkins.io/debian-stable/jenkins.io.key | sudo apt-key add -
11+
12+
# Add the Jenkins repository to the sources list
13+
sudo sh -c 'echo deb http://pkg.jenkins.io/debian-stable binary/ > /etc/apt/sources.list.d/jenkins.list'
14+
15+
# Update the system after adding the repository
16+
sudo apt-get update
17+
18+
# Install Jenkins
19+
sudo apt-get install -y jenkins
20+
21+
# Start Jenkins
22+
sudo systemctl start jenkins
23+
24+
# Enable Jenkins to start on boot
25+
sudo systemctl enable jenkins
26+
27+
# Display the status of Jenkins
28+
sudo systemctl status jenkins
29+
30+
# Output initial admin password
31+
echo "Initial Admin Password:"
32+
sudo cat /var/lib/jenkins/secrets/initialAdminPassword

0 commit comments

Comments
 (0)