iuf / rulebook

IUF Rulebook
10 stars 15 forks source link

Using travis as build tool? #139

Closed gossi closed 7 years ago

gossi commented 9 years ago

At the moment, felix little script runs on the IUF server to build the rulebook-pdf on-the-fly. I did a little reasearch, it should be possible to use travis-ci.org as build tool for latex. I just want to throw it in, as an alternative (search for 'travis latex' on google, gives some results). With #138 and multi-lingual versions, this might be worth looking into as it wouldn't anybody to change the build-script on the server... it can stay with the repo.

scotthue commented 9 years ago

A quick google of travis latex did not provide any straight-forward answers.

fdietze commented 9 years ago

Travis will work very well in our case. I know how to set it up and can give advice.

scotthue commented 9 years ago

I have started setting up travis. Currently it only uses one branch (2015_prelim) and only releases one file (iuf-rulebook.pdf) made from make. Next step is make diff and include that file in the release too. Also, I disabled the gitinfo package to get it to work. Baby steps. Here is the compiled file: https://github.com/iuf/rulebook/releases/tag/build-2015.09.07-00.23

gossi commented 9 years ago

:+1:

gossi commented 9 years ago

Instead of creating a release every time this built is run. It can be "uploaded" to the iuf's github website. The pdfs would then be available at iuf.github.io/<whatever-filename-you-choose-here>.pdf so could be sth like latest.pdf, diff2013-2015.pdf, version-2013.pdf, version-2015.pdf, ... well you get the idea. We can even create a rewrite rule on the iuf-server so https://unicycling.org/publications/iuf-rulebook-latest.pdf links to the github page's pdf.

I have a deploy script ready that I use here: https://github.com/gossi/php-code-generator can just be copied and modified for usage here.

What you think?

scotthue commented 9 years ago

That sounds good to me.

scotthue commented 9 years ago

How can we set this up exactly? (Skype me if you want.)

gossi commented 9 years ago

I used this tutorial here: http://www.steveklabnik.com/automatically_update_github_pages_with_travis_example/

fdietze commented 9 years ago

Do you have time to skype tomorrow at 13:30 CET? On Sep 7, 2015 5:50 PM, "Thomas Gossmann" notifications@github.com wrote:

I used this tutorial here: http://www.steveklabnik.com/automatically_update_github_pages_with_travis_example/

— Reply to this email directly or view it on GitHub https://github.com/iuf/rulebook/issues/139#issuecomment-138328628.

scotthue commented 9 years ago

Potentially. My class officially goes until 2:30 but we're often done early. I won't know until around 13:00 though most likely.

On Mon, Sep 7, 2015 at 18:56 Felix Dietze notifications@github.com wrote:

Do you have time to skype tomorrow at 13:30 CET? On Sep 7, 2015 5:50 PM, "Thomas Gossmann" notifications@github.com wrote:

I used this tutorial here:

http://www.steveklabnik.com/automatically_update_github_pages_with_travis_example/

— Reply to this email directly or view it on GitHub https://github.com/iuf/rulebook/issues/139#issuecomment-138328628.

— Reply to this email directly or view it on GitHub https://github.com/iuf/rulebook/issues/139#issuecomment-138340242.

scotthue commented 9 years ago

I will be available today. On Tue, Sep 8, 2015 at 08:14 Scott Wilton scott.o.wilton@gmail.com wrote:

Potentially. My class officially goes until 2:30 but we're often done early. I won't know until around 13:00 though most likely.

On Mon, Sep 7, 2015 at 18:56 Felix Dietze notifications@github.com wrote:

Do you have time to skype tomorrow at 13:30 CET? On Sep 7, 2015 5:50 PM, "Thomas Gossmann" notifications@github.com wrote:

I used this tutorial here:

http://www.steveklabnik.com/automatically_update_github_pages_with_travis_example/

— Reply to this email directly or view it on GitHub https://github.com/iuf/rulebook/issues/139#issuecomment-138328628.

— Reply to this email directly or view it on GitHub https://github.com/iuf/rulebook/issues/139#issuecomment-138340242.

scotthue commented 9 years ago

Status update:

I have rebased the travis branch with all of the commits we currently have. It is now only one commit. I force pushed that commit to github so pull again before continuing work.

I have reset the 2015_prelim branch to remove all of the travis work. I forced push that. Pull again if you need to change the actual rulebook at all.

