Started by user admin Running as SYSTEM Building in workspace /root/.jenkins/workspace/test-freestyle-job using credential 490bf1fb-1a57-4c22-872f-8eed4adafce0 > /usr/local/git/bin/git rev-parse --is-inside-work-tree # timeout=10 Fetching changes from the remote Git repository > /usr/local/git/bin/git config remote.origin.url https://gitlab.example.com/root/nice-bbs.git # timeout=10 Fetching upstream changes from https://gitlab.example.com/root/nice-bbs.git > /usr/local/git/bin/git --version # timeout=10 using GIT_ASKPASS to set credentials > /usr/local/git/bin/git fetch --tags --progress https://gitlab.example.com/root/nice-bbs.git +refs/heads/*:refs/remotes/origin/* # timeout=10 ERROR: Error fetching remote repo 'origin' hudson.plugins.git.GitException: Failed to fetch from https://gitlab.example.com/root/nice-bbs.git at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:908) at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1123) at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1159) at hudson.scm.SCM.checkout(SCM.java:505) at hudson.model.AbstractProject.checkout(AbstractProject.java:1205) at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:574) at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:499) at hudson.model.Run.execute(Run.java:1853) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:97) at hudson.model.Executor.run(Executor.java:427) Caused by: hudson.plugins.git.GitException: Command "/usr/local/git/bin/git fetch --tags --progress https://gitlab.example.com/root/nice-bbs.git +refs/heads/*:refs/remotes/origin/*" returned status code 128: stdout: stderr: fatal: unable to access 'https://gitlab.example.com/root/nice-bbs.git/': Peer's certificate issuer has been marked as not trusted by the user. at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2429) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:2043) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$500(CliGitAPIImpl.java:80) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:568) at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:906) ... 11 more ERROR: Error fetching remote repo 'origin' Finished: FAILURE
Started by user admin Running as SYSTEM Building in workspace /root/.jenkins/workspace/test-freestyle-job using credential 490bf1fb-1a57-4c22-872f-8eed4adafce0 > /usr/local/git/bin/git rev-parse --is-inside-work-tree # timeout=10 Fetching changes from the remote Git repository > /usr/local/git/bin/git config remote.origin.url https://gitlab.example.com/root/nice-bbs.git # timeout=10 Fetching upstream changes from https://gitlab.example.com/root/nice-bbs.git > /usr/local/git/bin/git --version # timeout=10 using GIT_ASKPASS to set credentials > /usr/local/git/bin/git fetch --tags --progress https://gitlab.example.com/root/nice-bbs.git +refs/heads/*:refs/remotes/origin/* # timeout=10 ERROR: Error fetching remote repo 'origin' hudson.plugins.git.GitException: Failed to fetch from https://gitlab.example.com/root/nice-bbs.git at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:908) at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1123) at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1159) at hudson.scm.SCM.checkout(SCM.java:505) at hudson.model.AbstractProject.checkout(AbstractProject.java:1205) at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:574) at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:499) at hudson.model.Run.execute(Run.java:1853) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:97) at hudson.model.Executor.run(Executor.java:427) Caused by: hudson.plugins.git.GitException: Command "/usr/local/git/bin/git fetch --tags --progress https://gitlab.example.com/root/nice-bbs.git +refs/heads/*:refs/remotes/origin/*" returned status code 128: stdout: stderr: fatal: unable to access 'https://gitlab.example.com/root/nice-bbs.git/': Peer's certificate issuer has been marked as not trusted by the user. at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2429) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:2043) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$500(CliGitAPIImpl.java:80) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:568) at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:906) ... 11 more ERROR: Error fetching remote repo 'origin' Finished: FAILURE
需要升级git版本,还有shell的if前后都需要空格
本文记录了在使用Jenkins过程中遇到的一个错误,即需要升级Git到最新版本,并且强调了在Shell脚本中if条件语句前后必须添加空格,这是避免语法错误的关键。
6371

被折叠的 条评论
为什么被折叠?



