vx-message 0.5.0 → 0.6.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: 93fc9b03decef64aafb552293a6f25d28a5cbe9a
4
- data.tar.gz: e981a507e7feac92bc30e6b7ac9a89000430f7d4
3
+ metadata.gz: f8f8d71cae4e55deab7701669d987c6926505175
4
+ data.tar.gz: 624c10e3bc1203e05233ac5f1277d5acac3f0615
5
5
  SHA512:
6
- metadata.gz: d82c2e03a12aba791073b0a798154697f94e415cd6220c6be11540d4dfcdc9085731edbc9209c0cb532ba8a7925577dadc8531d33a17ed2a07f14a7d13c28ccf
7
- data.tar.gz: 277b5367029fa221b42d93ffb98c25104de565aac28c733f612adcc30143984c372ef1a0fe6acaea291293a1b3c104442b66b0d24e6e153234de3e1073d1d0c7
6
+ metadata.gz: 66a6c6eb52c8e2a2f193f0a7933b318a7530953dd4d4f0ec5acff0ab11329d0a8c02d7839667be8f138b4e73149d8aa49f4ce65d9e87c656787db8ac3f27c88c
7
+ data.tar.gz: 8da2d15e9f597aba52ae5886fc4d84e63d15ac51ab92c911e0855d9ed88646778e85af16dfc01027872e492d4f7a9d6b493ac74b36450b4eb307b282a0d0a9aa
data/.travis.yml CHANGED
@@ -1,5 +1,5 @@
1
1
  rvm:
2
2
  - 2.0.0
3
- - 2.1.0
3
+ - 2.1.2
4
4
 
5
5
  script: "bundle exec rake travis"
@@ -6,43 +6,14 @@ module Vx
6
6
 
7
7
  class PerformBuild
8
8
  include Beefcake::Message
9
-
10
-
11
- required :id, :uint64, 1
12
- required :name, :string, 2
13
- required :src, :string, 3
14
- required :sha, :string, 4
15
- optional :deploy_key, :string, 6
16
- required :travis, :string, 7
17
- required :branch, :string, 8
18
- optional :pull_request_id, :uint64, 9
19
-
20
9
  end
21
10
 
22
11
  class PerformJob
23
12
  include Beefcake::Message
24
-
25
-
26
- required :project_id, :uint64, 1
27
- required :build_id, :uint64, 2
28
- required :name, :string, 3
29
- required :job_id, :uint64, 4
30
- required :before_script, :string, 5
31
- required :script, :string, 6
32
- required :after_script, :string, 7
33
- optional :image, :string, 8
34
-
35
13
  end
36
14
 
37
15
  class JobLog
38
16
  include Beefcake::Message
39
-
40
-
41
- required :build_id, :uint64, 1
42
- required :log, :string, 2
43
- required :tm, :uint64, 3
44
- required :job_id, :uint64, 5
45
-
46
17
  end
47
18
 
48
19
  class JobStatus
@@ -55,13 +26,61 @@ module Vx
55
26
  BROKEN = 4
56
27
  FAILED = 5
57
28
  end
29
+ end
58
30
 
59
- required :project_id, :uint64, 1
60
- required :build_id, :uint64, 2
61
- required :job_id, :uint64, 3
62
- required :status, JobStatus::Status, 4
63
- required :tm, :uint64, 5
31
+ class PerformBuild
32
+ required :id, :uint64, 1
33
+ required :name, :string, 2
34
+ required :src, :string, 3
35
+ required :sha, :string, 4
36
+ optional :deploy_key, :string, 6
37
+ required :travis, :string, 7
38
+ required :branch, :string, 8
39
+ optional :pull_request_id, :uint64, 9
40
+ end
41
+
42
+ class PerformJob
43
+ required :company_id, :string, 1
44
+ required :company_name, :string, 2
45
+ required :project_id, :string, 3
46
+ required :project_name, :string, 4
47
+ required :build_id, :string, 5
48
+ required :build_number, :uint64, 6
49
+ required :job_id, :string, 7
50
+ required :job_number, :uint64, 8
51
+ required :job_version, :uint64, 9
52
+ required :before_script, :string, 10
53
+ required :script, :string, 11
54
+ required :after_script, :string, 12
55
+ optional :image, :string, 13
56
+ end
64
57
 
