ci-queue 0.4.0 → 0.5.0

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: 9e2a5e243d0c01b09a1ec573d9fbd68a5d53ee58
4
- data.tar.gz: 2ecc77117536d28f5acd1af66e9aad9c7cf5748a
3
+ metadata.gz: b9f6bf7fa8cac79dde7b6d9d5edf248ddd0b120c
4
+ data.tar.gz: 5b791e014804ec263c9350958978b339478ea1e9
5
5
  SHA512:
6
- metadata.gz: 73bb4f9b60fa024297d59e2548461b76442e4b1a873bb218c995cb5c2a145b77e329c14b32e12dad4f624dab296e466a6aa47a3664ce7938a40923861f4b6aa0
7
- data.tar.gz: 2f808596714e9a399dc609b2a473c332dd119fcaedda6410c375e71a8114ed08a3e12ea6eb86957404afa21253c265017126e1cefaba4c2975a42d3eb4158043
6
+ metadata.gz: 25a570de92f44e32140b722c225f575363f1cb56e8ed25aa8e09f5f6e41c6b1b8f1db05b9ab9766d3ed81456004389f862c0a7f6ea626ad3cd9bbec3b3984c4c
7
+ data.tar.gz: b0c2d9038b91fbb33d922c5ad522a45051328f587adc960025710e7ec565b36aa2a8f4ac44b65e4c736e10092fa335f5ea787455735f0216df117c7cff36966a
data/dev.yml ADDED
@@ -0,0 +1,20 @@
1
+ # This file is for Shopify employees development environment.
2
+ # If you are an external contributor you don't have to bother with it.
3
+ name: ci-queue
4
+
5
+ up:
6
+ - ruby: 2.1.6
7
+ - bundler
8
+ - railgun
9
+
10
+ commands:
11
+ test: REDIS_HOST=ci-queue.railgun bundle exec rake test
12
+
13
+ railgun:
14
+ image: dev:railgun-common-services-0.2.x
15
+ services:
16
+ redis: 6379
17
+ ip_address: 192.168.64.245
18
+ memory: 1G
19
+ cores: 1
20
+ disk: 512M
@@ -42,6 +42,10 @@ module CI
42
42
  raise LostMaster, "The master worker is still `#{master_status}` after 10 seconds waiting."
43
43
  end
44
44
 
45
+ def workers_count
46
+ redis.scard(key('workers'))
47
+ end
48
+
45
49
  private
46
50
 
47
51
  attr_reader :redis, :build_id
@@ -194,9 +194,14 @@ module CI
194
194
  redis.set(key('master-status'), 'ready')
195
195
  end
196
196
  end
197
+ register
197
198
  rescue ::Redis::BaseConnectionError
198
199
  raise if @master
199
200
  end
201
+
202
+ def register
203
+ redis.sadd(key('workers'), worker_id)
204
+ end
200
205
  end
201
206
  end
202
207
  end
@@ -1,5 +1,5 @@
1
1
  module CI
2
2
  module Queue
3
- VERSION = '0.4.0'
3
+ VERSION = '0.5.0'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ci-queue
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jean Boussier
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-12-01 00:00:00.000000000 Z
11
+ date: 2017-02-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -112,6 +112,7 @@ files:
112
112
  - bin/rake
113
113
  - bin/setup
114
114
  - ci-queue.gemspec
115
+ - dev.yml
115
116
  - lib/ci/queue.rb
116
117
  - lib/ci/queue/file.rb
117
118
  - lib/ci/queue/redis.rb
@@ -146,7 +147,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
146
147
  version: '0'
147
148
  requirements: []
148
149
  rubyforge_project:
149
- rubygems_version: 2.6.6
150
+ rubygems_version: 2.2.3
150
151
  signing_key:
151
152
  specification_version: 4
152
153
  summary: Distribute tests over many workers using a queue