table des matières
Troisièmement, installez le plug-in
Quatre, créez une tâche associée au shell
Cinq, créez une tâche associée à gitlab
Un, installez jenkins
- Éteignez le pare-feu
- Fermer selinux
[root @ localhost ~] # systemctl stop firewalld
[root @ localhost ~] # setenforce 0
[root @ localhost ~] # systemctl disable firewalld
[root @ localhost ~] # sed -i "s / SELINUX = enforcing / SELINUX = disabled / g "/ etc / selinux / config
Déployer Java
[root @ localhost ~] # yum -y installer java-1.8.0
Déployez jenkins (ici, j'installe via le package rpm en raison de la lenteur du réseau)
[root @ localhost ~] # rpm -ivh jenkins-2.222.4-1.1.noarch.rpm
[root @ localhost ~] # systemctl start jenkins
[root @ localhost ~] # systemctl enable jenkins
Mettre à jour la configuration de Jenkins
[root @ localhost ~] # vim /var/lib/jenkins/hudson.model.UpdateCenter.xml
<? xml version = '1.1' encoding = 'UTF-8'?>
<sites>
<site>
<id> default < / id>
<url> https://mirrors.tuna.tsinghua.edu.cn/jenkins/updates/update-center.json </url> # 改为 国内 的 网站
</site>
</sites>
Redémarrez jenkins
[root @ localhost ~] # systemctl restart jenkins
Configurez l'accélération du plugin de téléchargement (s'il n'y a pas de fichier de ce type, veuillez démarrer jenkins et attendez un moment)
[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
Connectez-vous à Jenkins
2. Affichage chinois jenkins
Installez d'abord deux plugins
- chinois
- lieu
Troisièmement, installez le plug-in
- git
- gitlab
Quatre, créez une tâche associée au shell
- Lorsque cette tâche est exécutée, le script shell spécifié sera exécuté
Cinq, créez une tâche associée à gitlab
- Lorsque cette tâche est exécutée, le code sera extrait de gitlab
Installez d'abord le composant git sur le nœud gitlab
# yum installer git -y
Il est préférable d'effectuer un test de code d'extraction
clone git http://192.168.31.64/root/zxhk.git
Remarque
- Installer les plugins git et gitlab dans jenkis
- Installez git sur le nœud où se trouve jenkins