File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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
You can’t perform that action at this time.
0 commit comments