Przeglądaj źródła

For Travis CI - Replace GH_TOKEN as it was exposed in the build log.

Due to git push failure from detached HEAD, the error log in Travis CI build contains GH_TOKEN for worker account. A new GH_TOKEN is now generated.
Enhance the script so that it does not spit out any output or error when pushing. The script still can rely on command exit status, however.
Yao Wei Tjong 姚伟忠 12 lat temu
rodzic
commit
662fe84d3c
2 zmienionych plików z 4 dodań i 4 usunięć
  1. 1 1
      .travis.yml
  2. 3 3
      Rakefile

+ 1 - 1
.travis.yml

@@ -11,7 +11,7 @@ script: ./cmake_gcc.sh -DURHO3D_LIB_TYPE=$TEST_LIB_TYPE -DENABLE_64BIT=1 -DENABL
 after_success: rake travis
 env:
   global:
-    secure: ST80PPq8cTIZ5WRgX4BJ7gKhHonNge9GdYH0PuTvCZot13Rk+oNkbzkkCT/KuQHmyUU65gE2HCyMYYqNDNyxy0Upi8jMUjgXdy7SN5zORVhyc/Ymfd6rt3sgVOT6YYlbegI3sFLVdaH4jdyyMqPQHW72StZ25NUQi0p682FAGD0=
+    secure: DE9IUM+pIV757GU0ccfDJhA752442pKu3DyBthrzHW9+GbsqbfuJOx045CYNN5vOWutFPC0A51B9WxhLNpXXqD3mfU8MhP1gkF7SskrHvcAPrCyfdqZf1Q8XDP5phm2KbHhhwxQMYmmicd6yj8DPNy2wRoSgPSDp/ZUDk51XZDU=
   matrix:
     - TEST_LIB_TYPE=STATIC
     - TEST_LIB_TYPE=SHARED

+ 3 - 3
Rakefile

@@ -17,7 +17,7 @@ task :travis do
   # Generate and sync doxygen pages
   system 'cd Build && make doc >/dev/null 2>&1 && rsync -a --delete ../Docs/html/ ../doc-Build/documentation' or abort 'Failed to generate/rsync doxygen pages'
   # Supply GIT credentials and push site documentation to urho3d/urho3d.github.io.git
-  system "msg=`git log --format=%B -n 1 $TRAVIS_COMMIT`; export msg && cd doc-Build && git config user.name '#{ENV['GIT_NAME']}' && git config user.email '#{ENV['GIT_EMAIL']}' && git remote set-url --push origin https://#{ENV['GH_TOKEN']}@github.com/urho3d/urho3d.github.io.git && git add -A . && git commit -q -m \"Travis CI: site documentation update at #{Time.now.utc}.\n\nCommit: https://github.com/urho3d/Urho3D/commit/$TRAVIS_COMMIT\n\nMessage: $msg\" && git push -q" or abort 'Failed or nothing to push'
-  # Supply GIT credentials and push API documentation to urho3d/Urho3D.git (the push may not be successful if detached HEAD is not a fast forward of remote master)
-  system "git config user.name '#{ENV['GIT_NAME']}' && git config user.email '#{ENV['GIT_EMAIL']}' && git remote set-url --push origin https://#{ENV['GH_TOKEN']}@github.com/urho3d/Urho3D.git && git add Docs/*API* && git commit -q -m 'Travis CI: API documentation update at #{Time.now.utc}.\n[ci skip]' && git push origin HEAD:master -q"
+  system "msg=`git log --format=%B -n 1 $TRAVIS_COMMIT`; export msg && cd doc-Build && git config user.name '#{ENV['GIT_NAME']}' && git config user.email '#{ENV['GIT_EMAIL']}' && git remote set-url --push origin https://#{ENV['GH_TOKEN']}@github.com/urho3d/urho3d.github.io.git && git add -A . && git commit -q -m \"Travis CI: site documentation update at #{Time.now.utc}.\n\nCommit: https://github.com/urho3d/Urho3D/commit/$TRAVIS_COMMIT\n\nMessage: $msg\" && git push -q >/dev/null 2>&1" or abort 'Failed or nothing to push'
+  # Supply GIT credentials and push API documentation to urho3d/Urho3D.git
+  system "git config user.name '#{ENV['GIT_NAME']}' && git config user.email '#{ENV['GIT_EMAIL']}' && git remote set-url --push origin https://#{ENV['GH_TOKEN']}@github.com/urho3d/Urho3D.git && git pull && git add Docs/*API* && git commit -q -m 'Travis CI: API documentation update at #{Time.now.utc}.\n[ci skip]' && git push origin HEAD:master -q >/dev/null 2>&1"
 end