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 +4 -4
- data/README.md +29 -20
- data/lib/travis_parallel_sentinel/version.rb +1 -1
- data/lib/travis_parallel_sentinel.rb +4 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2aa5ab88dfac88344db98e17462a68bcd8177a6c
|
4
|
+
data.tar.gz: beb3c18247afc7947c573a9942f8842a3577c0dd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4220e44851f77b6bcda39d37addbfe62651de07ef0209fee751620abc1fd02533d3ffcb582cefc1cf1133b9252aef5d2b5ec8967e5182ab68596a23704f36b79
|
7
|
+
data.tar.gz: 907375f09fc7aaa077a0064aafd6fb357f2370f8783b1c141b9643431a9e6632637f0fa318f59386705a80105cca00c44d6172523ca6303f75326a9ff2136c06
|
data/README.md
CHANGED
@@ -1,8 +1,34 @@
|
|
1
1
|
# TravisParallelSentinel
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
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
|
@@ -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
|
22
|
+
return :deploy
|
20
23
|
end
|
21
24
|
end
|
22
25
|
end
|