Selaa lähdekoodia

Attempt to automate deployment of site documentation using Travis CI.

Yao Wei Tjong 姚伟忠 12 vuotta sitten
vanhempi
sitoutus
bd39347e3a
2 muutettua tiedostoa jossa 22 lisäystä ja 0 poistoa
  1. 4 0
      .travis.yml
  2. 18 0
      Rakefile

+ 4 - 0
.travis.yml

@@ -2,3 +2,7 @@ language: cpp
 compiler: gcc
 before_install: sudo apt-get install -qq libx11-dev libxrandr-dev libasound2-dev libgl1-mesa-dev doxygen graphviz
 script: ./cmake_gcc.sh -DENABLE_64BIT=1 -DENABLE_LUAJIT=1 -DENABLE_LUAJIT_AMALG=1 -DENABLE_SAMPLES=1 -DENABLE_TOOLS=1 -DENABLE_EXTRAS=1 -DENABLE_DOCS_QUIET=1 && cd Build && make
+after_success: rake travis
+env:
+  global:
+    secure: KKjUAdDcV97ux54FYwZB+/dlR2WLIbWNCHFHIszxTf8HT8owyFQeRs1xPnBk3WNBaX4siisaTBRPLoSsYVmYn1UZeURMDTy8TjpTFqTJltJQ3recWcptdBSRg8ED6OtlahiGdSp6MIEWjP0tzUTiPy1pBG0khfwV5KIZzAd11vE=

+ 18 - 0
Rakefile

@@ -0,0 +1,18 @@
+require "rubygems"
+
+# Usage: NOT to be used manually
+desc 'Publish site from Travis CI to GitHub Pages'
+task :travis do
+  system "git config user.name '#{ENV['GIT_NAME']}'"
+  system "git config user.email '#{ENV['GIT_EMAIL']}'"
+  system 'git config credential.helper "store --file=.git/credentials"'
+  File.open('.git/credentials', 'w') do |f|
+    f.write("https://#{ENV['GH_TOKEN']}:@github.com")
+  end
+  system "git clone https://github.com/urho3d/urho3d.github.io.git doc-Build"
+  system "ruby -lne 'BEGIN { credits = false }; puts $_ if credits; credits = true if /bugfixes by:/; credits = false if /^$/' Readme.txt |ruby -i -le 'BEGIN { credits = STDIN.read }; puts ARGF.read.gsub(/(?<=bugfixes by\n).*?(?=##)/m, credits)' doc-Build/about.md"
+  system "rm -rf doc-Build/documentation"
+  system "cp -r Docs/html doc-Build/documentation"
+  system "cd doc-Build && git add -A && git commit -q -a -m 'Travis CI automated site deploy at #{Time.now.utc}.' && git push -q"
+  File.delete '.git/credentials'
+end