pipely 0.8.3 → 0.10.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.
Files changed (39) hide show
  1. checksums.yaml +4 -4
  2. data/lib/pipely/build.rb +2 -16
  3. data/lib/pipely/build/daily_scheduler.rb +1 -1
  4. data/lib/pipely/build/definition.rb +30 -2
  5. data/lib/pipely/build/environment_config.rb +24 -1
  6. data/lib/pipely/build/s3_path_builder.rb +65 -33
  7. data/lib/pipely/deploy/bootstrap.rb +17 -14
  8. data/lib/pipely/deploy/bootstrap_context.rb +87 -10
  9. data/lib/pipely/deploy/bootstrap_registry.rb +45 -0
  10. data/lib/pipely/deploy/client.rb +33 -18
  11. data/lib/pipely/deploy/json_definition.rb +51 -0
  12. data/lib/pipely/pipeline_date_time/pipeline_date.rb +62 -0
  13. data/lib/pipely/pipeline_date_time/pipeline_date_pattern.rb +42 -0
  14. data/lib/pipely/pipeline_date_time/pipeline_date_range_base.rb +44 -0
  15. data/lib/pipely/pipeline_date_time/pipeline_day_range.rb +14 -0
  16. data/lib/pipely/pipeline_date_time/pipeline_month_range.rb +26 -0
  17. data/lib/pipely/pipeline_date_time/pipeline_year_range.rb +25 -0
  18. data/lib/pipely/tasks/definition.rb +7 -0
  19. data/lib/pipely/tasks/deploy.rb +7 -0
  20. data/lib/pipely/tasks/upload_pipeline_as_gem.rb +19 -9
  21. data/lib/pipely/version.rb +1 -1
  22. data/spec/fixtures/bootstrap_contexts/green.rb +9 -0
  23. data/spec/fixtures/bootstrap_contexts/simple.rb +9 -0
  24. data/spec/fixtures/templates/bootstrap.sh.erb +4 -0
  25. data/spec/lib/pipely/build/environment_config_spec.rb +58 -0
  26. data/spec/lib/pipely/build/s3_path_builder_spec.rb +34 -2
  27. data/spec/lib/pipely/build/template_spec.rb +10 -10
  28. data/spec/lib/pipely/build_spec.rb +29 -0
  29. data/spec/lib/pipely/deploy/bootstrap_context_spec.rb +102 -14
  30. data/spec/lib/pipely/deploy/bootstrap_registry_spec.rb +32 -0
  31. data/spec/lib/pipely/deploy/bootstrap_spec.rb +41 -24
  32. data/spec/lib/pipely/pipeline_date_time/pipeline_date_pattern_spec.rb +181 -0
  33. data/spec/lib/pipely/pipeline_date_time/pipeline_date_range_base_spec.rb +39 -0
  34. data/spec/lib/pipely/pipeline_date_time/pipeline_date_spec.rb +110 -0
  35. data/spec/lib/pipely/pipeline_date_time/pipeline_day_range_spec.rb +23 -0
  36. data/spec/lib/pipely/pipeline_date_time/pipeline_month_range_spec.rb +93 -0
  37. data/spec/lib/pipely/pipeline_date_time/pipeline_year_range_spec.rb +93 -0
  38. data/spec/lib/pipely/tasks/upload_pipeline_as_gem_spec.rb +59 -0
  39. metadata +49 -3
