I try to use Bitbucket's pipeline feature for a LaTeX git repository. I just want to build my .tex file and store the .pdf artifact to the repository download folder. I found some helpful guides here and a similar answer at SO.
This is my pipeline.yml
options:
  docker: true
image: kaspersoerensen/latex-docker
pipelines:
  default:
    - step:
        script:
          - pdflatex --shell-escape TEST.tex # Build once
          #- bibtex TEST # Build bibtex
          - pdflatex -shell-escape TEST.tex # Build again
          - pdflatex -shell-escape TEST.tex # And last time
          - curl -X POST --user "${BB_AUTH_STRING}" "https://api.bitbucket.org/2.0/repositories/${BITBUCKET_REPO_OWNER}/${BITBUCKET_REPO_SLUG}/downloads" --form files=@"TEST.pdf"
To setup curl I used this official guideline from Atlassian.
Everything seems to be okay and the build is successful without any errors.
Problem: My repository download folder does not contain any artifacts.
EDIT
Build output:
Build setup
4s
pdflatex --shell-escape TEST.tex
1s
pdflatex -shell-escape TEST.tex
1s
pdflatex -shell-escape TEST.tex
1s
curl -X POST --user "${BB_AUTH_STRING}" "https://api.bitbucket.org/2.0/repositories/${BITBUCKET_REPO_OWNER}/${BITBUCKET_REPO_SLUG}/downloads" --form files=@"TEST.pdf"
<1s
Build teardown
Docker output:
time="2019-12-20T14:56:23.511294820Z" level=warning msg="could not change group /var/run/docker.sock to docker: group docker not found"
time="2019-12-20T14:56:23.511451739Z" level=warning msg="[!] DON'T BIND ON ANY IP ADDRESS WITHOUT setting --tlsverify IF YOU DON'T KNOW WHAT YOU'RE DOING [!]"
time="2019-12-20T14:56:23.544238141Z" level=warning msg="failed to load plugin io.containerd.snapshotter.v1.btrfs" error="path /var/lib/docker/165536.165536/containerd/daemon/io.containerd.snapshotter.v1.btrfs must be a btrfs filesystem to be used with the btrfs snapshotter" 
time="2019-12-20T14:56:23.562813661Z" level=warning msg="failed to load plugin io.containerd.snapshotter.v1.aufs" error="modprobe aufs failed: "ip: can't find device 'aufs'\nmodprobe: can't change directory to '/lib/modules': No such file or directory\n": exit status 1" 
time="2019-12-20T14:56:23.563473734Z" level=warning msg="failed to load plugin io.containerd.snapshotter.v1.zfs" error="path /var/lib/docker/165536.165536/containerd/daemon/io.containerd.snapshotter.v1.zfs must be a zfs filesystem to be used with the zfs snapshotter" 
time="2019-12-20T14:56:23.563610398Z" level=warning msg="could not use snapshotter btrfs in metadata plugin" error="path /var/lib/docker/165536.165536/containerd/daemon/io.containerd.snapshotter.v1.btrfs must be a btrfs filesystem to be used with the btrfs snapshotter" 
time="2019-12-20T14:56:23.563626718Z" level=warning msg="could not use snapshotter aufs in metadata plugin" error="modprobe aufs failed: "ip: can't find device 'aufs'\nmodprobe: can't change directory to '/lib/modules': No such file or directory\n": exit status 1" 
time="2019-12-20T14:56:23.563636848Z" level=warning msg="could not use snapshotter zfs in metadata plugin" error="path /var/lib/docker/165536.165536/containerd/daemon/io.containerd.snapshotter.v1.zfs must be a zfs filesystem to be used with the zfs snapshotter" 
time="2019-12-20T14:56:23.695604523Z" level=warning msg="Running modprobe bridge br_netfilter failed with message: ip: can't find device 'bridge'\nbridge                167936  1 br_netfilter\nstp                    16384  1 bridge\nllc                    16384  2 bridge,stp\nip: can't find device 'br_netfilter'\nbr_netfilter           24576  0 \nbridge                167936  1 br_netfilter\nmodprobe: can't change directory to '/lib/modules': No such file or directory\n, error: exit status 1"
time="2019-12-20T14:56:23.706219675Z" level=warning msg="Running modprobe nf_nat failed with message: `ip: can't find device 'nf_nat'\nnf_nat_ipv6            16384  1 ip6table_nat\nnf_nat_ipv4            16384  2 ipt_MASQUERADE,iptable_nat\nnf_nat                 32768  3 nf_nat_ipv6,xt_nat,nf_nat_ipv4\nnf_conntrack          139264  8 nf_nat_ipv6,nf_conntrack_netlink,xt_nat,xt_conntrack,ip_vs,ipt_MASQUERADE,nf_nat_ipv4,nf_nat\nlibcrc32c              16384  3 ip_vs,nf_nat,nf_conntrack\nmodprobe: can't change directory to '/lib/modules': No such file or directory`, error: exit status 1"
time="2019-12-20T14:56:23.716309547Z" level=warning msg="Running modprobe xt_conntrack failed with message: `ip: can't find device 'xt_conntrack'\nxt_conntrack           16384 42 \nnf_conntrack          139264  8 nf_nat_ipv6,nf_conntrack_netlink,xt_nat,xt_conntrack,ip_vs,ipt_MASQUERADE,nf_nat_ipv4,nf_nat\nmodprobe: can't change directory to '/lib/modules': No such file or directory`, error: exit status 1"