Skip to content

Commit

Permalink
Added Jenkins Installation script
Browse files Browse the repository at this point in the history
DevOps Tools - Added Jenkins Installation script
  • Loading branch information
the-1Riddle authored Feb 3, 2024
2 parents 3253faf + 5c46597 commit d7b094c
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 0 deletions.
36 changes: 36 additions & 0 deletions DevOps-Tools/Jenkins/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Jenkins Installation

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>
The script will first request for updates, then install Java which is a prerequisite for Jenkins after that it:
- Installs Jenkins
- Starts the service
- Displays the initial admin password.

# How to use the Installation script

1. Open your terminal by pressing the `ctrl + alt + t` command on your keyboard.
2. You can then clone this repo using the command:

```
git clone https://github.com/the-1Riddle/packageInstallationHub.git
```
3. Move to the directory where the script is, you can use this command:

```
cd packageInstallationHub/DevOps-Tools/Jenkins
```
4. Execute the file to install the package.

```
sudo ./install-jenkins.sh
```

Lastly, when the execution is done, the initial admin password will be displayed in the terminal.<br>
Go to `http://<your_server_ip>:8080` to complete the initial setup using the displayed admin password.
Then you can configure Jenkins according to your requirements after the initial setup.


> **Option**\
> Feel free to delete the cloned directory when you are done with the installation
**Good Luck**
32 changes: 32 additions & 0 deletions DevOps-Tools/Jenkins/install-jenkins.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/bin/bash

# Update the system
sudo apt-get update

# Install Java (required for Jenkins)
sudo apt-get install -y openjdk-11-jdk

# Add the Jenkins repository to the system
wget -q -O - https://pkg.jenkins.io/debian-stable/jenkins.io.key | sudo apt-key add -

# Add the Jenkins repository to the sources list
sudo sh -c 'echo deb http://pkg.jenkins.io/debian-stable binary/ > /etc/apt/sources.list.d/jenkins.list'

# Update the system after adding the repository
sudo apt-get update

# Install Jenkins
sudo apt-get install -y jenkins

# Start Jenkins
sudo systemctl start jenkins

# Enable Jenkins to start on boot
sudo systemctl enable jenkins

# Display the status of Jenkins
sudo systemctl status jenkins

# Output initial admin password
echo "Initial Admin Password:"
sudo cat /var/lib/jenkins/secrets/initialAdminPassword

0 comments on commit d7b094c

Please sign in to comment.