报错内容
Failed to connect to repository : Command "git ls-remote -h -- /home/{$username}/CICD/javaDemo/simple-java-maven-app HEAD" returned status code 128:
stdout:
stderr: fatal: '/home/{$username}/CICD/javaDemo/simple-java-maven-app' does not appear to be a git repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
问题排查:
1. 检查jenkins容器是否有SSH Key
1) /home/.ssh是否有id_rsa、id_rsa.pub文件
2)GitHub账户是否有SSH Key
2) 检查Repository URL是否正确
Repository URL:填写的是jenkins容器内的仓库路径(前提:在运行容器时,主机上的用户账户home目录映射到Jenkins容器的 /home
目录,代码也是存放在/home下的)