@@ -0,0 +1,93 @@
1
+ # encoding: utf-8
2
+ require 'pipely/pipeline_date_time/pipeline_year_range'
3
+
4
+ describe Pipely::PipelineDateTime::PipelineYearRange do
5
+ let(:target_date) { '@scheduledStartTime' }
6
+
7
+ context 'with 729 days between start and end' do
8
+ let(:days_back_start) { 729 }
9
+ let(:days_back_end) { 0 }
10
+ subject { described_class.new(target_date, days_back_start, days_back_end) }
11
+
12
+ describe '#start' do
13
+ it { expect(subject.start).to eq 364 }
14
+ end
15
+
16
+ describe '#end' do
17
+ it { expect(subject.end).to eq 365 }
18
+ end
19
+
20
+ describe '#years' do
21
+ it { expect(subject.years).to eq [] }
22
+ end
23
+ end
24
+
25
+ context 'with 730 days between start and end' do
26
+ let(:days_back_start) { 731 }
27
+ let(:days_back_end) { 1 }
28
+ subject { described_class.new(target_date, days_back_start, days_back_end) }
29
+
30
+ describe '#start' do
31
+ it { expect(subject.start).to eq 366 }
32
+ end
33
+
34
+ describe '#end' do
35
+ it { expect(subject.end).to eq 366 }
36
+ end
37
+
38
+ describe '#years' do
39
+ let(:expected_years) do
40
+ ["\#{format(minusDays(@scheduledStartTime, 366), \"YYYY\")}"]
41
+ end
42
+
43
+ it { expect(subject.years).to eq expected_years }
44
+ end
45
+ end
46
+
47
+ context 'with 1094 days between start and end' do
48
+ let(:days_back_start) { 1096 }
49
+ let(:days_back_end) { 2 }
50
+ subject { described_class.new(target_date, days_back_start, days_back_end) }
51
+
52
+ describe '#start' do
53
+ it { expect(subject.start).to eq 731 }
54
+ end
55
+
56
+ describe '#end' do
57
+ it { expect(subject.end).to eq 367 }
58
+ end
59
+
60
+ describe '#years' do
61
+ let(:expected_years) do
62
+ ["\#{format(minusDays(@scheduledStartTime, 367), \"YYYY\")}"]
63
+ end
64
+
65
+ it { expect(subject.years).to eq expected_years }
66
+ end
67
+ end
68
+
69
+ context 'with 1095 days between start and end' do
70
+ let(:days_back_start) { 1098 }
71
+ let(:days_back_end) { 3 }
72
+ subject { described_class.new(target_date, days_back_start, days_back_end) }
73
+
74
+ describe '#start' do
75
+ it { expect(subject.start).to eq 733 }
76
+ end
77
+
78
+ describe '#end' do
79
+ it { expect(subject.end).to eq 368 }
80
+ end
81
+
82
+ describe '#years' do
83
+ let(:expected_years) do
84
+ [
85
+ "\#{format(minusDays(@scheduledStartTime, 368), \"YYYY\")}",
86
+ "\#{format(minusDays(@scheduledStartTime, 733), \"YYYY\")}"
87
+ ]
88
+ end
89
+
90
+ it { expect(subject.years).to eq expected_years }
91
+ end
92
+ end
93
+ end
@@ -0,0 +1,59 @@
1
+ # Copyright Swipely, Inc. All rights reserved.
2
+
3
+ require 'spec_helper'
4
+ require 'pipely/tasks/upload_pipeline_as_gem'
5
+
6
+ describe Pipely::Tasks::UploadPipelineAsGem do
7
+
8
+ describe "#run_task" do
9
+ subject do
10
+ described_class.new.tap do |task|
11
+ task.config = config
12
+ task.s3_steps_path = s3_steps_path
13
+ task.bucket_name = bucket_name
14
+ task.s3_gems_path = s3_gems_path
15
+ task.templates = templates
16
+ end
17
+ end
18
+ let(:config) do
19
+ { "bootstrap_mixins" => "Fixtures::BootstrapContexts::Simple" }
20
+ end
21
+ let(:gem_files) do
22
+ {
23
+ 'packaged-gem1' => '/path/to/cache/packaged-gem1.gem',
24
+ 'built-from-source-gem1' => '/path/to/cache/built-from-source-gem1.gem',
25
+ }
26
+ end
27
+ let(:bucket_name) { 'bucket-test' }
28
+ let(:s3_steps_path) { "s3/steps" }
29
+ let(:s3_gems_path) { "s3/gems" }
30
+ let(:templates) { ['spec/fixtures/templates/bootstrap.sh.erb']}
31
+
32
+ before do
33
+ allow(Rake::Task).to receive(:[]).with("upload_steps") do
34
+ double(enhance: ["deploy:upload_pipeline_as_gem"])
35
+ end
36
+
37
+ # Resolves gems for Pipeline
38
+ expect(Pipely::Bundler).to receive(:gem_files) { gem_files }
39
+
40
+ # Uploads gems to S3
41
+ expect(Pipely::Deploy::S3Uploader).to receive(:new) do
42
+ mock(
43
+ upload: gem_files.values,
44
+ s3_urls: gem_files.values
45
+ )
46
+ end
47
+
48
+ # Compiles the erb, using the configued mixin
49
+ expect(subject).to receive(:upload_to_s3).with(
50
+ "bootstrap.sh", "one\ntwo\nthree\nsimple\n")
51
+ end
52
+
53
+ it "should invoke" do
54
+ # All the magic happens in the mocks
55
+ expect(subject.run_task(true)).to eql(
56
+ ["spec/fixtures/templates/bootstrap.sh.erb"])
57
+ end
58
+ end
59
+ 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.8.3
4
+ version: 0.10.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: 2014-10-09 00:00:00.000000000 Z
11
+ date: 2014-12-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ruby-graphviz
@@ -122,6 +122,20 @@ dependencies:
122
122
  - - ">="
