Article directory
Purpose: Add linux nodes on Jenkins
1. Create a new node
Click on the directory in turn: Home – "System Management – "Node Management – "-" New Node: Enter the node name and choose to create a fixed node or copy an existing node
1.1 Node configuration – working directory
1.2 Node Configuration – Start Mode
Linux node startup method: configure the credentials, the purpose is to connect and operate the linux node system through the credentials
Click on the startup method – "Credentials -" [Add] button to select – "[Jenkins] to enter the interface for adding credentials
After adding the certificate of the linux node, select the certificate, as shown in the figure below, the note can make it easier for us to find the certificate
1.3 Node Configuration – Node Property Settings
Node attributes Here we need to add which ones, the following is the addition of git
1.4 Start the node
1.4.1 Java installation and configuration
参考:https://blog.csdn.net/jc_hook/article/details/127683082
1.4.2 git installation configuration
参考:https://blog.csdn.net/jc_hook/article/details/127683082
1.4.3 maven installation configuration
参考:https://blog.csdn.net/jc_hook/article/details/127683082
1.4.4 Start the node
Home page - "System Management - "Node Management - "Node List - "Select the node we just added and click [Start Agent], the startup is successful as follows:
Two, install the plug-in
Jenkins plug-in installation: Home – “System Management –” Plug-in Management – “Optional Plug-ins: Search and Install
2.1 Install the git plugin
2.2 Install SSH
3. Create a project
Home – "You can choose [New View]
Home – “Select View –” New Task
Enter the view name and select the type of automation task to be created according to the requirements
Set the build content as shown in the figure:
3.1 Node settings
Home – "View – "Tasks – "Settings – "General – "Limit Project Run Node: Select the node we added
3.2 git settings
Home – "View – "Tasks – "Settings – "General – "Source Code Management – "Select git: Enter the git information in the figure
Add git credentials
Select git credentials:
3.3 shell script
In linux, we can use shell scripts to execute commands of linux node machines.
First, we need: #!/bin/bash
Other commands are exactly the same as linux