2016-05-06 6 views
1

私はbitbucketプライベートリポジトリのruby on ruby​​コードを持っています。 Bitbucketリポジトリをjenkinsに追加するには?

Kind: username and password 
と私はそれにビットバケットのユーザー名とパスワードを与えている:

資格情報が続く
https://bitbucket.org/myuser_name/demo_app 

:そして、次のように私はジェンキンスさんへのリモート私のリポジトリを追加しました。

私はプロジェクト設定を保存する前に、Repository URLの下でエラーは発生しませんでした。だから、私はsource code managementが正しいと思った。しかし、私はこのエラーが発生しているプロジェクトを構築しています。

Building in workspace /var/lib/jenkins/workspace/demo_app 
> git rev-parse --is-inside-work-tree # timeout=10 
Fetching changes from the remote Git repository 
> git config remote.origin.url https://bitbucket.org/myuser_name/demo_app # timeout=10 
Fetching upstream changes from https://bitbucket.org/myuser_name/demo_app 
> git --version # timeout=10 
using .gitcredentials to set credentials 
> git config --local credential.username myuser_name # timeout=10 
> git config --local credential.helper store --file=/tmp/git1159546302445779982.credentials # timeout=10 
> git -c core.askpass=true fetch --tags --progress https://bitbucket.org/myuser_name/demo_app +refs/heads/*:refs/remotes/origin/* 
> git config --local --remove-section credential # timeout=10 
ERROR: Error fetching remote repo 'origin' 
hudson.plugins.git.GitException: Failed to fetch from https://bitbucket.org/myuser_name/demo_app 
    at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:810) 
    at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1066) 
    at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1097) 
    at hudson.scm.SCM.checkout(SCM.java:485) 
    at hudson.model.AbstractProject.checkout(AbstractProject.java:1269) 
    at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:607) 
    at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86) 
    at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:529) 
    at hudson.model.Run.execute(Run.java:1738) 
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) 
    at hudson.model.ResourceController.execute(ResourceController.java:98) 
    at hudson.model.Executor.run(Executor.java:410) 
Caused by: hudson.plugins.git.GitException: Command "git -c core.askpass=true fetch --tags --progress https://bitbucket.org/myuser_name/demo_app +refs/heads/*:refs/remotes/origin/*" returned status code 128: 
stdout: 
stderr: error: cannot fork() for git credential-store --file=/tmp/git1159545779982.credentials get: Cannot allocate memory 
error: cannot fork() for /bin/echo: Cannot allocate memory 
fatal: could not read Password for 'https://[email protected]': No such device or address 

    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1719) 
    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1463) 
    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$300(CliGitAPIImpl.java:63) 
    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:314) 
    at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:808) 
    ... 11 more 
ERROR: null 
Finished: FAILURE 

どこが間違っていますか?

+1

あなたはリポジトリの正しいURLを持っているかどうかわかりません...通常は '.git'で終わります。 'https:// potame @ bitbucket.org/project/repo.git'にあります。 – potame

答えて

3

あなたを含める方が良いでしょうユーザ名/パスワードの代わりに配備キーを使用してプロジェクトを作成します。

bitbucketプロジェクトに配置キーを追加するには、https://bitbucket.org/myuser_name/demo_app/admin/deploy-keys/にアクセスしてください。

キーをJenkinsに追加します。プロジェクト設定ページの「ソースコード管理」 - >「認証情報」 - >「追加」をクリックします。 [SSH Username and privat key]を選択します。ユーザ名 'git'とあなたのprivat鍵を追加してください。

0

私は今日はこれを行う方法を変更しましたが、いくつかの時間前、私はこのタスクを実行するためのBitbucketにフックをしなければならなかったかどうかを知りません:

more info

関連する問題