123
123
  - !ruby/object:Gem::Version
124
124
  version: '0'
125
+ - !ruby/object:Gem::Dependency
126
+ name: pathology
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - "~>"
130
+ - !ruby/object:Gem::Version
131
+ version: 0.1.0
132
+ type: :runtime
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - "~>"
137
+ - !ruby/object:Gem::Version
138
+ version: 0.1.0
125
139
  - !ruby/object:Gem::Dependency
126
140
  name: rspec
127
141
  requirement: !ruby/object:Gem::Requirement
@@ -240,12 +254,20 @@ files:
240
254
  - lib/pipely/deploy.rb
241
255
  - lib/pipely/deploy/bootstrap.rb
242
256
  - lib/pipely/deploy/bootstrap_context.rb
257
+ - lib/pipely/deploy/bootstrap_registry.rb
243
258
  - lib/pipely/deploy/client.rb
259
+ - lib/pipely/deploy/json_definition.rb
244
260
  - lib/pipely/deploy/s3_uploader.rb
245
261
  - lib/pipely/fog_client.rb
246
262
  - lib/pipely/graph_builder.rb
247
263
  - lib/pipely/live_pipeline.rb
248
264
  - lib/pipely/options.rb
265
+ - lib/pipely/pipeline_date_time/pipeline_date.rb
266
+ - lib/pipely/pipeline_date_time/pipeline_date_pattern.rb
267
+ - lib/pipely/pipeline_date_time/pipeline_date_range_base.rb
268
+ - lib/pipely/pipeline_date_time/pipeline_day_range.rb
269
+ - lib/pipely/pipeline_date_time/pipeline_month_range.rb
270
+ - lib/pipely/pipeline_date_time/pipeline_year_range.rb
249
271
  - lib/pipely/reference_list.rb
250
272
  - lib/pipely/runs_report.rb
251
273
  - lib/pipely/s3_writer.rb
@@ -257,8 +279,12 @@ files:
257
279
  - lib/pipely/tasks/upload_pipeline_as_gem.rb
258
280
  - lib/pipely/tasks/upload_steps.rb
259
281
  - lib/pipely/version.rb
282
+ - spec/fixtures/bootstrap_contexts/green.rb
283
+ - spec/fixtures/bootstrap_contexts/simple.rb
284
+ - spec/fixtures/templates/bootstrap.sh.erb
260
285
  - spec/fixtures/vcr_cassettes/build_and_upload_gems.yml
261
286
  - spec/lib/pipely/build/daily_scheduler_spec.rb
287
+ - spec/lib/pipely/build/environment_config_spec.rb
262
288
  - spec/lib/pipely/build/right_now_scheduler_spec.rb
263
289
  - spec/lib/pipely/build/s3_path_builder_spec.rb
264
290
  - spec/lib/pipely/build/template_spec.rb
@@ -270,11 +296,19 @@ files:
270
296
  - spec/lib/pipely/definition_spec.rb
