inch_ci-worker 0.3.0.rc10 → 0.3.0.rc11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/inch_ci/worker/build_json/task.rb +6 -6
- data/lib/inch_ci/worker/build_json.rb +16 -0
- data/lib/inch_ci/worker/version.rb +1 -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: feca80786e2922278233e72402ea47f438bc3e85
|
4
|
+
data.tar.gz: 4de36a97a7ccb93c49178927f5632a3e36ab6d30
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fff4eb32c861c9a26034a2d4dc74ee372569f89bfbd38eda8b299feeb2d3313de33ef95b394811635151f4bc6a3230cc54c6fcf33c25e2f28721a8f4610040b1
|
7
|
+
data.tar.gz: f1241a335f5ce320511eb3fabcd343ab06e2ffcf814758540b070355d73d63a774d4f17be417bdbfe558677474287d6d978fcec7b45bccd2770a4120789dc4d8
|
@@ -9,7 +9,7 @@ module InchCI
|
|
9
9
|
attr_reader :json
|
10
10
|
|
11
11
|
def initialize(filename)
|
12
|
-
@json =
|
12
|
+
@json = BuildJSON.json(filename)
|
13
13
|
@work_dir = Dir.mktmpdir
|
14
14
|
|
15
15
|
started_at = Time.now
|
@@ -27,11 +27,11 @@ module InchCI
|
|
27
27
|
end
|
28
28
|
|
29
29
|
def build(filename)
|
30
|
-
language = json
|
31
|
-
branch_name = json
|
32
|
-
revision = json
|
33
|
-
nwo = json
|
34
|
-
@url = json
|
30
|
+
language = json.language
|
31
|
+
branch_name = json.branch_name
|
32
|
+
revision = json.revision
|
33
|
+
nwo = json.nwo
|
34
|
+
@url = json.url
|
35
35
|
latest_revision = true # TODO: make truthful
|
36
36
|
|
37
37
|
if retrieve_repo
|
@@ -3,6 +3,22 @@ require 'inch_ci/worker/build_json/task'
|
|
3
3
|
module InchCI
|
4
4
|
module Worker
|
5
5
|
module BuildJSON
|
6
|
+
def self.json(filename)
|
7
|
+
JSONDump.new(filename)
|
8
|
+
end
|
9
|
+
|
10
|
+
class JSONDump
|
11
|
+
attr_reader :language, :branch_name, :revision, :nwo, :url
|
12
|
+
|
13
|
+
def initialize(filename)
|
14
|
+
json = JSON[File.read(filename)]
|
15
|
+
@language = json['language']
|
16
|
+
@branch_name = json['branch_name'] || json['travis_branch']
|
17
|
+
@revision = json['revision'] || json['travis_commit']
|
18
|
+
@nwo = json['nwo'] || json['travis_repo_slug']
|
19
|
+
@url = json['git_repo_url']
|
20
|
+
end
|
21
|
+
end
|
6
22
|
end
|
7
23
|
end
|
8
24
|
end
|