# Jenkins部署

### 环境

Ubuntu 18.04

YApi v1.5.13

### 部署过程

```shell
wget -q -O - https://pkg.jenkins.io/debian/jenkins-ci.org.key | sudo apt-key add -
echo deb http://pkg.jenkins.io/debian-stable binary/ | sudo tee /etc/apt/sources.list.d/jenkins.list
apt-get update
ln -s /usr/local/jdk1.8/bin/java /usr/bin/java
apt-get install jenkins=2.150.1
```

修改Jenkins启动端口为8088（HTTP_PORT=8088）

```shell
vi /etc/default/jenkins
```

服务启动

```shell
service jenkins start
```

Jenkins 备份，只需要备份 /var/lib/jenkins 目录即可