271
297
  - spec/lib/pipely/dependency_spec.rb
272
298
  - spec/lib/pipely/deploy/bootstrap_context_spec.rb
299
+ - spec/lib/pipely/deploy/bootstrap_registry_spec.rb
273
300
  - spec/lib/pipely/deploy/bootstrap_spec.rb
274
301
  - spec/lib/pipely/deploy/client_spec.rb
275
302
  - spec/lib/pipely/deploy/s3_uploader_spec.rb
276
303
  - spec/lib/pipely/graph_builder_spec.rb
304
+ - spec/lib/pipely/pipeline_date_time/pipeline_date_pattern_spec.rb
305
+ - spec/lib/pipely/pipeline_date_time/pipeline_date_range_base_spec.rb
306
+ - spec/lib/pipely/pipeline_date_time/pipeline_date_spec.rb
307
+ - spec/lib/pipely/pipeline_date_time/pipeline_day_range_spec.rb
308
+ - spec/lib/pipely/pipeline_date_time/pipeline_month_range_spec.rb
309
+ - spec/lib/pipely/pipeline_date_time/pipeline_year_range_spec.rb
277
310
  - spec/lib/pipely/reference_list_spec.rb
311
+ - spec/lib/pipely/tasks/upload_pipeline_as_gem_spec.rb
278
312
  - spec/lib/pipely_spec.rb
279
313
  - spec/spec_helper.rb
280
314
  homepage: http://github.com/swipely/pipely
@@ -297,13 +331,17 @@ required_rubygems_version: !ruby/object:Gem::Requirement
297
331
  version: '0'
298
332
  requirements: []
299
333
  rubyforge_project:
300
- rubygems_version: 2.2.0
334
+ rubygems_version: 2.2.2
301
335
  signing_key:
302
336
  specification_version: 4
303
337
  summary: Generate dependency graphs from pipeline definitions.
304
338
  test_files:
339
+ - spec/fixtures/bootstrap_contexts/green.rb
340
+ - spec/fixtures/bootstrap_contexts/simple.rb
341
+ - spec/fixtures/templates/bootstrap.sh.erb
305
342
  - spec/fixtures/vcr_cassettes/build_and_upload_gems.yml
306
343
  - spec/lib/pipely/build/daily_scheduler_spec.rb
344
+ - spec/lib/pipely/build/environment_config_spec.rb
307
345
  - spec/lib/pipely/build/right_now_scheduler_spec.rb
308
346
  - spec/lib/pipely/build/s3_path_builder_spec.rb
309
347
  - spec/lib/pipely/build/template_spec.rb
@@ -315,10 +353,18 @@ test_files:
315
353
  - spec/lib/pipely/definition_spec.rb
316
354
  - spec/lib/pipely/dependency_spec.rb
317
355
  - spec/lib/pipely/deploy/bootstrap_context_spec.rb
356
+ - spec/lib/pipely/deploy/bootstrap_registry_spec.rb
318
357
  - spec/lib/pipely/deploy/bootstrap_spec.rb
319
358
  - spec/lib/pipely/deploy/client_spec.rb
320
359
  - spec/lib/pipely/deploy/s3_uploader_spec.rb
321
360
  - spec/lib/pipely/graph_builder_spec.rb
361
+ - spec/lib/pipely/pipeline_date_time/pipeline_date_pattern_spec.rb
362
+ - spec/lib/pipely/pipeline_date_time/pipeline_date_range_base_spec.rb
363
+ - spec/lib/pipely/pipeline_date_time/pipeline_date_spec.rb
364
+ - spec/lib/pipely/pipeline_date_time/pipeline_day_range_spec.rb
365
+ - spec/lib/pipely/pipeline_date_time/pipeline_month_range_spec.rb
366
+ - spec/lib/pipely/pipeline_date_time/pipeline_year_range_spec.rb
322
367
  - spec/lib/pipely/reference_list_spec.rb
368
+ - spec/lib/pipely/tasks/upload_pipeline_as_gem_spec.rb
323
369
  - spec/lib/pipely_spec.rb
324
370
  - spec/spec_helper.rb