Jenkins linux
时间: 2023-11-21 19:13:26 浏览: 80
Jenkins is a popular open-source automation server that is used to build, test, and deploy software projects. It is platform-independent, meaning it can be installed on various operating systems, including Linux.
To install Jenkins on Linux, you can follow these general steps:
1. Update your package lists:
```
sudo apt update
```
2. Install Java Development Kit (JDK) if it is not already installed. Jenkins requires Java 8 or later versions.
For example, on Ubuntu:
```
sudo apt install openjdk-11-jdk
```
3. Add the Jenkins repository key to your system:
```
wget -q -O - https://pkg.jenkins.io/debian/jenkins.io.key | sudo apt-key add -
```
4. Add the Jenkins repository address to your package sources:
```
sudo sh -c 'echo deb http://pkg.jenkins.io/debian-stable binary/ > /etc/apt/sources.list.d/jenkins.list'
```
5. Update your package lists again:
```
sudo apt update
```
6. Install Jenkins:
```
sudo apt install jenkins
```
7. Start the Jenkins service:
```
sudo systemctl start jenkins
```
Once Jenkins is running, you can access its web interface by opening your browser and navigating to `http://localhost:8080` (if you installed it on the same machine) or `http://<your-server-ip>:8080` (if you installed it on a remote machine).
You will be prompted to unlock Jenkins by providing an initial admin password. You can find this password in the following file:
```
sudo cat /var/lib/jenkins/secrets/initialAdminPassword
```
Follow the instructions on the web interface to complete the Jenkins setup.
Please note that these steps are for Debian/Ubuntu-based Linux distributions. The installation process may vary slightly for other Linux distributions.
阅读全文