travis_parallel_sentinel 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 9f9b22c4d7ed592fa032cae3611bdafcda42ea2c
4
+ data.tar.gz: 0743db446a34207c0b752e856326c1e045e5ede7
5
+ SHA512:
6
+ metadata.gz: 06dcc08f36d6672f0e53bfc665ec6315d845defff243770d05612f1d78cfb2c43007f027247ce50604af5e62474ea96e91906ebabd3416f763783805a101298a
7
+ data.tar.gz: ea4a2c81253f39ba2cafdf51fbd2d69fa705fed580fef41e83215cf3e144da78a4eb04c67063be8b083b3e62084c39c612ea1737ad7dc918bd6e82cc8f083d4c
data/.gitignore ADDED
@@ -0,0 +1,8 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in travis_parallel_sentinel.gemspec
4
+ gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,17 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ travis_parallel_sentinel (0.1.0)
5
+
6
+ GEM
7
+ remote: https://rubygems.org/
8
+ specs:
9
+ rake (10.4.2)
10
+
11
+ PLATFORMS
12
+ ruby
13
+
14
+ DEPENDENCIES
15
+ bundler (~> 1.8)
16
+ rake (~> 10.0)
17
+ travis_parallel_sentinel!
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2015 retorquere
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,39 @@
1
+ # TravisParallelSentinel
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
6
+
7
+ ## Installation
8
+
9
+ Add this line to your application's Gemfile:
10
+
11
+ ```ruby
12
+ gem 'travis_parallel_sentinel'
13
+ ```
14
+
15
+ And then execute:
16
+
17
+ $ bundle
18
+
19
+ Or install it yourself as:
20
+
21
+ $ gem install travis_parallel_sentinel
22
+
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
data/Rakefile ADDED
@@ -0,0 +1,24 @@
1
+ require 'bundler/gem_tasks'
2
+ require 'fileutils'
3
+ require 'yaml'
4
+ require 'pp'
5
+
6
+ task :default => :build
7
+
8
+ task :bump do
9
+ version = TravisParallelSentinel::VERSION.split('.').collect{|v| Integer(v)}
10
+ version[2] += 1
11
+ version = version.collect{|v| v.to_s}.join('.')
12
+ File.open('lib/travis_parallel_sentinel/version.rb', 'w'){|f| f.write("module TravisParallelSentinel\n VERSION = #{version.inspect}\nend\n") }
13
+ puts `git add lib/travis_parallel_sentinel/version.rb Gemfile.lock`
14
+ end
15
+
16
+ task :publish do
17
+ sh "git add ."
18
+ sh "git commit -m #{TravisParallelSentinel::VERSION}"
19
+ sh "git tag #{TravisParallelSentinel::VERSION}"
20
+ Dir['pkg/*.gem'].each{|f| File.unlink(f)}
21
+ Rake::Task["build"].invoke
22
+ sh "gem push #{Dir['pkg/*.gem'].join(' ')}"
23
+ sh "git push"
24
+ end
data/bin/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "travis_parallel_sentinel"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start
data/bin/setup ADDED
@@ -0,0 +1,7 @@
1
+ #!/bin/bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+
5
+ bundle install
6
+
7
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,13 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "travis_parallel_sentinel"
5
+
6
+ if ARGV[0] == 'include'
7
+ puts TravisParallelSentinel::status(true)
8
+ elsif ARGV[0].to_s == ''
9
+ puts TravisParallelSentinel::status(false)
10
+ else
11
+ STDERR.puts "Unexpected argument #{ARGV[0]}, expected none or 'include'"
12
+ exit 1
13
+ end
@@ -0,0 +1,3 @@
1
+ module TravisParallelSentinel
2
+ VERSION = "0.1.2"
3
+ end
@@ -0,0 +1,24 @@
1
+ require "travis_parallel_sentinel/version"
2
+ require 'open-uri'
3
+ require 'json'
4
+
5
+ TRAVIS_JOB_NUMBER = ENV['TRAVIS_JOB_NUMBER'].to_s.strip
6
+ TRAVIS_BUILD_ID = ENV['TRAVIS_BUILD_ID'].to_s.strip
7
+
8
+ module TravisParallelSentinel
9
+ def status(include_deployer=false)
10
+ return :deploy if TRAVIS_JOB_NUMBER == '' # no build matrix, so good to go
11
+ return :ok unless TRAVIS_JOB_NUMBER =~ /\.1$/ # first job in the sequence is the deployment container
12
+
13
+ while true
14
+ builds = JSON.parse(open("https://api.travis-ci.org/builds/#{TRAVIS_BUILD_ID}").read)
15
+ jobs = status['matrix'].select{|job| job['number'] != TRAVIS_JOB_NUMBER || include_deployer}.collect{|job| job['result']}
16
+ if jobs.detect{|s| s.nil?}
17
+ sleep 5
18
+ else
19
+ return jobs.detect{|s| s != 0} ? :failed : :deploy
20
+ end
21
+ end
22
+ end
23
+ module_function :status
24
+ end
@@ -0,0 +1,27 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'travis_parallel_sentinel/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "travis_parallel_sentinel"
8
+ spec.version = TravisParallelSentinel::VERSION
9
+ spec.authors = ["retorquere"]
10
+ spec.email = ["Emiliano.Heyns@iris-advies.com"]
11
+
12
+ # if spec.respond_to?(:metadata)
13
+ # spec.metadata['allowed_push_host'] = "TODO: Set to 'http://mygemserver.com' to prevent pushes to rubygems.org, or delete to allow pushes to any server."
14
+ # end
15
+
16
+ spec.summary = %q{Coordinate parallel Travis builds}
17
+ spec.homepage = "https://github.com/ZotPlus/travis_parallel_sentinel"
18
+ spec.license = "MIT"
19
+
20
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
21
+ spec.bindir = "exe"
22
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
23
+ spec.require_paths = ["lib"]
24
+
25
+ spec.add_development_dependency "bundler", "~> 1.8"
26
+ spec.add_development_dependency "rake", "~> 10.0"
27
+ end
metadata ADDED
@@ -0,0 +1,84 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: travis_parallel_sentinel
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.2
5
+ platform: ruby
6
+ authors:
7
+ - retorquere
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2015-05-27 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.8'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.8'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ description:
42
+ email:
43
+ - Emiliano.Heyns@iris-advies.com
44
+ executables: []
45
+ extensions: []
46
+ extra_rdoc_files: []
47
+ files:
48
+ - ".gitignore"
49
+ - Gemfile
50
+ - Gemfile.lock
51
+ - LICENSE.txt
52
+ - README.md
53
+ - Rakefile
54
+ - bin/console
55
+ - bin/setup
56
+ - bin/travis_parallel_sentinel
57
+ - lib/travis_parallel_sentinel.rb
58
+ - lib/travis_parallel_sentinel/version.rb
59
+ - travis_parallel_sentinel.gemspec
60
+ homepage: https://github.com/ZotPlus/travis_parallel_sentinel
61
+ licenses:
62
+ - MIT
63
+ metadata: {}
64
+ post_install_message:
65
+ rdoc_options: []
66
+ require_paths:
67
+ - lib
68
+ required_ruby_version: !ruby/object:Gem::Requirement
69
+ requirements:
70
+ - - ">="
71
+ - !ruby/object:Gem::Version
72
+ version: '0'
73
+ required_rubygems_version: !ruby/object:Gem::Requirement
74
+ requirements:
75
+ - - ">="
76
+ - !ruby/object:Gem::Version
77
+ version: '0'
78
+ requirements: []
79
+ rubyforge_project:
80
+ rubygems_version: 2.4.6
81
+ signing_key:
82
+ specification_version: 4
83
+ summary: Coordinate parallel Travis builds
84
+ test_files: []