pipely 0.5.0 → 0.6.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5c3c702222fadfd21d7937f3bf45f72437cd2b60
4
- data.tar.gz: 03ec23c642d82f9b246ed9d127f8623e22e9967b
3
+ metadata.gz: f340152a018c85f0b7528a12066e818836094117
4
+ data.tar.gz: f403ae809e469fefbd919ddcc796ac4a0e6cff0e
5
5
  SHA512:
6
- metadata.gz: dcb8993c5e8957c62ceff5f0b6f3514a64ccc8760151fa19e22ecd344cb4cc187653844f88d841b2bc39081cfe4e8c72ca6e5b61cd4b665d3ba9f2016d180755
7
- data.tar.gz: ae660c6b3da224af6854a1c0d0e2c3d90b5c5a69ace85b0573bc5d050948e0eaaf32116e8078e7450e42a4359061c71cb73d468f81a6dde933686eb14128a913
6
+ metadata.gz: 0a521348af1f0f35214b78b980e65fe88f058be2ef958730d90fb8fe0326801d2f9039703ea7586281cf6210dce9f70342f06cb003ad2f379c2db6a919b53f9a
7
+ data.tar.gz: d15ae4ae65db5d61c169b7563370ebe5474b549a9d281c52f94ea8d22560ff430f115a06f04d058de146d48ffe9edf6f3e798381493c116677f87a9d8fce484b
data/README.md CHANGED
@@ -33,6 +33,9 @@ Coming soon.
33
33
  rake graph # Graphs the full pipeline definition using Graphviz
34
34
  rake upload_steps # Upload Data Pipeline steps to S3
35
35
 
36
+ In order to run these tasks, you must have an aws-sdk credentials file.
37
+ This can be created by running `aws cli configure`, as described [in the aws-sdk docs](http://docs.aws.amazon.com/AWSSdkDocsRuby/latest/DeveloperGuide/ruby-dg-setup.html#set-up-creds).
38
+
36
39
  ### Command-line Interface
37
40
 
38
41
  (If you used the Gemfile install, prefix the below commands with `bundle exec`.)
@@ -69,4 +69,3 @@ module Pipely
69
69
  end
70
70
 
71
71
  end
72
-
@@ -1,4 +1,17 @@
1
+ # Note: We are in the process of migrating from Fog to aws-sdk for communicating
2
+ # with the Data Pipeline API. aws-sdk offers several benefits, such as:
3
+ #
4
+ # * Built-in automated exponential back-off, to avoid hitting rate limits.
5
+ # * Working pagination of ListPipelines responses.
6
+ # * Authentication using IAM resource roles.
7
+ # * Faster installation.
8
+ #
9
+ # On the downside, aws-sdk does not yet support tagging of pipelines. We can
10
+ # not yet port pipely entirely away from Fog until this is resolved, so we will
11
+ # temporarily require both libraries.
12
+
1
13
  require 'fog'
14
+ require 'aws-sdk'
2
15
  require 'logger'
3
16
  require 'tempfile'
4
17
  require 'uuidtools'
@@ -16,6 +29,7 @@ module Pipely
16
29
  def initialize(log=nil)
17
30
  @log = log || Logger.new(STDOUT)
18
31
  @data_pipelines = Fog::AWS::DataPipeline.new
32
+ @aws = AWS::DataPipeline.new.client
19
33
  end
20
34
 
21
35
  def deploy_pipeline(pipeline_basename, definition)
@@ -51,15 +65,17 @@ module Pipely
51
65
 
52
66
  def existing_pipelines(pipeline_name)
53
67
  ids = []
68
+ marker = nil
54
69
 
55
70
  begin
56
- result = Fog::AWS[:data_pipeline].list_pipelines
71
+ options = marker ? { marker: marker } : {}
72
+ result = @aws.list_pipelines(options)
57
73
 
58
- ids += result['pipelineIdList'].
59
- select { |p| p['name'] == pipeline_name }.
60
- map { |p| p['id'] }
74
+ ids += result[:pipeline_id_list].
75
+ select { |p| p[:name] == pipeline_name }.
76
+ map { |p| p[:id] }
61
77
 
62
- end while (result['hasMoreResults'] && result['marker'])
78
+ end while (result[:has_more_results] && marker = result[:marker])
63
79
 
64
80
  ids
65
81
  end
@@ -1,6 +1,8 @@
1
1
  require 'rake'
2
2
  require 'rake/tasklib'
3
3
  require 'pipely'
4
+ require 'json'
5
+ require 'fileutils'
4
6
 
5
7
  module Pipely
6
8
  module Tasks
@@ -55,8 +57,14 @@ module Pipely
55
57
  def run_task(verbose)
56
58
  puts "Generating #{target_filename}" if verbose
57
59
 
60
+ json = definition.to_json
61
+
62
+ unless ENV['UGLY']
63
+ json = JSON.pretty_generate(JSON.parse(json))
64
+ end
65
+
58
66
  File.open(target_filename, 'w') do |file|
59
- file.write(definition.to_json)
67
+ file.write(json)
60
68
  end
61
69
  end
62
70
 
@@ -1,3 +1,3 @@
1
1
  module Pipely
2
- VERSION = "0.5.0" unless defined?(::Pipely::VERSION)
2
+ VERSION = "0.6.0" unless defined?(::Pipely::VERSION)
3
3
  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.5.0
4
+ version: 0.6.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-07-17 00:00:00.000000000 Z
11
+ date: 2014-07-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ruby-graphviz
@@ -66,6 +66,20 @@ dependencies:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: 1.23.0
69
+ - !ruby/object:Gem::Dependency
70
+ name: aws-sdk
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '1.48'
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '1.48'
69
83
  - !ruby/object:Gem::Dependency
70
84
  name: unf
71
85
  requirement: !ruby/object:Gem::Requirement