1. Login Jekins
Prerequisite: Jekins has been deployed and can log in
Version: Jenkins2.60.2
Http://IP: Port/jenkins/view/all/newjob
2. Create a new Build task
Select the type of project, select "Build a multi-configuration item" and enter the custom project name, click OK
Code Management Choose Git (need to click Add to add a viable account password)
Note: If you do not involve code operations, such as only shell script execution, you can skip this step
Choose a Build cycle (choose manual build here)
Select "Execute shell script on remote host using SSH" in the build task
Select a site that has been created and enter the shell script that needs to be executed
Once the save is in effect, click "Build Now" to start building. You can see the history of the build below and click inside to see the details.
If you need a shell script that is remote to another environment, you need to install the plugin SSH plugin first:
Jenkins-> plug-in management, install, search ssh Plugin
After installing the reboot you can see that one more option "Execute shell script on remote host using SSH"
Add an SSH remote site
jenkins-> System Management, System configuration->ssh remote hosts
Enter IP, port information, select the user (provided the SSH user has been added)
The save takes effect.
Build projects automatically using Jekins (Gitlab+java Maven)