travis_parallel_sentinel 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: aedbf01942aa8e6c90808ad766da2f07d1058d0c
4
- data.tar.gz: 5c7bd6e6569493a706a5e163dae666922f6cf5e3
3
+ metadata.gz: 2aa5ab88dfac88344db98e17462a68bcd8177a6c
4
+ data.tar.gz: beb3c18247afc7947c573a9942f8842a3577c0dd
5
5
  SHA512:
6
- metadata.gz: a1f80b9bf3874cba29a8d93b8c219e5d9d11192697715abd980ea610eb2beeedfa876b69d0096c058744ee10a747678cf59d091f6b6f8e1ef971a7b22ed7ed0e
7
- data.tar.gz: a54087b460285a6fe5b96845dedffb6ac751381c3bea1dfa1d72a2dcc15ab82a1d77e3b10f2b0cc2ba1a3a8bfbb5c327a3ed275d755656a7f83fa5419ffe599d
6
+ metadata.gz: 4220e44851f77b6bcda39d37addbfe62651de07ef0209fee751620abc1fd02533d3ffcb582cefc1cf1133b9252aef5d2b5ec8967e5182ab68596a23704f36b79
7
+ data.tar.gz: 907375f09fc7aaa077a0064aafd6fb357f2370f8783b1c141b9643431a9e6632637f0fa318f59386705a80105cca00c44d6172523ca6303f75326a9ff2136c06
data/README.md CHANGED
@@ -1,8 +1,34 @@
1
1
  # TravisParallelSentinel
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/travis_parallel_sentinel`. To experiment with that code, run `bin/console` for an interactive prompt.
4
-
5
- TODO: Delete this and the text above, and describe your gem
3
+ Simple parallel build coordination for Travis.
4
+
5
+ Until https://github.com/travis-ci/travis-ci/issues/929 is resolved, you can use this to coordinate your builds. Install
6
+ the gem, and you can do the following in your build scripts:
7
+
8
+ STATUS=$(travis_parallel_sentinel)
9
+ case $STATUS in
10
+ ok)
11
+ echo 'All clear'
12
+ exit 0
13
+ ;;
14
+ deploy)
15
+ echo 'All builds green'
16
+ ;;
17
+ *)
18
+ echo "Unexpected build status $STATUS"
19
+ exit 1
20
+ ;;
21
+ esac
22
+
23
+ # do your deploy work here
24
+
25
+ The bundled script will return `ok` for anything but the primary build; for the primary build, it will error out if any
26
+ of the other builds have, and will return `deploy` if all went well. This is meant to run *as part of your tests*, as
27
+ that will cause your build to error out if the deploy fails.
28
+
29
+ If you want to have the standard Travis behavior, that is, have builds go green even if the deploy step fails, run the
30
+ above in your after\_X step, but do `STATUS=$(travis_parallel_sentinel include)` to include the primary build status in
31
+ the success assessment.
6
32
 
7
33
  ## Installation
8
34
 
@@ -20,20 +46,3 @@ Or install it yourself as:
20
46
 
21
47
  $ gem install travis_parallel_sentinel
22
48
 
23
- ## Usage
24
-
25
- TODO: Write usage instructions here
26
-
27
- ## Development
28
-
29
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `bin/console` for an interactive prompt that will allow you to experiment.
30
-
31
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release` to create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
32
-
33
- ## Contributing
34
-
35
- 1. Fork it ( https://github.com/[my-github-username]/travis_parallel_sentinel/fork )
36
- 2. Create your feature branch (`git checkout -b my-new-feature`)
37
- 3. Commit your changes (`git commit -am 'Add some feature'`)
38
- 4. Push to the branch (`git push origin my-new-feature`)
39
- 5. Create a new Pull Request
@@ -1,3 +1,3 @@
1
1
  module TravisParallelSentinel
2
- VERSION = "0.1.4"
2
+ VERSION = "0.1.5"
3
3
  end
@@ -14,9 +14,12 @@ module TravisParallelSentinel
14
14
  builds = JSON.parse(open("https://api.travis-ci.org/builds/#{TRAVIS_BUILD_ID}").read)
15
15
  jobs = status['matrix'].select{|job| job['number'] != TRAVIS_JOB_NUMBER || include_deployer}.collect{|job| job['result']}
16
16
  if jobs.detect{|s| s.nil?}
17
+ puts "waiting... #{jobs.inspect}"
17
18
  sleep 5
19
+ elsif jobs.detect{|s| s != 0}
20
+ throw "One or more jobs failed"
18
21
  else
19
- return jobs.detect{|s| s != 0} ? :failed : :deploy
22
+ return :deploy
20
23
  end
21
24
  end
22
25
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: travis_parallel_sentinel
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - retorquere