Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How can pipeline overwrite POSTed artefact each time?

andb0t
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 9, 2019

I was following the example in https://confluence.atlassian.com/bitbucket/deploy-build-artifacts-to-bitbucket-downloads-872124574.html .

The curl code in the pipeline only works the first time, after that it provides an error, which is hard to google. I assume it is related to the fact that the file "CV_publications.pdff" already exists in `.../downloads`. This is my pipeline:

 

```

image: aergus/latex

pipelines:
default:
- step:
script:
- echo "Generating all CVs!"
- make
- echo "Done!"
- apt-get install -y curl
- curl -X POST "https://${BB_AUTH_STRING}@api.bitbucket.org/2.0/repositories/${BITBUCKET_REPO_OWNER}/${BITBUCKET_REPO_SLUG}/downloads" --form files=@"CV_publications.pdf"

```

 

and this is the pipeline error message:

 

```

curl
 -X POST 
"https://${BB_AUTH_STRING}@api.bitbucket.org/2.0/repositories/${BITBUCKET_REPO_OWNER}/${BITBUCKET_REPO_SLUG}/downloads"
 --form files=@"CV_publications.pdf"<1s
+ curl -X POST "https://${BB_AUTH_STRING}@api.bitbucket.org/2.0/repositories/${BITBUCKET_REPO_OWNER}/${BITBUCKET_REPO_SLUG}/downloads" --form files=@"CV_publications.pdf"
Warning: setting file CV_publications.pdf failed!
% Total % Received % Xferd Average Speed Time Time Time Current

Dload Upload Total Spent Left Speed

0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 155 0 0 0 155 0 7380 --:--:-- --:--:-- --:--:-- 7380
curl: (26) read function returned funny value

```

 

What's happening here?

Thanks!

1 answer

0 votes
Steven Vaccarella
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 16, 2019

Hi Andreas,

Have you tried adding "-v" to the curl command to get more information about the error?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Upcoming Bitbucket Events