инструмент_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
инструмент_jenkins [2024/09/07 15:25]
val [Установка]
инструмент_jenkins [2026/02/02 07:22] (current)
val [Установка]
Line 1: Line 1:
 ====== Инструмент Jenkins ====== ====== Инструмент Jenkins ======
  
-  * [[https://hevodata.com/learn/gitlab-webhook-jenkins-integration/​|GitLab Webhook Jenkins Integration:​ Automating Jobs Simplified 101]] +  * [[https://www.jenkins.io/doc/book/system-administration/​admin-password-reset-instructions/|Reset the administrator password]]
-  * [[https://​gcube.wiki.gcube-system.org/gcube/​Gitea/​Jenkins:​_Setting_up_Webhooks|Gitea/​Jenkins:​ Setting up Webhooks]]+
  
  
 ===== Установка ===== ===== Установка =====
  
-  * [[Сервис 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/​]]   * [[https://​pkg.jenkins.io/​debian-stable/​]]
  
-==== !!! Обратитесь к преподавателю !!! ==== +  * [[https://​stackoverflow.com/​questions/​63635421/​install-suggested-plugins-for-jenkins|Install suggested plugins for jenkins]] 
-  * В текущей версии ​устанавливается ​так:+ 
 +  * Версия может уже ​измениться!!!
 <​code>​ <​code>​
-wget -O /usr/share/​keyrings/​jenkins-keyring.asc https://​pkg.jenkins.io/​debian-stable/​jenkins.io-2023.key +sudo wget -O /etc/apt/​keyrings/​jenkins-keyring.asc ​
- +  ​https://​pkg.jenkins.io/​debian-stable/​jenkins.io-2026.key 
-echo deb [signed-by=/​usr/share/​keyrings/​jenkins-keyring.asc] \ +echo "deb [signed-by=/​etc/apt/​keyrings/​jenkins-keyring.asc]" ​
-    https://​pkg.jenkins.io/​debian-stable binary/ | sudo tee \ +  https://​pkg.jenkins.io/​debian-stable binary/ | sudo tee \ 
-    /​etc/​apt/​sources.list.d/​jenkins.list > /dev/null +  /​etc/​apt/​sources.list.d/​jenkins.list > /dev/null 
-     +sudo apt update 
-apt-get update +sudo apt install jenkins
- +
-apt-get install fontconfig openjdk-17-jre +
- +
-# apt-get ​install jenkins+
 </​code>​ </​code>​
 ==== Смена порта ==== ==== Смена порта ====
Line 52: Line 49:
  
   * [[https://​medium.com/​@med446/​setting-up-a-jenkins-slave-a7000358c557|Setting up a Jenkins Agent]]   * [[https://​medium.com/​@med446/​setting-up-a-jenkins-slave-a7000358c557|Setting up a Jenkins Agent]]
-  * [[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 61: Line 56:
 </​code>​ </​code>​
   * [[Пакет sudo]]   * [[Пакет sudo]]
 +==== Агент подключается к контроллеру ====
 +
 +  * !!! В текущей версии нужно: Dashboard -> Manage Jenkins -> Security -> TCP port for inbound agents: Random
 +  * Требуется [[https://​plugins.jenkins.io/​instance-identity/​|Instance Identity]] plugin
 +
 +
 <​code>​ <​code>​
 Dashboard->​Set up an agent->​Create a new node  Dashboard->​Set up an agent->​Create a new node 
Line 67: Line 68:
   ...   ...
   Remote root directory: /​home/​jenkins/​   Remote root directory: /​home/​jenkins/​
-  ... 
-  Use WebSocket: yes   !!! В текущей версии нет 
   ...   ...
   Способ запуска   Способ запуска
Line 81: Line 80:
  
 jenkins@gate:​~$ java -jar agent.jar -jnlpUrl http://​server.corpX.un:​8081/​computer/​gate/​jenkins-agent.jnlp -secret NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN -workDir "/​home/​jenkins/"​ jenkins@gate:​~$ java -jar agent.jar -jnlpUrl http://​server.corpX.un:​8081/​computer/​gate/​jenkins-agent.jnlp -secret NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN -workDir "/​home/​jenkins/"​
 +...
 +INFO: Connected
 +</​code>​
 +
 +  * [[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]]
 +  * [[Управление сервисами в Linux#​Система загрузки Systemd]]
 +
 +==== Запуск агента через SSH ====
 +
 +  * Требуется [[https://​plugins.jenkins.io/​ssh-slaves/​|SSH Build Agents]] plugin
 +
 +<​code>​
 +gate# passwd jenkins
 +</​code>​
 +<​code>​
 +Dashboard->​Set up an agent->​Create a new node 
 +  Node name: gate
 +  Type: Permanent Agent
 +  ...
 +  Remote root directory: /​home/​jenkins/​
 +  ...
 +  Способ запуска
 +    Launch Agent via SSH
 +  ...
 +  Host: gate
 +  Credentials ...
 +  Host Key Verification Strategy: Non ...
 +  ...
 </​code>​ </​code>​
  
Line 96: Line 123:
   Git:   Git:
     Repository URL: http://​server.corpX.un:​3000/​student/​dhcp.git     Repository URL: http://​server.corpX.un:​3000/​student/​dhcp.git
-...    +... 
 +  Branch Specifier: */* 
 +...
 Build Steps Build Steps
   Execute shell:   Execute shell:
Line 119: Line 148:
   Pipeline script from SCM   Pipeline script from SCM
     Repository URL: http://​server.corpX.un:​3000/​student/​dhcp.git     Repository URL: http://​server.corpX.un:​3000/​student/​dhcp.git
 +    ​
 +  Branches to build: */*
 </​code>​ </​code>​
  
Line 151: Line 182:
 ==== Webhooks ==== ==== Webhooks ====
  
 +  * [[https://​hevodata.com/​learn/​gitlab-webhook-jenkins-integration/​|GitLab Webhook Jenkins Integration:​ Automating Jobs Simplified 101]]
   * [[https://​gcube.wiki.gcube-system.org/​gcube/​Gitea/​Jenkins:​_Setting_up_Webhooks|Gitea/​Jenkins:​ Setting up Webhooks]]   * [[https://​gcube.wiki.gcube-system.org/​gcube/​Gitea/​Jenkins:​_Setting_up_Webhooks|Gitea/​Jenkins:​ Setting up Webhooks]]
 +
  
 <​code>​ <​code>​
инструмент_jenkins.1725711936.txt.gz · Last modified: 2024/09/07 15:25 by val