Continuous integration Bitbucket管道:pdfLaTeX之后的Store.pdf工件
我尝试将Bitbucket的管道功能用于LaTeX git存储库。我只想构建我的.tex文件并将.pdf工件存储到存储库下载文件夹中。我在网站上找到了一些有用的指南和类似的答案 这是我的管道。ymlContinuous integration Bitbucket管道:pdfLaTeX之后的Store.pdf工件,continuous-integration,bitbucket,bitbucket-pipelines,Continuous Integration,Bitbucket,Bitbucket Pipelines,我尝试将Bitbucket的管道功能用于LaTeX git存储库。我只想构建我的.tex文件并将.pdf工件存储到存储库下载文件夹中。我在网站上找到了一些有用的指南和类似的答案 这是我的管道。yml options: docker: true image: kaspersoerensen/latex-docker pipelines: default: - step: script: - pdflatex --shell-escape TE
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"
为了设置卷曲,我使用了来自Atlassian的这位官员
一切似乎都正常,构建成功,没有任何错误
问题:我的存储库下载文件夹不包含任何工件。
编辑
生成输出:
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
我建议使用管道而不是使用curl发送API请求来上传Bitbucket中的文件。如果出现问题,管道将提供更好的反馈。下面是一个示例,说明如何做到这一点:
options:
docker: true
image: kaspersoerensen/latex-docker
pipelines:
default:
- step:
name: Build the pdf
script:
- pdflatex --shell-escape TEST.tex
artifacts:
- TEST.pdf
- step:
name: Upload
script:
- pipe: atlassian/bitbucket-upload-file:0.1.2
variables:
BITBUCKET_USERNAME: $BITBUCKET_USERNAME
BITBUCKET_APP_PASSWORD: $BITBUCKET_APP_PASSWORD
FILENAME: 'TEST.pdf'
请注意,我正在使用将构建和上载的步骤分开,这被认为是构建管道的好方法。感谢所有花时间回答我问题的人 现在我找到了这样一个可行的解决方案:
BB\u AUTH\u STRING
必须是您的\u用户名:您的\u应用程序\u密码(不要使用应用程序密码标签!这是我的错) options:
docker: true
image: kaspersoerensen/latex-docker
pipelines:
default:
- step:
name: Build the pdf
script:
- pdflatex --shell-escape TEST.tex
artifacts:
- TEST.pdf
- step:
name: Upload
script:
- pipe: atlassian/bitbucket-upload-file:0.1.2
variables:
BITBUCKET_USERNAME: $BITBUCKET_USERNAME
BITBUCKET_APP_PASSWORD: $BITBUCKET_APP_PASSWORD
FILENAME: 'TEST.pdf'
image: dme26/latex-builder:latest
pipelines:
default:
- step:
script:
- pdflatex TEST.tex; pdflatex TEST.tex
- ls
- curl -X POST "https://${BB_AUTH_STRING}@api.bitbucket.org/2.0/repositories/${BITBUCKET_REPO_OWNER}/${BITBUCKET_REPO_SLUG}/downloads" --form files=@"TEST.pdf"