|
@@ -2,6 +2,8 @@
|
|
# adapts to drone, use git username / token as parameter
|
|
# adapts to drone, use git username / token as parameter
|
|
|
|
|
|
puts "=================== starting Android Lint Entropy Reducer ===================="
|
|
puts "=================== starting Android Lint Entropy Reducer ===================="
|
|
|
|
+
|
|
|
|
+# get args
|
|
git_user, git_token, git_branch = ARGV
|
|
git_user, git_token, git_branch = ARGV
|
|
|
|
|
|
# ======================== SETUP ============================
|
|
# ======================== SETUP ============================
|
|
@@ -148,9 +150,6 @@ end
|
|
# write new results to file (will overwrite existing, or create new)
|
|
# write new results to file (will overwrite existing, or create new)
|
|
File.write(previous_lint_report, "DO NOT TOUCH; GENERATED BY TRAVIS\n" + error_warning_string)
|
|
File.write(previous_lint_report, "DO NOT TOUCH; GENERATED BY TRAVIS\n" + error_warning_string)
|
|
|
|
|
|
-# get user, token from arguments
|
|
|
|
-git_user, git_token = ARGV
|
|
|
|
-
|
|
|
|
# push changes to github (if this script is run locally, we don't want to overwrite git username and email, so save temporarily)
|
|
# push changes to github (if this script is run locally, we don't want to overwrite git username and email, so save temporarily)
|
|
previous_git_username, st = Open3.capture2('git config user.name')
|
|
previous_git_username, st = Open3.capture2('git config user.name')
|
|
previous_git_username = previous_git_username.strip
|
|
previous_git_username = previous_git_username.strip
|
|
@@ -170,11 +169,11 @@ system ('git add ' + PREVIOUS_LINT_RESULTS_FILE)
|
|
# Travis has git in a detached head here. Let's get on the right branch.
|
|
# Travis has git in a detached head here. Let's get on the right branch.
|
|
travis_branch_name = ENV['TRAVIS_BRANCH']
|
|
travis_branch_name = ENV['TRAVIS_BRANCH']
|
|
if travis_branch_name != nil
|
|
if travis_branch_name != nil
|
|
- system ('git checkout ' + travis_branch_name)
|
|
|
|
|
|
+ system ('git checkout ' + git_branch)
|
|
end
|
|
end
|
|
|
|
|
|
# commit changes; Add "skip ci" so that we don't accidentally trigger another Travis build
|
|
# commit changes; Add "skip ci" so that we don't accidentally trigger another Travis build
|
|
-system ('git commit -m "Travis: update Lint results to reflect reduced error/warning count [skip ci]" ')
|
|
|
|
|
|
+system ('git commit -m "Drone: update Lint results to reflect reduced error/warning count [skip ci]" ')
|
|
|
|
|
|
# push to origin
|
|
# push to origin
|
|
system("git config push.default simple")
|
|
system("git config push.default simple")
|