I am trying to setup Travis CI to build a latex report. When building the latex report some steps have to be repeated and so the first time they are called there is a non-zero return code.
My travis.yml so far is
language: R
before_install:
- tlmgr install index
script:
- latex report
- bibtex report
- latex report
- latex report
- dvipdf report.dvi report.pdf
However in Travis Docs it states
If script returns a non-zero exit code, the build is failed, but continues to run before being marked as failed.
So if my first latex report
command has a non zero return code it will fail the build.
I would only like the build to fail if the last latex report
or dvipdf report
failed.
Does anyone have any idea or help?
Thanks in advance.
There are three types of commands: Non-API Commands, General API Commands and Repository Commands. All commands take the form of travis COMMAND [ARGUMENTS] [OPTIONS] .
The first job is to build the image and the second job is going to be to run the NPM test target.
travis. yml is a configuration file, which provides instructions to the testing and building software on how to run tests and build any files required by the project. This file is part of the repository's git repository.
Just append || true
to your command.
(complex) Example:
- (docker run --rm -v $(pwd)/example:/workdir stocker-alert || true) 2>&1 | tee >(cat) | grep 'Price change within 1 day'
2>&1
- stderr is forwarded to stdin (to be picked up by grep
later)tee
- the output is printed (for debugging) and forwarded to grepgrep
asserts if the output contains a required string. If not, grep
returns > 0 failing the build.grep
s result we would need another ||true
after grep.Taken from schnatterer/stock-alert.
Not directly related with your original question but I had quite the same problem.
I found a solution using latexmk. This runs latex and bibtex as many times as needed.
If you look at my Travis configuration file :
https://github.com/73VW/TechnicalReport/blob/master/.travis.yml
You will see that you simply have to add it in apt dependencies.
Then you can run it like this: latexmk -pdf -xelatex [Your_latex_file]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With