pipely 0.12.0 → 0.13.0
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/lib/pipely/build.rb +1 -0
- data/lib/pipely/build/daily_scheduler.rb +1 -1
- data/lib/pipely/build/definition.rb +2 -0
- data/lib/pipely/build/hourly_scheduler.rb +29 -0
- data/lib/pipely/deploy/client.rb +2 -1
- data/lib/pipely/version.rb +1 -1
- data/spec/lib/pipely/build/daily_scheduler_spec.rb +26 -8
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b731960bf5c0239cac639066f033a49a4e5e6c0f
|
4
|
+
data.tar.gz: 1612176e9731abbe4d00ad0e9d900a92fb0a3f37
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2fd1252c31ad76533f47cd2e5262e8e99710354af17308e50490773ca4670720dfeecab393938936db58a9f0a1b79656e88a8b143a9cd48b3223accd23958c1f
|
7
|
+
data.tar.gz: a4426e893afb1ea016504ef4853a452c99332b13b347810d66b2a9b0816fffe18eb60da85a6d83b7a1e771066bf3245dd8ed42d84e0b7d6e0d7b5a5b2d14b554
|
data/lib/pipely/build.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
require 'pipely/build/definition'
|
2
2
|
require 'pipely/build/template'
|
3
3
|
require 'pipely/build/daily_scheduler'
|
4
|
+
require 'pipely/build/hourly_scheduler'
|
4
5
|
require 'pipely/build/right_now_scheduler'
|
5
6
|
require 'pipely/build/s3_path_builder'
|
6
7
|
require 'pipely/build/environment_config'
|
@@ -0,0 +1,29 @@
|
|
1
|
+
module Pipely
|
2
|
+
module Build
|
3
|
+
|
4
|
+
# Compute schedule attributes for a pipeline that runs once-a-day at a set
|
5
|
+
# time.
|
6
|
+
#
|
7
|
+
class HourlyScheduler
|
8
|
+
|
9
|
+
def period
|
10
|
+
'1 hours'
|
11
|
+
end
|
12
|
+
|
13
|
+
def start_date_time
|
14
|
+
|
15
|
+
(Time.now.utc + 3600).strftime("%Y-%m-%dT%H:00:00")
|
16
|
+
|
17
|
+
end
|
18
|
+
|
19
|
+
def to_hash
|
20
|
+
{
|
21
|
+
:period => period,
|
22
|
+
:start_date_time => start_date_time
|
23
|
+
}
|
24
|
+
end
|
25
|
+
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
29
|
+
end
|
data/lib/pipely/deploy/client.rb
CHANGED
data/lib/pipely/version.rb
CHANGED
@@ -1,9 +1,8 @@
|
|
1
1
|
require 'pipely/build/daily_scheduler'
|
2
|
-
|
2
|
+
require 'timecop'
|
3
3
|
describe Pipely::Build::DailyScheduler do
|
4
4
|
|
5
5
|
let(:start_time) { "11:00:00" }
|
6
|
-
|
7
6
|
subject { described_class.new(start_time) }
|
8
7
|
|
9
8
|
describe "#period" do
|
@@ -12,22 +11,41 @@ describe Pipely::Build::DailyScheduler do
|
|
12
11
|
end
|
13
12
|
end
|
14
13
|
|
14
|
+
context "if the start time is garbage" do
|
15
|
+
let(:start_time) { "0ksnsnk" }
|
16
|
+
it 'Raises an error' do
|
17
|
+
expect {described_class.new(start_time)}.to raise_exception ArgumentError
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
15
21
|
describe "#start_date_time" do
|
16
|
-
context "if the start time
|
17
|
-
|
18
|
-
|
22
|
+
context "if the start time is 11:00:00 UTC" do
|
23
|
+
let(:start_time) { "11:00:00" }
|
24
|
+
it "and it is after that it chooses the start time tomorrow" do
|
25
|
+
Timecop.freeze(Time.utc(2013, 6, 13, 16, 12, 30)) do
|
26
|
+
expect(subject.start_date_time).to eq("2013-06-14T11:00:00")
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
it "and it is before that it chooses the start time today" do
|
31
|
+
Timecop.freeze(Time.utc(2013, 6, 13, 4, 12, 30)) do
|
19
32
|
expect(subject.start_date_time).to eq("2013-06-13T11:00:00")
|
20
33
|
end
|
21
34
|
end
|
22
35
|
end
|
23
36
|
|
24
|
-
context "if the start time has
|
37
|
+
context "if the start time has is badly formatted" do
|
38
|
+
let(:start_time) { "9:00:" }
|
25
39
|
it "chooses the start time today" do
|
26
40
|
Timecop.freeze(Time.utc(2013, 6, 13, 4, 12, 30)) do
|
27
|
-
expect(subject.start_date_time).to eq("2013-06-
|
41
|
+
expect(subject.start_date_time).to eq("2013-06-13T09:00:00")
|
42
|
+
end
|
43
|
+
end
|
44
|
+
it "chooses the start time tomorrow" do
|
45
|
+
Timecop.freeze(Time.utc(2013, 6, 13, 11, 12, 30)) do
|
46
|
+
expect(subject.start_date_time).to eq("2013-06-14T09:00:00")
|
28
47
|
end
|
29
48
|
end
|
30
49
|
end
|
31
50
|
end
|
32
|
-
|
33
51
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pipely
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.13.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matt Gillooly
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-05-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ruby-graphviz
|
@@ -240,6 +240,7 @@ files:
|
|
240
240
|
- lib/pipely/build/daily_scheduler.rb
|
241
241
|
- lib/pipely/build/definition.rb
|
242
242
|
- lib/pipely/build/environment_config.rb
|
243
|
+
- lib/pipely/build/hourly_scheduler.rb
|
243
244
|
- lib/pipely/build/right_now_scheduler.rb
|
244
245
|
- lib/pipely/build/s3_path_builder.rb
|
245
246
|
- lib/pipely/build/template.rb
|