User Tools

Site Tools


инструмент_jenkins

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revision Both sides next revision
инструмент_jenkins [2023/09/14 16:44]
val [Установка]
инструмент_jenkins [2024/04/08 18:53]
val [Установка]
Line 7: Line 7:
 ===== Установка ===== ===== Установка =====
  
-  * [[Сервис JRE]]+  * [[Сервис JRE]]  !!! новая версия ниже
   * [[https://​www.jenkins.io/​doc/​book/​installing/​linux/​|Debian/​Ubuntu Long Term Support release]]   * [[https://​www.jenkins.io/​doc/​book/​installing/​linux/​|Debian/​Ubuntu Long Term Support release]]
 +  * [[https://​pkg.jenkins.io/​debian-stable/​]]
 +
 +  * !!! В текущей версии устанавливается так:
 +<​code>​
 +# wget -O /​usr/​share/​keyrings/​jenkins-keyring.asc https://​pkg.jenkins.io/​debian-stable/​jenkins.io-2023.key
 +
 +# echo deb [signed-by=/​usr/​share/​keyrings/​jenkins-keyring.asc] \
 +    https://​pkg.jenkins.io/​debian-stable binary/ | sudo tee \
 +    /​etc/​apt/​sources.list.d/​jenkins.list > /dev/null
 +    ​
 +# apt-get update
 +
 +# apt-get install fontconfig openjdk-17-jre
 +
 +# apt-get install jenkins
 +</​code>​
 +==== Смена порта ====
 +
 +  * Может понадобиться,​ если на этой-же системе разворачивается GitLab
   * [[https://​askubuntu.com/​questions/​1398910/​changed-jenkins-port-doesnt-applied|Changed Jenkins port doesn'​t applied]]   * [[https://​askubuntu.com/​questions/​1398910/​changed-jenkins-port-doesnt-applied|Changed Jenkins port doesn'​t applied]]
 <​code>​ <​code>​
Line 14: Line 33:
  
 server# systemctl edit jenkins server# systemctl edit jenkins
-... +</​code><​code>​
 [Service] [Service]
 Environment="​JENKINS_PORT=8081"​ Environment="​JENKINS_PORT=8081"​
-...+</​code><​code>​
 server# systemctl start jenkins server# systemctl start jenkins
  
 server# systemctl status jenkins server# systemctl status jenkins
 +</​code><​code>​
 +Dashboard -> Manage Jenkins -> System
 +  Jenkins URL: http://​server.corpX.un:​8081/​
 </​code>​ </​code>​
- 
 ===== Подключение ===== ===== Подключение =====
  
Line 33: Line 53:
   * [[https://​www.jenkins.io/​blog/​2022/​12/​27/​run-jenkins-agent-as-a-service/​|Create a new Jenkins node, and run your Jenkins agent as a service]]   * [[https://​www.jenkins.io/​blog/​2022/​12/​27/​run-jenkins-agent-as-a-service/​|Create a new Jenkins node, and run your Jenkins agent as a service]]
   * [[Сервис JRE]]   * [[Сервис JRE]]
 +
 +  * !!! В текущей версии нужно: Dashboard -> Manage Jenkins -> Security -> TCP port for inbound agents: Random
  
 <​code>​ <​code>​
Line 39: Line 61:
   * [[Пакет sudo]]   * [[Пакет sudo]]
 <​code>​ <​code>​
-Create a new node +Dashboard->​Set up an agent->Create a new node  
 +  Node name: gate 
 +  Type: Permanent Agent
   ...   ...
   Remote root directory: /​home/​jenkins/​   Remote root directory: /​home/​jenkins/​
   ...   ...
-  Use WebSocket: yes+  Use WebSocket: yes   !!! В текущей версии нет
   ...   ...
 </​code><​code>​ </​code><​code>​
Line 75: Line 99:
     sudo make install     sudo make install
 ... ...
 +</​code><​code>​
 +Dashboard -> dhcp freestyle project
 +  Build Now
 </​code>​ </​code>​
 ==== Pipeline ==== ==== Pipeline ====
  
 +  * !!! В первый раз обязательно запустить "​вручную"​
   * [[https://​www.jenkins.io/​doc/​book/​pipeline/​getting-started/​|Getting started with Pipeline]]   * [[https://​www.jenkins.io/​doc/​book/​pipeline/​getting-started/​|Getting started with Pipeline]]
  
Line 86: Line 114:
 Pipeline Pipeline
   Pipeline script from SCM   Pipeline script from SCM
-    Repository URL: http://​server.corp13.un:​3000/​student/​dhcp.git+    Repository URL: http://​server.corpX.un:​3000/​student/​dhcp.git
 </​code>​ </​code>​
  
Line 124: Line 152:
 Manage Jenkins -> Manage Plugins -> Available -> Gitea Manage Jenkins -> Manage Plugins -> Available -> Gitea
 </​code>​ </​code>​
 +
 +  * [[Инструмент Gitea#​Файл конфигурации]] Gitea: ALLOWED_HOST_LIST ​
  
 <​code>​ <​code>​
 Manage Jenkins -> Configure System -> Gitea Servers Manage Jenkins -> Configure System -> Gitea Servers
   Name: server   Name: server
-  Server URL: http://​server.corp13.un:3000/+  Server URL: http://​server.corpX.un:3000/
   Manage hooks   Manage hooks
     Jenkins Credentials Provider: Jenkins     Jenkins Credentials Provider: Jenkins
Line 141: Line 171:
     Poll SCM: yes     Poll SCM: yes
 </​code>​ </​code>​
- 
-  * [[Инструмент Gitea#​Файл конфигурации]] Gitea: ALLOWED_HOST_LIST ​ 
  
 <​code>​ <​code>​
 Gitea Gitea
-  Project->​Setings-Webhooks+  Project->​Setings->Webhooks
     Должен появиться Target URL и работать Test Delivery     Должен появиться Target URL и работать Test Delivery
     ​     ​
 Задержка,​ примерно,​ 30 секунд Задержка,​ примерно,​ 30 секунд
 </​code>​ </​code>​
инструмент_jenkins.txt · Last modified: 2024/04/16 07:40 by val