Skip to content

Commit

Permalink
Merge pull request #710 from calabash/feature/update-xtc-travis-ci-fo…
Browse files Browse the repository at this point in the history
…r-teams-and-orgs

Update Travis XTC job for teams and orgs
  • Loading branch information
jmoody committed Feb 24, 2015
2 parents 0e02148 + 60630d9 commit f03ebd9
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 10 deletions.
9 changes: 6 additions & 3 deletions .travis.yml
Expand Up @@ -13,7 +13,7 @@ before_script:
script:
# Skip XTC run on all but 2.1.2 to avoid redundant testing. This is just a
# smoke test to ensure a job can be validated; the ruby version is immaterial.
- if [[ ( ! -z $XTC_API_TOKEN && `ruby -e 'print RUBY_VERSION'` == '2.1.2' ) ]]; then script/ci/travis/xtc-submit-ci.rb; fi
- if [[ ( ! -z $XTC_API_TOKEN && ! -z $XTC_USER && `ruby -e 'print RUBY_VERSION'` == '2.1.2' ) ]]; then script/ci/travis/xtc-submit-ci.rb; fi
- script/ci/travis/install-gem-ci.rb
- script/ci/travis/rspec-ci.rb
- script/ci/travis/cucumber-ci.rb --tags ~@no_ci
Expand All @@ -35,7 +35,10 @@ notifications:
env:
global:
# xtc api token => script/ci/travis/xtc-submit-ci.rb
# xtc user => script/ci/travis/xtc-submit-ci.rb
# -r calabash/calabash-ios
- secure: MH0JDvqaycLmlc/Ld69MjGMwIh1Q3b9wrb7NdK9u6PNP9MlMq2PAzaSKGISYmu+Mkrvca8NjUb2FdhXIhwClOw9uKtT8QJBHvLoKejU7y15T8iXzTT1s21pCg2WfR7/KN8SaxMyuI2/ppLbkuRjmMo3aToweEa0i9gQhu61THEI=
- secure: "Fl27YECPUQ1eK3lcUiG8WgbKvvEBm9KG+sFt3nsUc1TLATwBCeL3jU+CDTFUZYh509G/L0p3k1VfOKoRubwyuKI1NRAg2qr5e1YhiMblA8QdgGuPZS6o5mgmYKCG6wriKsHFLrGETwtJF9gBugwPHs9NGe7AMyqGk+Q3j+zmdJY="
- secure: "pE7fLQ1ZYSVH3PD700kN8ygwMQcSbRXCthkNXUhp16zGx5mQLBGGffmCz6HhiURHAjSmjRu2XlCvIx95Lg0XKPe/zATYsLiBMyFNdZNwIFHEFSWFLCuaVXEzdXVNuLJOS8vHLBsVi6GFagwk1Qi+0x2FrtbZXz/u2Qk99gtuf18="
# -r jmoody/calabash-ios
- secure: tTNtqG9pVYw0+gKggHlivfutHAJ1EK6PZGRYOh8jojw3GMJyfwwJeVkwlIral18SH3ijBjxz5XLcqAVHgrq6KIvzZ03o1VrkgoKKF1uRApjXadhaN0LqsXXivoDFFkY12aGVWR0eSK5eBHxU6NA2RhJnNrjscQEdk400mzJJMmI=
- secure: "QBD8Vf18ZJ1a6SKdkoAaUJ7iBREyhJzeFNObVDnAddl5NoNVc1X3ifcvRn6phSrC5jOesqgvGS9wKPiZpoax2UWJGK360MEJt7m7/9xU1YLfUtQwu5pY4sgSH0JOq0oHnnxREF89H67AQ5gjLHtUptTRgshmjNMORoQwFUVRIjc="
- secure: "a9pLFQJjhTq8bXBLB+aSOhsquNADJkIQLoV+nYWe+NBD3pCKUTqYATs+ErcrfhKb4mOei2VjFIGd+X7uQj4rsoUdOA/dcf9vFCREPZBiYFGb5vSxosgOSCE7TQy+GOB4HJ/IVS9Xzjxtw8PWo4EvothAUD+ub2hVImRInhX7BcY="
6 changes: 6 additions & 0 deletions calabash-cucumber/test/xtc/.env-example
@@ -0,0 +1,6 @@
# moody token
XTC_API_TOKEN=eb<snip>45
XTC_DEVICE_SET=78c84725
XTC_USER="your.xtc.email@example.com"
XTC_WAIT_FOR_RESULTS=1

19 changes: 12 additions & 7 deletions script/ci/travis/xtc-submit-ci.rb
Expand Up @@ -26,15 +26,16 @@

log_pass("wrote new Gemfile with calabash-version '#{calabash_version}'")

# On Travis, the XTC api token is _private_ and is available to gem
# maintainers. Pull requests and commits that do not originate from a
# On Travis, the XTC api token and user are _private_ and are available to gem
# maintainers only. Pull requests and commits that do not originate from a
# maintainer skip the XTC step.
#
# Locally, the XTC_API_TOKEN and XTC_DEVICE_SET can be set in a .env file and
# accessed with with the dotenv gem, passed on the command line, or exported
# to the shell.
# Locally, the XTC_API_TOKEN, XTC_DEVICE_SET, and XTC_USER can be set in a
# .env file and accessed with with the dotenv gem, passed on the command line,
# or exported to the shell.
#
# The XCT_API_TOKEN is _private_. The .env should never be committed to git.
# There is an example .env file provided.
#
# Dotenv is _not_ calabash-cucumber gem dependency - it is installed and used
# only during testing.
Expand All @@ -43,6 +44,7 @@
Dotenv.load if File.exist?('.env')
token = ENV['XTC_API_TOKEN']
device_set = ENV['XTC_DEVICE_SET']

unless device_set
# A collection of device sets that have one iOS 7* device.
device_set =
Expand All @@ -55,6 +57,8 @@
].sample
end

user = ENV['XTC_USER']

if ENV['XTC_WAIT_FOR_RESULTS'] == '0'
wait_for_results = '--async'
else
Expand All @@ -65,14 +69,15 @@
'-p', 'ci',
'--series', 'travis-ci-calabash-ios-gem',
'-d', device_set,
wait_for_results]
wait_for_results,
'--user', user]

ipa = 'chou-cal.ipa'

cmd = "test-cloud submit #{ipa} #{token} #{args.join(' ')}"

do_system(cmd, {:pass_msg => 'XTC job completed',
:fail_msg => 'XTC job failed',
:obscure_fields => [token]})
:obscure_fields => [token, user]})
end

0 comments on commit f03ebd9

Please sign in to comment.