Skip to content

Commit

Permalink
Fix CI commits to build results
Browse files Browse the repository at this point in the history
  • Loading branch information
nealkruis committed Jun 20, 2018
1 parent 593256e commit faf1067
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 18 deletions.
6 changes: 4 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ env:
global:
- RT_URL=github.com/bigladder/kiva-test-results.git
- RT_DIR=build/test/results
- secure: "m6BS+3JWbJHJOXPGmF3hS4vng7kEUErkjcHDeIgbctMEZvHFbctniWJJ70V1rM6bLalA2PLCBNygWbXHuBIaFcHto06QcmR4q7EHcTJHpN5nYJqce5yI8UPAaPqC3tScVfrJoDdoqQitfq60iYr2gDdHlviOiNw1GOZeR5z+gINNtFq91qcsB5rQoEUPOTM7fJZ59WvrjZAkwcls0lI3yCg750Ep7GFiILhkiqBBiGLMxLtyJaNNgch2RIyZayZS+f2VGsF8UcFY7aQpYgKyJ0CfqwLPN4aL9q7wZ99wT0QvqRe+a9l/rTOg1h3pEb4f5+63etZNZkaqBB+aZY9gGVRhLlc99FMAYD0oNg6TGCSx5RnV1k3PkC6dvuXkLOJKTTgnXOkmCUHuyhgNZgTYasNZXhij9Bso8CBRKkEQe9afvRuM6+FymkZIKsJ2YjN6C7Cf5HRjPkOYOkhYxecIo7lzn6dInhata7FsnfQfFz+GPVN9/3k0mrhWu3kUKIncyrnttYIzxEOpiE5PUFdkOt1fQ1sAvAKFMCa6v/go0jt2LuJplA1nwFBX+WjbcXnq7wKqE9bPbeB/hwwMrrGJr8YmDnykdiLZOZa05h583f6NRdzJhBDEfL8Gd4f+dc22sib8kEPBm4eKMBdFWCmyUondl6ZgVH1GYIhRa7mpzZE="
- secure: "RXKpYImpxy3XKaRH/NbHcYKynSPKiPZt6Yyb++YHZXYEyyy95mMMBi4WFxaKp9BR0JRiUE573y8ZaTS1D3u1C3GRSr6oAIsY576Z5XIEhHHZMyAXAivsqt1HG5HLLVgdcgAEWKsTYWjMMT7Hw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kQOenXui98dsnNixFX2x2aLlPKY/ctL9XX6f3GBJt/JHDtgsTksPqfNV2WiMOVoz7ya9F3hD0kQGKSmjKalkHCZ87lLxxSxmx4WyO+azMRKueJc8UnTi2NtQCGRGOUqBOHrhpMtUUuiNbRejvWuv2FPA="
- secure: "CYPZZkDZftNiYSathjGcwnUGQcgF7xYHWTrkp17BdtncwufjXcoNTYlG5tjLt2FHWjZe8YPemTDqFb6MSfKBHh16JGdocaxsaUvv1HkLYmSpg/aYi8Jor71PQHYedjUEkLRFfmPSvolMT/czoB9IhRfO14udbYqQO+jcg/P3iITfWEnihU98wgHEg6XGNrXOT5LMJn8cQBOFbvBCQQhK0S8eMs2d5LEaS/HpmsLld1hFA3RyO+3Gp4oXVeaMCwD86Mp3coomDpTneSk/RlPNsIPaz37NUXCN29Atq2XIT1Oi4Etmp/f0TizDGdOMRJDsvV3VftRCCUf+zuAL9TUUjdGxtYZWwZf/I4mDUCYidP8mV+MRUAuGKUdJSv9l1P0FUIWEcr/vxIKSxbNdsApzQOTj3OcL1UAflV/czfnIL4YOvPizvxPk7zIR9hV89JLr1+9gD4nWrbrk29mnJk6a2Ke/NSO2Ju3XnCLohyVMFk8EDL8x1kAnT8axSVy0RD4zs8aPbwejSBrUnbxaEoArEO2RGsqk1uoz/PmC9PR8UuJ7a+DgomY4YQOjASdAVysABBVOMJmZrPvMb4zQ1qmGcztvoPG0xXdMMyWeVFqqxom3YzOixjOXfymlBy6ab1oZMV9gK6wZdARBNusP1wZ1KWekbBx7jkVlTYBictMqHAI="
matrix:
Expand All @@ -32,7 +32,9 @@ before_install:
gem install git;
fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
rvm use 2.3;
brew install gcc;
rvm use 2.0;
elif [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
sudo apt-get -y -qq update;
sudo apt-get -y install cmake;
Expand Down Expand Up @@ -62,11 +64,11 @@ script:
bash <(curl -s https://codecov.io/bash) -X gcov -cF unit;
else
ctest --output-on-failure
ruby ../scripts/log-results.rb;
fi
after_success:
- if [[ "$COVERAGE" == false ]]; then
ruby ../scripts/log-results.rb;
cpack -B "$TRAVIS_BUILD_DIR";
cd "$TRAVIS_BUILD_DIR";
fi
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![Documentation Status](https://readthedocs.org/projects/kiva/badge/?version=latest)](http://kiva.readthedocs.org/en/latest/?badge=latest)
[![Build Status](https://travis-ci.org/bigladder/kiva.svg?branch=develop)](https://travis-ci.org/bigladder/kiva)
[![Build Status](https://ci.appveyor.com/api/projects/status/pv2c4no2mv4uds26/branch/develop?svg=true)](https://ci.appveyor.com/project/nealkruis/kiva/branch/develop) [![codecov](https://codecov.io/gh/bigladder/kiva/branch/develop/graph/badge.svg)](https://codecov.io/gh/bigladder/kiva)
[![Build Status](https://ci.appveyor.com/api/projects/status/pv2c4no2mv4uds26/branch/develop?svg=true)](https://ci.appveyor.com/project/bigladder/kiva/branch/develop) [![codecov](https://codecov.io/gh/bigladder/kiva/branch/develop/graph/badge.svg)](https://codecov.io/gh/bigladder/kiva)

Kiva
====
Expand Down
3 changes: 1 addition & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ init:
- cmd: ctest --version
- ps: iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))

skip_branch_with_pr: true
clone_depth: 100

cache:
Expand All @@ -17,7 +16,7 @@ environment:
RT_URL: github.com/bigladder/kiva-test-results.git
RT_DIR: build/test/results
PATOKEN:
secure: 7a7QLpEXUNLRIivs7Ty9ni5bjIJsrC1rKFNf64DTaZsyT9NT5MVSUwhyHmAd5X11
secure: 2yWRGGytWw4GjxqH57yssvmTRY6yUxZkJ+ld3BEtQXceyGrwbaNh44G/CnNMFfcR
RUBY_VERSION: "200"

matrix:
Expand Down
6 changes: 4 additions & 2 deletions scripts/clone-and-mimic.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
TEST_DIR = File.expand_path(ENV['RT_DIR'], CI_PATH)
# regression testing repository URL
# PATOKEN = personal access token
RT_URL = "https://#{ENV['PATOKEN']}@#{ENV['RT_URL']}"
RT_URL = "https://#{ENV['RT_URL']}"
RT_DIR = File.expand_path(ENV['RT_DIR'], CI_PATH)
ARCH = File.read(File.expand_path('build/arch.txt',CI_PATH))

Expand All @@ -34,7 +34,9 @@ def main(ci_path, rt_url, rt_dir, arch, test_dir)
puts("Setting Git username and email")
g_rt.config('user.name', "CI: #{arch}")
g_rt.config('user.email', "ci@ci.org")
`cd #{g_rt.dir} && git config --global credential.helper store`
puts("Changing directory to mimic source: #{g_rt.dir}")
`cd "#{g_rt.dir}"` # && git config --global credential.helper store`
#File.write("#{ENV['HOME']}/.git-credentials", "https://$($env:PATOKEN):x-oauth-basic@github.com\n", mode: 'wb')
puts("Git username and email set")
puts("Attempting to mimic source")
mimic_source(g_rt, the_branch, the_ci_sha)
Expand Down
14 changes: 7 additions & 7 deletions scripts/lib.rb
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,11 @@ def run_case(in_root, out_root, arch, a, c)
end

# robust pull/push
def robust_push_pull(g, branch, the_commit, the_tag)
def robust_push_pull(g, branch, the_commit, the_tag, rt_url)
puts("Starting robust_pull_push!")
begin
puts("Attempting to pull")
g.pull('origin', branch) if g.is_remote_branch?(branch)
g.pull(rt_url, branch) if g.is_remote_branch?(branch)
puts("Pull attempt succeeded")
rescue => e
puts("Trying to fix suspected auto-merge conflict")
Expand Down Expand Up @@ -163,7 +163,7 @@ def robust_push_pull(g, branch, the_commit, the_tag)
end
puts("Pushing to origin!")
begin
g.push('origin', branch, {:tags=>true})
g.push(rt_url, "HEAD:#{branch}", {:tags=>true})
rescue => e
# Possible that we have an error related to remote tagging
# Let's check if the word "tag" is in the error message
Expand All @@ -174,8 +174,8 @@ def robust_push_pull(g, branch, the_commit, the_tag)
puts("apparently, tag already exists on remote!")
puts("attempt a retag next...")
puts("-------")
retag(g.dir, the_tag)
g.push('origin', branch, {:tags=>true})
retag(g.dir, the_tag, rt_url)
g.push(rt_url, "HEAD:#{branch}", {:tags=>true})
else
# We don't know what happened. Report error and bail.
puts("Don't know how to handle this error... exiting...")
Expand All @@ -186,10 +186,10 @@ def robust_push_pull(g, branch, the_commit, the_tag)
puts("Done robust_pull_push!")
end

def retag(git_dir, tag_name)
def retag(git_dir, tag_name, rt_url)
puts("Tag, #{tag_name}, exists")
# delete tag on remote
`cd #{git_dir} && git push --quiet origin :refs/tags/#{tag_name}`
`cd #{git_dir} && git push --quiet "#{rt_url}" :refs/tags/#{tag_name}`
# force annotate the tag again
`cd #{git_dir} && git tag -fa #{tag_name} -m "Add source sha"`
end
8 changes: 4 additions & 4 deletions scripts/log-results.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
TEST_DIR = File.expand_path(ENV['RT_DIR'], CI_PATH)
# regression testing repository URL
# PATOKEN = personal access token
RT_URL = "https://#{ENV['PATOKEN']}@#{ENV['RT_URL']}"
RT_URL = "https://#{ENV['PATOKEN']}:x-oauth-basic@#{ENV['RT_URL']}"
RT_DIR = File.expand_path(ENV['RT_DIR'], CI_PATH)
ARCH = File.read(File.expand_path('build/arch.txt',CI_PATH))

############################################################
def main(ci_path, rt_url, rt_dir, arch, test_dir)
def main(ci_path, rt_dir, arch, test_dir, rt_url)
puts("Starting main")
puts("Opening git on CI_PATH")
g_ci = Git.open(ci_path)
Expand Down Expand Up @@ -62,15 +62,15 @@ def main(ci_path, rt_url, rt_dir, arch, test_dir)
end
puts("Tag added")
puts("Attempting to push/pull")
robust_push_pull(g_rt, the_branch, the_commit, tag_name)
robust_push_pull(g_rt, the_branch, the_commit, tag_name, rt_url)
puts("push/pull succeeded")
end
end

puts("scripts/log-results.rb Start!")

if not is_pull_request?
main(CI_PATH, RT_URL, RT_DIR, ARCH, TEST_DIR)
main(CI_PATH, RT_DIR, ARCH, TEST_DIR, RT_URL)
else
puts("Skipping log-results.rb due to being a pull request")
end
Expand Down

0 comments on commit faf1067

Please sign in to comment.