Saya tidak dapat mengkonfigurasi url repositori git dengan cara, yang dapat diakses oleh Jenkins.
di bawah "Project> Configure> Source Code Management" Saya mengatur URL Repositori ke "git @ store: repositories / testproject.git"
Saya mendapatkan kesalahan ini:
Failed to connect to repository : Command "/usr/bin/git -c core.askpass=true ls-remote -h git@store:repositories/testproject.git HEAD" returned status code 128:
stdout:
stderr: Permission denied, please try again.
Permission denied, please try again.
Permission denied (publickey,password).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
akses dengan URL itu berfungsi pada shell:
jenkins@dilbert:~$ /usr/bin/git -c core.askpass=true ls-remote -h git@store:repositories/testproject.git
git@store's password:
4fd35a4f528e2f2921a52cfd03918b7cbde3d253 refs/heads/master
Saya dimintai kata sandi dan berhasil.
Saya mengaitkan kata sandi yang sama dengan kredensial di Jenkins ke "git /" dan saya juga mencoba "git @ store /". Tidak ada yang berhasil.
Mohon dicatat, bahwa ini bukan tentang github, tetapi tentang repositori git lokal.
memperbarui:
menambahkan kunci pub dari master jenkins ke slave build, membantu agar konfigurasi berfungsi:
ssh-copy-id jenkins@dilbert
sekarang build gagal:
> /usr/bin/git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
> /usr/bin/git config remote.origin.url git@store:repositories/testproject.git # timeout=10
Fetching upstream changes from git@store:repositories/testproject.git
> /usr/bin/git --version # timeout=10
> /usr/bin/git -c core.askpass=true fetch --tags --progress git@store:repositories/testproject.git +refs/heads/*:refs/remotes/origin/*
ERROR: Error fetching remote repo 'origin'
hudson.plugins.git.GitException: Failed to fetch from git@store:repositories/testproject.git
at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:735)
at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:983)
at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1016)
at hudson.scm.SCM.checkout(SCM.java:484)
at hudson.model.AbstractProject.checkout(AbstractProject.java:1270)
at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:609)
at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:531)
at hudson.model.Run.execute(Run.java:1751)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:89)
at hudson.model.Executor.run(Executor.java:240)
Caused by: hudson.plugins.git.GitException: Command "/usr/bin/git -c core.askpass=true fetch --tags --progress git@store:repositories/testproject.git +refs/heads/*:refs/remotes/origin/*" returned status code 128:
stdout:
stderr: Permission denied, please try again.
Permission denied, please try again.
Permission denied (publickey,password).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
toko adalah master jenkins, dilbert adalah budak yang membangun. ssh dari master ke slave bekerja.
jenkins@store:~$ ssh dilbert uptime
16:06:21 up 3 days, 18:53, 13 users, load average: 0,31, 0,38, 0,50
ada ide bagaimana men-debug ini?