Class: Stax::Aws::Codepipeline
Class Method Summary collapse
- .client ⇒ Object
- .execution(name, id) ⇒ Object
- .executions(name, num = nil) ⇒ Object
- .stages(name) ⇒ Object
- .start(name) ⇒ Object
- .state(name) ⇒ Object
Methods inherited from Sdk
Class Method Details
.client ⇒ Object
7 8 9 |
# File 'lib/stax/aws/codepipeline.rb', line 7 def client @_client ||= ::Aws::CodePipeline::Client.new end |
.execution(name, id) ⇒ Object
28 29 30 |
# File 'lib/stax/aws/codepipeline.rb', line 28 def execution(name, id) client.get_pipeline_execution(pipeline_name: name, pipeline_execution_id: id).pipeline_execution end |
.executions(name, num = nil) ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/stax/aws/codepipeline.rb', line 15 def executions(name, num = nil) opt = {pipeline_name: name, max_results: num} token = nil summaries = [] loop do s = client.list_pipeline_executions(opt.merge(next_token: token)) summaries += s.pipeline_execution_summaries break if (token = s.next_token).nil? break if summaries.count >= num end summaries.first(num) end |
.stages(name) ⇒ Object
11 12 13 |
# File 'lib/stax/aws/codepipeline.rb', line 11 def stages(name) client.get_pipeline(name: name).pipeline.stages end |
.start(name) ⇒ Object
36 37 38 |
# File 'lib/stax/aws/codepipeline.rb', line 36 def start(name) client.start_pipeline_execution(name: name).pipeline_execution_id end |
.state(name) ⇒ Object
32 33 34 |
# File 'lib/stax/aws/codepipeline.rb', line 32 def state(name) client.get_pipeline_state(name: name) end |