Configure Clouds
Remote FS root: /home/ec2-user
Remote user: ec2-user
Labels: OnDemand
Test connection: Success.
EC2 plugin can successfully provision an EC2 instance and start the Jenkins slave if the Jenkins' project does not use git. If I use git, I got,
Error:
java.io.IOException: Cannot run program "git" (in directory "/home/ec2-user/workspace/demo1"): error=2, No such file or directory
Project Configuration
Restrict where this project can be run
Label Expression: OnDemand
Source Code Management
Git
Repositories Repository URL: Some URL
Credentials: Some Credentials
git init /home/ec2-user/workspace/demo1 # timeout=10 ERROR: Error cloning remote repo 'origin' java.io.IOException: Cannot run program "git" (in directory "/home/ec2-user/workspace/demo1"): error=2, No such file or directory
CodePudding user response:
Use jGit (Jenkins git client plugin). It solves the problem.