This is an old revision of the document!
server# cat /etc/default/jenkins
... #HTTP_PORT=8080 HTTP_PORT=8081 ...
gate# useradd -m -s /bin/bash jenkins
Create a new node ... Remote root directory: /home/jenkins/ ... Use WebSocket: yes ...
gate# su - jenkins
Копируем команды, указанные на странице нового агента: jenkins@gate:~$ curl -sO http://server.corpX.un:8081/jnlpJars/agent.jar jenkins@gate:~$ java -jar agent.jar -jnlpUrl http://server.corpX.un:8081/computer/gate/jenkins-agent.jnlp -secret NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN -workDir "/home/jenkins/"
Enter an item name: dhcp freestyle project ... Restrict where this project can be run: gate ... Source Code Management: Git: Repository URL: http://server.corpX.un:3000/student/dhcp.git ... Build Steps Execute shell: make test Execute shell: sudo make install ...
Enter an item name: dhcp pipeline ... Pipeline Pipeline script from SCM Repository URL: http://server.corp13.un:3000/student/dhcp.git
В SCM GitLab/GitHub/Gitea: New File: Jenkinsfile
pipeline { agent { node { label 'gate' } } stages { stage('Test') { steps { sh 'make test' } } stage('Deploy') { steps { sh 'sudo make install' } } } }