This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
инструмент_jenkins [2024/09/07 16:32] val [Pipeline] |
инструмент_jenkins [2024/11/14 12:47] (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]] | ||
| ==== !!! Обратитесь к преподавателю !!! ==== | ==== !!! Обратитесь к преподавателю !!! ==== | ||
| Line 22: | Line 24: | ||
| # apt-get update | # apt-get update | ||
| - | # apt-get install fontconfig openjdk-17-jre | + | # apt-get install fontconfig default-jre-headless |
| # apt-get install jenkins | # apt-get install jenkins | ||
| Line 52: | Line 54: | ||
| * [[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 61: | ||
| </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 73: | ||
| ... | ... | ||
| Remote root directory: /home/jenkins/ | Remote root directory: /home/jenkins/ | ||
| - | ... | ||
| - | Use WebSocket: yes !!! В текущей версии нет | ||
| ... | ... | ||
| Способ запуска | Способ запуска | ||
| Line 85: | Line 89: | ||
| </code> | </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]] | * [[Управление сервисами в 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> | ||
| + | |||
| ===== Примеры проектов/заданий ===== | ===== Примеры проектов/заданий ===== | ||
| Line 100: | Line 129: | ||
| Repository URL: http://server.corpX.un:3000/student/dhcp.git | Repository URL: http://server.corpX.un:3000/student/dhcp.git | ||
| ... | ... | ||
| - | Branch Specifier: сделать пустым | + | Branch Specifier: */* |
| ... | ... | ||
| Build Steps | Build Steps | ||
| Line 125: | Line 154: | ||
| Repository URL: http://server.corpX.un:3000/student/dhcp.git | Repository URL: http://server.corpX.un:3000/student/dhcp.git | ||
| | | ||
| - | Branches to build: сделать пустым | + | Branches to build: */* |
| </code> | </code> | ||
| Line 158: | Line 187: | ||
| ==== 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> | ||