Hi, I'm using bitbucket.org with a pipeline that is to create a tar like so;
- cd base && tar -cvf /tarball.tar *.conf
- cd overrides && tar -rvf /tarball.tar *.conf
The tar is created in two stages one from a base directory and then the tar is appended two with files to override data from the base. The next step in the pipeline is to gzip the tar file;
- gzip -v /tarball.tar
This leaves me with /tarball.tar.gz - which is all fine. This is then POST'd to the api to add it to the repo as a download;
- curl -v -S -L -X POST --user "${BB_AUTH_STRING}" "https://api.bitbucket.org/2.0/repositories/${BITBUCKET_REPO_OWNER}/${BITBUCKET_REPO_SLUG}/downloads" -F files=@/tarball.tar.gz
I then get a file in the downloads area call tarball.tar.gz - all looks fine, however on downloading the file it is no longer a gzip'd file - it has become a non-gzip'd tar again.
$ file ~/Downloads/tarball.tar.gz
/home/my-user/Downloads/tarball.tar.gz: POSIX tar archive (GNU)
Why would this be happening? Is there any way to stop this or is this expected behaviour?
TIA.
Hello @BR,
Looks like this is not related to Pipelines: uploading a file to Downloads in web UI leads to the same issue, i.e. uploaded and downloaded binaries differ.
Thanks for reporting about this problem! Do you mind filing a bug into our public issue tracker? This way you'll be notified as soon as we fix it.
Cheers,
Daniil
Someone is looking into this bug - some interesting things to note however... you don't get the same results via the API;
$ curl -o download.tar.gz -s --user user:pass -L https://api.bitbucket.org/2.0/repositories/$USER/$REPO/downloads/tarball.tar.gz
$ file download.tar.gz
download.tar.gz: gzip compressed data, last modified: Tue Dec 3 21:37:30 2019, from Unix
Where as from the Web UI you get the following;
$ file ./Downloads/tarball.tar.gz
./Downloads/tarball.tar.gz: POSIX tar archive (GNU)
So API calls are a workaround right now.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.