Travis still creates the weird first page. It's likely the result of the gitinfo2 package but I haven't tested that theory.

Travis can now successfully install latexdiff and rcs-latexdiff. It then successfully make the rulebook and upload it.

It is now getting stuck on make diff. The problem is that travis is only checking out one branch of the git repo but latexdiff needs the other branches in order to run. @gossi and I attempted to pull in the other remote branches, but this does not seem successful. I have yet to find a solution to this. I am stopping for tonight.

gossi commented 9 years ago

after watching the .travis.yml again, we really should create a scripts folder and move the appropriate parts into their own scripts (install, run, after_success), because these commands look messy and unreadable in yml format.

gossi commented 9 years ago

Update:

The parts are now moved into their own script in scripts/ folder. Checking out the required branches for diff works. The $PATH needs to stay in .travis.yml because scripts run in their own encapsulated environment.

Problem now: The Makefile has too much variables... no really too much. That prohibits to find the correct target after the diff task is ran.

From travis:

make ./out/iuf-rulebook-diff-2013-travis.pdf
make[1]: Entering directory `/home/travis/build/iuf/rulebook'
make[1]: *** No rule to make target `out/iuf-rulebook-diff-2013-travis.pdf'.  Stop.
make[1]: Leaving directory `/home/travis/build/iuf/rulebook'
make: *** [diff] Error 2

@fdietze: Need help!

fdietze commented 8 years ago

In theory it's working now, but the generated diff does not compile. log: https://s3.amazonaws.com/archive.travis-ci.org/jobs/98687375/log.txt generated diff-tex: https://unicycling.org/files/temp/upload/iuf-rulebook-travis-diff-2013.tex

The diff build ends with:

[...]
Missing character: There is no I in font nullfont!
./src/iuf-rulebook-travis-diff-2013.tex:3406: Dimension too large.
\UL@on ...hr@@ \dimen@ \advance \dimen@ -\ULdepth 
                                                  \setbox \UL@box \hbox {{#1...
l.3406 }
        \end{judging_items} &
(That makes 100 errors; please try again.) 
Here is how much of TeX's memory you used:
 9838 strings out of 495061
 144024 string characters out of 1182620
 425197 words of memory out of 3000000
 12349 multiletter control sequences out of 15000+50000
 61033 words of font info for 43 fonts, out of 3000000 for 9000
 28 hyphenation exceptions out of 8191
 45i,11n,43p,847b,722s stack positions out of 5000i,500n,10000p,200000b,50000s

./src/iuf-rulebook-travis-diff-2013.tex:3406:  ==> Fatal error occurred, no out
put PDF file produced!

My guess is that the latex code has some unclosed blocks, which somehow works in the normal build, but breaks the diff. @scotthue @gossi, please take a closer look at the tex code and build logs in the branches travis/2013 and the generated diff to identify and fix the issues.

scotthue commented 8 years ago

I tried to look at the log briefly this evening and didn't get anywhere. The length of the log file makes it very difficult to find the problems. Way too many latex warnings and stuff. Maybe we can run things in a more "quiet" mode?

scotthue commented 8 years ago

I'm confused. In the install.sh script it looks like we are installing latexdiff and not rcs-latexdiff. However, the diff file that @fdietze links to above is generated by rcs-latexdiff to the best I can tell. It's hard to figure out why the diff doesn't compile if I don't know which diff package we're using. Help?

fdietze commented 8 years ago

By now, latexdiff can do everything we needed rcs-latexdiff for.

scotthue commented 8 years ago

Fine, but why does rcs-latexdiff show up in the log then?

On Mon, Jan 18, 2016 at 7:11 PM Felix Dietze notifications@github.com wrote:

By now, latexdiff can do everything we needed rcs-latexdiff for.

— Reply to this email directly or view it on GitHub https://github.com/iuf/rulebook/issues/139#issuecomment-172610039.

fdietze commented 8 years ago

Make is printing its contents. There is a commented line which contains rcs-latexdiff.

fdietze commented 8 years ago

I put 6503abd (commit before gossis prelim commit) into diff-branches. Locally this produces a diff for me. But on travis it doesn't: https://unicycling.org/files/temp/upload/iuf-rulebook-travis-diff-6503abd.log

fdietze commented 8 years ago

It's a problem with gitinfo:

! LaTeX Error: File `gitinfo.sty' not found.
scotthue commented 7 years ago

We are using travis now.