Commit 840fee00b7684f5cf3373790c0fb1cc819b68a65
1 parent
d9cc7a19
Exists in
master
and in
67 other branches
add pdfupload task to upload the PDF to the git repository
Showing
1 changed file
with
13 additions
and
0 deletions
Show diff stats
tasks/doc.rake
| @@ -13,6 +13,19 @@ task :viewpdf => :pdf do | @@ -13,6 +13,19 @@ task :viewpdf => :pdf do | ||
| 13 | sh 'xdg-open', 'docs/_build/latex/softwarepublico.pdf' | 13 | sh 'xdg-open', 'docs/_build/latex/softwarepublico.pdf' |
| 14 | end | 14 | end |
| 15 | 15 | ||
| 16 | +desc 'Publishes PDF' | ||
| 17 | +task :pdfupload => :pdf do | ||
| 18 | + require 'date' | ||
| 19 | + | ||
| 20 | + tag = Date.today.strftime('doc-%Y-%m-%d') | ||
| 21 | + blob = `git hash-object -w docs/_build/latex/softwarepublico.pdf`.strip | ||
| 22 | + tree = `printf '100644 blob #{blob}\tsoftwarepublico.pdf\n' | git mktree`.strip | ||
| 23 | + commit = `git commit-tree -m #{tag} #{tree}`.strip | ||
| 24 | + | ||
| 25 | + sh 'git', 'tag', tag, commit | ||
| 26 | + sh 'git', 'push' | ||
| 27 | +end | ||
| 28 | + | ||
| 16 | desc 'Removes generated files' | 29 | desc 'Removes generated files' |
| 17 | task :clean do | 30 | task :clean do |
| 18 | sh 'make -C docs/ clean' | 31 | sh 'make -C docs/ clean' |