Files
Ubuntu_docs/Jenkins_install.md
2025-04-07 07:46:21 +05:00

87 lines
1.6 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

Install by docs from https://www.cherryservers.com/blog/install-jenkins-ubuntu
## Prepare installation
Открываю нужный сервер
```sh
wsl
```
```sh
sudo apt update
```
```sh
sudo apt upgrade
```
```sh
sudo apt install openjdk-21-jdk openjdk-21-jre -y &&
java -version
```
## Add Jenkins Repository
```sh
sudo wget -O /usr/share/keyrings/jenkins-keyring.asc https://pkg.jenkins.io/debian-stable/jenkins.io-2023.key
```
Next, add the Jenkins repository to your systems sources.list:
```sh
sudo sh -c 'echo deb [signed-by=/usr/share/keyrings/jenkins-keyring.asc] https://pkg.jenkins.io/debian binary/ > /etc/apt/sources.list.d/jenkins.list'
```
```sh
sudo apt update
```
```sh
sudo apt install jenkins -y
```
If the software was installed incorrectly, you can reinstall it after uninstalling it first.:
```sh
sudo apt remove --purge jenkins
```
```sh
jenkins --version
```
Try run jenkins without service
```sh
sudo -u jenkins /usr/bin/jenkins --httpPort=8081 --httpListenAddress=0.0.0.0
```
```sh
sudo mcedit /lib/systemd/system/jenkins.service
```
```sh
sudo systemctl start jenkins &&
sudo systemctl enable jenkins &&
sudo systemctl status jenkins
```
```sh
sudo journalctl -xeu jenkins.service | tail -n 50
```
Если порт занят, проверяем кем:
```sh
sudo lsof -i :8081
```
Переопределяем порт:
```sh
sudo mcedit /etc/default/jenkins
```
```conf
HTTP_PORT=8081
```
```sh
sudo systemctl restart jenkins
```
```sh
start http://127.0.0.1:8081
```
See what port in locked
```sh
netstat -tpln
```