I believe the translation of the question is something like:
The Jenkins-2.319.1 version is installed in the win7 system, and Jenkins is started by starting the war package in java. After the pipeline plugin is successfully installed, it restarts and creates a new pipline task. The script is written as follows:
pipeline{
agent any
stages{
stage (‘overall functional test’){
steps{
echo “aaaa”
bat ‘’’
echo “11222”
‘’’
}
}
}
As a result, Jenkins has been executed at bat during construction, without stopping or reporting any errors, until the manual is invalid, as shown in the figure:
Please what is the reason for this and how to solve it
I think you’re asking why does Jenkins cancel execution of a Pipeline job when the controller is running on Windows 7. As far as I know, none of the Jenkins developers test with Windows 7. Windows 7 has been unsupported by Microsoft for over two years.
I am surprised that the job would be cancelled without action from the user, but I’m not aware of anyone willing to investigate a failure on Windows 7.
Some of the things you might check:
Confirm that you’re running a recent version of Java (preferably 11.0.14 or 8u322). If you’re running a version newer than 11.0.14 (like Java 15, 16, or 17), switch back to Java 11
Confirm that there is enough memory and disc space on the computer to run Jenkins
Confirm that the Jenkins version you’re running is a recent release (2.319.3 or 2.334)
Confirm that the operating system has whatever patches are available for it (I don’t know if patches are available any longer for Windows 7)
I may not express my problem clearly and the job will not be cancelled if the user does not take action.The problem I want to express is: IN Jenkins’ pipeline script, I set the command to execute the BAT batch processing script. After setting the command, the pipeline task was always in execution during the construction task, no error would be reported, and the execution would not be completed. Therefore, I manually cancelled the execution of this task.
Regarding your questions and suggestions:
Jenkins deployed to Windows 7 because our program had to run on Windows.
I have also tried to deploy and execute in Win10. This problem also exists in BAT batch script commands in Win10, but powershell commands do not have this problem.
3, Make sure you are using Java 11, Jenkins-2.319.3, the computer has enough memory and disk space, this problem still exists;
I don’t know if the sample you pasted was incorrectly copied or if you are actually using those alternate quote forms (“smart quotes, etc.”) in the Pipeline script. They won’t work. You need to use ASCII single quote and double quote when defining strings in the Pipeline domain specific language.
I created the following working Pipeline script from yours, but using ASCII characters instead of the alternate forms:
The only difference between the two is that bat and powshell commands are the same, so I think it’s still about bat, and I don’t know what this problem is.
You may want to check if the problem can be duplicated on other Windows computers in your environment. There may be something configured on that specific Windows 7 computer that causes the odd behavior.