Git Plugin の導入に躓いた
Jenkins で SCM(?) からソースをチェックアウトして、ビルドして、テストする。
これを Git から行おうと思い、プラグイン管理から Git Plugin を入れて、ジョブの設定で対象の Repository を設定したのに、実行したら一瞬で失敗。ガーーン( TωT)
コンソールにはこんなエラーが出てうまくいかない。
ERROR: Workspace has a .git repository, but it appears to be corrupt. hudson.plugins.git.GitException: Error performing command: rev-parse --verify HEAD at hudson.plugins.git.GitAPI.launchCommandIn(GitAPI.java:892) at hudson.plugins.git.GitAPI.launchCommand(GitAPI.java:846) at hudson.plugins.git.GitAPI.launchCommand(GitAPI.java:856) at hudson.plugins.git.GitAPI.validateRevision(GitAPI.java:324) at hudson.plugins.git.GitAPI.hasGitRepo(GitAPI.java:123) at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:997) at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:978) at hudson.FilePath.act(FilePath.java:842) at hudson.FilePath.act(FilePath.java:824) at hudson.plugins.git.GitSCM.determineRevisionToBuild(GitSCM.java:978) at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1134) at hudson.model.AbstractProject.checkout(AbstractProject.java:1256) at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:589) at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:88) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:494) at hudson.model.Run.execute(Run.java:1502) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:236) Caused by: java.lang.NullPointerException at hudson.Launcher.printCommandLine(Launcher.java:592) at hudson.Launcher.maskedPrintCommandLine(Launcher.java:614) at hudson.Launcher$LocalLauncher.launch(Launcher.java:700) at hudson.Launcher$ProcStarter.start(Launcher.java:338) at hudson.Launcher$ProcStarter.join(Launcher.java:345) at hudson.plugins.git.GitAPI.launchCommandIn(GitAPI.java:873) ... 18 more
調べてみると、インストールしたGit を Jenkins に設定して(教えて)あげないといけないとな。そりゃそーだ。
とゆーことで、以下の通り設定して、
再度実行...これまた一瞬で失敗した( TωT)ガーーーン。
でコンソールを見てみるとこんなエラーが。
FATAL: Could not apply tag jenkins-test-project-17 hudson.plugins.git.GitException: Could not apply tag jenkins-test-project-17 at hudson.plugins.git.GitAPI.tag(GitAPI.java:817) at hudson.plugins.git.GitSCM$4.invoke(GitSCM.java:1258) at hudson.plugins.git.GitSCM$4.invoke(GitSCM.java:1223) at hudson.FilePath.act(FilePath.java:842) at hudson.FilePath.act(FilePath.java:824) at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1223) at hudson.model.AbstractProject.checkout(AbstractProject.java:1256) at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:589) at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:88) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:494) at hudson.model.Run.execute(Run.java:1502) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:236) Caused by: hudson.plugins.git.GitException: Command "XXXXXXXXX\bin\git.exe tag -a -f -m Jenkins Build #17 jenkins-test-project-17" returned status code 128: stdout: stderr: *** Please tell me who you are. Run git config --global user.email "you@example.com" git config --global user.name "Your Name" to set your account's default identity. Omit --global to set the identity only in this repository. fatal: unable to auto-detect email address (got 'XXXXXX@xxxxxxxxxx.(none)') at hudson.plugins.git.GitAPI.launchCommandIn(GitAPI.java:885) at hudson.plugins.git.GitAPI.launchCommand(GitAPI.java:846) at hudson.plugins.git.GitAPI.launchCommand(GitAPI.java:856) at hudson.plugins.git.GitAPI.tag(GitAPI.java:815) ... 13 more
更に調べてみると、Jenkins に Git のユーザとメールアドレスを教えてあげなきゃと。
確かに Git でソースをチェックアウト(clone) してくるときに、接続するユーザ情報を何も設定してなかったな。こりゃ失礼。
とゆーこで、更に以下の通り設定して...無事成功( TωT)!!
たかがビルドしてテスト通すのに躓きまくり。
まぁ次からはこんな事がないようにしたいよね。
その為のエントリだから!