Resource put not working
alvaritez opened this issue · 7 comments
I'm trying to use the resource to update the PR status, but I'm getting this error:
cat: can't open '/tmp/build/put/project/.git/pr': No such file or directory
This is my configuration:
- put: source-code-pr
params:
action: change-build-status
state: INPROGRESS
name: "pr-build"
Any clue on what I'm doing wrong?
I've tried several versions of the resource with same (or similar) results.
Resource works perfect for getting new PRs so I'd like to use to update them as well
The repo directory /tmp/build/put/project
was produced by that resource?
To be honest, I don't know who produced that directory...
I'm using this resource get the code from git when a new PR is created, and I wanted to use it as well to update the build status in BitBucket. I followed the example but got that error. I'm using another resource in the meantime
Could you post your pipeline here?
You probably need to add repository
to your out params. It should have the same name as the git-bitbucket-pr
resource.
So something like this for the example pipeline:
resources:
- name: my-repo-with-pull-requests
type: git-bitbucket-pr
source:
base_url: http://bitbucket.local
username: some-username
password: some-password
project: zarplata
repository: concourse-git-bitbucket-pr-resource
git:
uri: https://github.com/zarplata/concourse-git-bitbucket-pr-resource
private_key: {{git-repo-key}}
jobs:
- name: my build
plan:
- get: my-repo-with-pull-requests
trigger: true
version: every
- task: unit test
...
inputs:
- name: my-repo-with-pull-requests
run:
...
on_failure:
put: my-repo-with-pull-requests
params:
state: FAILED
name: "unit test"
url: "http://acme.com/teams/$BUILD_TEAM_NAME/pipelines/$BUILD_PIPELINE_NAME/jobs/$BUILD_JOB_NAME/builds/$BUILD_NAME"
repository: my-repo-with-pull-requests
on_success:
put: my-repo-with-pull-requests
params:
state: SUCCESSFUL
name: "unit test"
url: "http://acme.com/teams/$BUILD_TEAM_NAME/pipelines/$BUILD_PIPELINE_NAME/jobs/$BUILD_JOB_NAME/builds/$BUILD_NAME"
repository: my-repo-with-pull-requests
Thanks for your answers!
Unfortunately, we're using a different resource now, but I'll check this again if we ever consider using this one again
I can confirm that the git-bitbucket-pr
resource name must exactly match the resource.source.repository value to avoid this error. It would be a nice add to allow these to be different, but at the very least this should be added to the readme/documentation, since it's not apparent. Thanks @stijndehaes for the answer!