optimal-ci 0.0.1 → 0.0.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 +4 -4
- data/Gemfile.lock +1 -1
- data/lib/optimal/ci/queue.rb +10 -2
- data/lib/optimal/ci/runner.rb +2 -1
- data/lib/optimal/ci/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2dc80539a7e54f44e4f76945a1a82d7068cdf6168a8473ab88ebac94c2a083b3
|
4
|
+
data.tar.gz: 21fd500ce95f28861002a915fd91c26253745ed5511ca332cc296077b0b60c88
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 71b745d20d0e4bbd8253a04927964d464a3f3819053d25565fef73ce3fbcd8a48162e2aff99ef01abe7de355bc3ecc383250082db14463e607210d5688e96d63
|
7
|
+
data.tar.gz: d2310f3801cb6e0272a3ded4888e52edea3b177944b2460452b2bf39678bfbc54c03a0606078e7774a5c79c7e8de2f9988b5e7be4aac31dfa0b263abad1c8b6b
|
data/Gemfile.lock
CHANGED
data/lib/optimal/ci/queue.rb
CHANGED
@@ -1,15 +1,23 @@
|
|
1
1
|
module Optimal
|
2
2
|
module CI
|
3
3
|
class Queue
|
4
|
-
def initialize(provider)
|
4
|
+
def initialize(provider, command_arguments_string = "")
|
5
5
|
@provider = provider
|
6
|
+
@command_arguments_string = command_arguments_string
|
6
7
|
|
7
8
|
raise "OPTIMAL_CI_URL is not valid ENV" if ENV['OPTIMAL_CI_URL'].nil?
|
8
9
|
raise "OPTIMAL_CI_TOKEN is not valid ENV" if ENV['OPTIMAL_CI_TOKEN'].nil?
|
9
10
|
end
|
10
11
|
|
11
12
|
def push(files)
|
12
|
-
|
13
|
+
params = {
|
14
|
+
build_number: @provider.build_number,
|
15
|
+
total_files: files,
|
16
|
+
ci: @provider.name,
|
17
|
+
command_arguments_string: @command_arguments_string
|
18
|
+
}
|
19
|
+
|
20
|
+
response = ::RestClient.post(ENV['OPTIMAL_CI_URL'] + '/builds', params, { Authorization: ENV['OPTIMAL_CI_TOKEN'] })
|
13
21
|
|
14
22
|
response.code == 204
|
15
23
|
rescue RestClient::Conflict
|
data/lib/optimal/ci/runner.rb
CHANGED
@@ -2,6 +2,7 @@ module Optimal
|
|
2
2
|
module CI
|
3
3
|
class Runner
|
4
4
|
def initialize(args = [])
|
5
|
+
@command_arguments_string = args.join(" ")
|
5
6
|
@args = args
|
6
7
|
|
7
8
|
if @args.empty?
|
@@ -13,7 +14,7 @@ module Optimal
|
|
13
14
|
|
14
15
|
def run
|
15
16
|
provider = Optimal::CI::Provider.detect
|
16
|
-
queue = Optimal::CI::Queue.new(provider)
|
17
|
+
queue = Optimal::CI::Queue.new(provider, @command_arguments_string)
|
17
18
|
|
18
19
|
queue.push(total_files)
|
19
20
|
|
data/lib/optimal/ci/version.rb
CHANGED