58
+ class JobLog
59
+ required :company_id, :string, 1
60
+ required :company_name, :string, 2
61
+ required :project_id, :string, 3
62
+ required :project_name, :string, 4
63
+ required :build_id, :string, 5
64
+ required :build_number, :uint64, 6
65
+ required :job_id, :string, 7
66
+ required :job_number, :uint64, 8
67
+ required :job_version, :uint64, 9
68
+ required :log, :string, 10
69
+ required :tm, :uint64, 11
70
+ end
71
+
72
+ class JobStatus
73
+ required :company_id, :string, 1
74
+ required :company_name, :string, 2
75
+ required :project_id, :string, 3
76
+ required :project_name, :string, 4
77
+ required :build_id, :string, 5
78
+ required :build_number, :uint64, 6
79
+ required :job_id, :string, 7
80
+ required :job_number, :uint64, 8
81
+ required :job_version, :uint64, 9
82
+ required :status, JobStatus::Status, 10
83
+ required :tm, :uint64, 11
65
84
  end
66
85
  end
67
86
  end
@@ -4,17 +4,30 @@ require File.expand_path("../../message", __FILE__)
4
4
  module Vx
5
5
  module Message
6
6
 
7
+ @@common = {
8
+ company_id: '1',
9
+ company_name: 'company name',
10
+ project_id: '2',
11
+ project_name: 'project name',
12
+ build_id: '3',
13
+ build_number: 4,
14
+ job_id: '5',
15
+ job_number: 6,
16
+ job_version: 1
17
+ }
18
+
19
+ def self.common
20
+ @@common
21
+ end
22
+
7
23
  class JobStatus
8
24
  class << self
9
25
 
10
26
  def test_attributes(options = {})
11
- {
12
- project_id: 1,
13
- build_id: 1,
14
- job_id: 2,
27
+ Message.common.merge(
15
28
  status: 0,
16
29
  tm: 1376137604,
17
- }.merge(options)
30
+ ).merge(options)
18
31
  end
19
32
 
20
33
  def test_message(options = {})
@@ -28,12 +41,10 @@ module Vx
28
41
  class << self
29
42
 
30
43
  def test_attributes(options = {})
31
- {
32
- build_id: 1,
33
- job_id: 2,
34
- log: 'log',
35
- tm: 1376137604,
36
- }.merge(options)
44
+ Message.common.merge(
45
+ log: 'log',
46
+ tm: 1376137604,
47
+ ).merge(options)
37
48
  end
38
49
 
39
50
  def test_message(options = {})
@@ -47,39 +58,11 @@ module Vx
47
58
  class << self
48
59
 
49
60
  def test_attributes(options = {})
50
- options.merge({
51
- project_id: options[:project_id] || 1,
52
- build_id: options[:build_id] || 1,
53
- name: options[:name] || 'evrone/test-repo',
54
- job_id: options[:job_id] || 2,
55
- before_script: options[:before_script] || 'echo before_script',
56
- script: options[:script] || 'echo script',
57
- after_script: options[:after_script] || 'echo after_script'
58
- })
59
- end
60
-
61
- def test_message(options = {})
62
- new test_attributes(options)
63
- end
64
-
65
- end
66
- end
67
-
68
- class PerformBuild
69
- class << self
70
-
71
- def test_attributes(options = {})
72
- key = File.read File.expand_path("../../../../fixtures/insecure_private_key", __FILE__)
73
- travis = File.read File.expand_path("../../../../fixtures/travis.yml", __FILE__)
74
- options.merge({
75
- id: options[:id] || 1,
76
- name: options[:name] || 'evrone/test-repo',
77
- src: options[:src] || "git@github.com:dima-exe/ci-worker-test-repo.git",
78
- sha: options[:sha] || "b665f90239563c030f1b280a434b3d84daeda1bd",
79
- deploy_key: options[:deploy_key] || key,
80
- travis: options[:travis] || travis,
81
- branch: options[:branch] || "master"
82
- })
61
+ Message.common.merge(
62
+ before_script: 'echo before_script',
63
+ script: 'echo script',
64
+ after_script: 'echo after_script',
65
+ ).merge(options)
83
66
  end
84
67
 
85
68
  def test_message(options = {})
@@ -1,5 +1,5 @@
1
1
  module Vx
2
2
  module Message
3
- VERSION = "0.5.0"
3
+ VERSION = "0.6.0"
4
4
  end
5
5
  end
data/proto/messages.proto CHANGED
@@ -1,32 +1,41 @@
1
1
  package vx.message;
2
2
 
