Tabla de contenido
Cuatro, crea una tarea asociada con el shell
Cinco, crea una tarea asociada con gitlab
Uno, instale jenkins
- Apague el firewall
- Cerrar selinux
[root @ localhost ~] # systemctl detener firewalld
[root @ localhost ~] # setenforce 0
[root @ localhost ~] # systemctl deshabilitar firewalld
[root @ localhost ~] # sed -i "s / SELINUX = enforcing / SELINUX = disabled / g "/ etc / selinux / config
Implementar java
[root @ localhost ~] # yum -y instalar java-1.8.0
Implementar jenkins (aquí lo instalo a través del paquete rpm debido a la lentitud de la red)
[root @ localhost ~] # rpm -ivh jenkins-2.222.4-1.1.noarch.rpm
[root @ localhost ~] # systemctl start jenkins
[root @ localhost ~] # systemctl enable jenkins
Actualizar la configuración de jenkins
[root @ localhost ~] # vim /var/lib/jenkins/hudson.model.UpdateCenter.xml
<? xml version = '1.1' encoding = 'UTF-8'?>
<sitios>
<sitio>
<id> predeterminado < / id>
<url> https://mirrors.tuna.tsinghua.edu.cn/jenkins/updates/update-center.json </url> # 改为 国内 的 网站
</site>
</sites>
Reiniciar jenkins
[root @ localhost ~] # systemctl reiniciar jenkins
Configure la aceleración del complemento de descarga (si no existe tal archivo, inicie jenkins y espere un momento)
[root @ localhost ~] # cd / var / lib / jenkins / updates /
[root @ localhost updates] # sed -i 's / http: \ / \ / updates.jenkinsci.org \ / download / https: \ / \ /mirrors.tuna.tsinghua.edu.cn\/jenkins/g 'default.json
[root @ localhost updates] # sed -i' s / http: \ / \ / www.google.com/https:\/\/ www.baidu.com/g 'default.json
Iniciar sesión en jenkins
2. Pantalla china jenkins
Primero instale dos complementos
- chino
- lugar
Tres, instale el complemento
- git
- gitlab
Cuatro, crea una tarea asociada con el shell
- Cuando se ejecuta esta tarea, se ejecutará el script de shell especificado
Cinco, crea una tarea asociada con gitlab
- Cuando se ejecuta esta tarea, el código se extraerá de gitlab
Primero instale el componente git en el nodo gitlab
# yum install git -y
Es mejor realizar una prueba de código de extracción
clon de git http://192.168.31.64/root/zxhk.git
Nota
- Instalar complementos de git y gitlab en jenkis
- Instale git en el nodo donde se encuentra jenkins