-
-
Save huwan/171ace215b09e9e63b55d0c838b36cbc to your computer and use it in GitHub Desktop.
Bitbucket pipeline file for latex document (including bibtex and upload to dropbox)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# SETTING UP : | |
# Generate an application token for your dropbox account and set it as environment variable named "DROPBOX_TOKEN" | |
# - https://blogs.dropbox.com/developers/2014/05/generate-an-access-token-for-your-own-account/ | |
# - https://confluence.atlassian.com/bitbucket/environment-variables-794502608.html | |
# Set environment variable TEX_FILE according to the main tex file name | |
image: wanhu/texlive-basic:latest | |
pipelines: | |
default: | |
- step: | |
script: | |
- curl "https://raw.githubusercontent.com/andreafabrizi/Dropbox-Uploader/master/dropbox_uploader.sh" -o dropbox_uploader.sh | |
- chmod +x dropbox_uploader.sh ; echo "OAUTH_ACCESS_TOKEN=$DROPBOX_TOKEN" > .dropbox_uploader | |
- DATE=$(date +%Y%m%d) | |
- ID=$(git rev-parse --short HEAD) | |
- pdflatex "$TEX_FILE.tex" && bibtex "$TEX_FILE" && pdflatex "$TEX_FILE.tex" && pdflatex "$TEX_FILE.tex" | |
- mv "$TEX_FILE.pdf" "$TEX_FILE-$DATE-$ID.pdf" | |
- ./dropbox_uploader.sh -f .dropbox_uploader upload "$TEX_FILE-$DATE-$ID.pdf" . |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks @adujardin!
Some minor changes (for self use):