3
- message PerformBuild {
4
- required uint64 id = 1;
5
- required string name = 2;
6
- required string src = 3;
7
- required string sha = 4;
8
- optional string deploy_key = 6;
9
- required string travis = 7;
10
- required string branch = 8;
11
- optional uint64 pull_request_id = 9;
12
- }
13
-
14
3
  message PerformJob {
15
- required uint64 project_id = 1;
16
- required uint64 build_id = 2;
17
- required string name = 3;
18
- required uint64 job_id = 4;
19
- required string before_script = 5;
20
- required string script = 6;
21
- required string after_script = 7;
22
- optional string image = 8;
4
+ required string company_id = 1;
5
+ required string company_name = 2;
6
+
7
+ required string project_id = 3;
8
+ required string project_name = 4;
9
+
10
+ required string build_id = 5;
11
+ required uint64 build_number = 6;
12
+
13
+ required string job_id = 7;
14
+ required uint64 job_number = 8;
15
+ required uint64 job_version = 9;
16
+
17
+ required string before_script = 10;
18
+ required string script = 11;
19
+ required string after_script = 12;
20
+ optional string image = 13;
23
21
  }
24
22
 
25
23
  message JobLog {
26
- required uint64 build_id = 1;
27
- required string log = 2;
28
- required uint64 tm = 3;
29
- required uint64 job_id = 5;
24
+ required string company_id = 1;
25
+ required string company_name = 2;
26
+
27
+ required string project_id = 3;
28
+ required string project_name = 4;
29
+
30
+ required string build_id = 5;
31
+ required uint64 build_number = 6;
32
+
33
+ required string job_id = 7;
34
+ required uint64 job_number = 8;
35
+ required uint64 job_version = 9;
36
+
37
+ required string log = 10;
38
+ required uint64 tm = 11;
30
39
  }
31
40
 
32
41
  message JobStatus {
@@ -37,10 +46,21 @@ message JobStatus {
37
46
  BROKEN = 4;
38
47
  FAILED = 5;
39
48
  }
40
- required uint64 project_id = 1;
41
- required uint64 build_id = 2;
42
- required uint64 job_id = 3;
43
- required Status status = 4;
44
- required uint64 tm = 5;
49
+
50
+ required string company_id = 1;
51
+ required string company_name = 2;
52
+
53
+ required string project_id = 3;
54
+ required string project_name = 4;
55
+
56
+ required string build_id = 5;
57
+ required uint64 build_number = 6;
58
+
59
+ required string job_id = 7;
60
+ required uint64 job_number = 8;
61
+ required uint64 job_version = 9;
62
+
63
+ required Status status = 10;
64
+ required uint64 tm = 11;
45
65
  }
46
66
 
@@ -3,7 +3,7 @@ require 'stringio'
3
3
 
4
4
  describe Vx::Message do
5
5
 
6
- %w{ PerformBuild PerformJob JobLog JobStatus }.each do |klass|
6
+ %w{ PerformJob JobLog JobStatus }.each do |klass|
7
7
 
8
8
  context "#{klass}" do
9
9
 
@@ -11,13 +11,13 @@ describe Vx::Message do
11
11
  subject { inst.test_message }
12
12
 
13
13
  it "should be valid" do
14
- expect(subject.validate!).to be_true
14
+ expect(subject.validate!).to be
15
15
  end
16
16
 
17
17
  it "should be successfuly serialized/deserialized" do
18
18
  bytes = subject.encode
19
19
  obj = described_class.const_get(klass).decode(bytes)
20
- expect(obj.validate!).to be_true
20
+ expect(obj.validate!).to be
21
21
  expect(obj).to eq subject
22
22
  end
23
23
 
data/vx-message.gemspec CHANGED
@@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
18
18
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
19
  spec.require_paths = ["lib"]
20
20
 
21
- spec.add_runtime_dependency 'beefcake', '= 0.3.7'
21
+ spec.add_runtime_dependency 'beefcake', '= 0.5.0'
22
22
 
23
23
  spec.add_development_dependency "bundler", "~> 1.3"
24
24
  spec.add_development_dependency "rake"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vx-message
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dmitry Galinsky
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-08 00:00:00.000000000 Z
11
+ date: 2014-06-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: beefcake
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 0.3.7
19
+ version: 0.5.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 0.3.7
26
+ version: 0.5.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: bundler
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -109,7 +109,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
109
109
  version: '0'
110
110
  requirements: []
111
111
  rubyforge_project:
112
- rubygems_version: 2.0.14
112
+ rubygems_version: 2.2.2
113
113
  signing_key:
114
114
  specification_version: 4
115
115
  summary: Evrone CI message