pipedream 0.4.0 → 0.4.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b5b217e3b797c3eac2f721a6637b1997e218222a6d316417c620e05145c1bfe6
4
- data.tar.gz: '094476da993744df62614378996cc12481c911f6e39dc8a89a1baeee4030475d'
3
+ metadata.gz: 3d9e2922f9c6667d76a0d7028ae49000536ab914662417e72d0f0fdf6cc7aea5
4
+ data.tar.gz: 3e75a59671e7168f7d747f4a46db94f9f6756a0f0a925bd1ad1607ef8be3f733
5
5
  SHA512:
6
- metadata.gz: 55404fd9abf77988a759c6b8d51a0b9dd64299ec12a03cda6836900b7cba5c11937fcd359bbeb14dd335b7fe4b30b77dfed9cd471669f5c7d376eb8e1f4055c5
7
- data.tar.gz: f40b5c333e86b9b662f7863ef803dddd6737c7896931930305ebe638eff0643666737ff4f0001acf3d69f481cd0ac949be6df05f312dc884a621066d1057c653
6
+ metadata.gz: 28c61cb0f1dd55003854b179ffd26a153650b47558ac505e06c703624f453e3ee4bfb06ad40f4e5f0955245db3e37cb29430dd191ad416878c8fe40328077c06
7
+ data.tar.gz: fe15a95759be6b95748850ddc95f49b330303585f60c847f5d50cd6398133a482e0d75d9293b5d098e7f78a1f45b2d02eecaffc92cd2eab4662d4ed2df6e0e5c
data/.gitignore CHANGED
@@ -14,3 +14,4 @@ spec/reports
14
14
  test/tmp
15
15
  test/version_tmp
16
16
  tmp
17
+ Gemfile.lock
@@ -1,7 +1,24 @@
1
1
  # Change Log
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
- This project *tries* to adhere to [Semantic Versioning](http://semver.org/), even before v1.0.
4
+ This project *loosely* adheres to [Semantic Versioning](http://semver.org/), even before v1.0.
5
+
6
+ ## [0.4.5]
7
+ - add aws codepipeline get-pipeline-state command hint in output also
8
+ - dont autocamelize code build project name
9
+ - #3 fix typo
10
+
11
+ ## [0.4.4]
12
+ - add mfa support for normal IAM user
13
+
14
+ ## [0.4.3]
15
+ - fix pipedream renaming
16
+
17
+ ## [0.4.2]
18
+ - fix project_name
19
+
20
+ ## [0.4.1]
21
+ - remove codebuild_prefix and codebuild_suffix helpers
5
22
 
6
23
  ## [0.4.0]
7
24
  - rename to pipedream
data/README.md CHANGED
@@ -1,8 +1,14 @@
1
- # Pipedreamline
1
+ <div align="center">
2
+ <a href="http://pipedream.run"><img src="https://raw.githubusercontent.com/tongueroo/pipedream/master/docs/img/logos/pipedream-with-text.png" /></a>
3
+ </div>
4
+
5
+ # Pipe Dream
2
6
 
3
7
  ![Build Status](https://codebuild.us-west-2.amazonaws.com/badges?uuid=eyJlbmNyeXB0ZWREYXRhIjoiWk1FM0dldzE5MUM5R3VqVGxxTmRFb1JGNnkxQjJpTDYvajYrQk91YzErNjdNc1VYVElHM3V5ZEJXcStyMmZVc210WG8vUURSV2JST0ZpSWc5Y0pYR3k0PSIsIml2UGFyYW1ldGVyU3BlYyI6IldvYXhLMU8yS2pQdVRKbEoiLCJtYXRlcmlhbFNldFNlcmlhbCI6MX0%3D&branch=master)
4
8
  [![Gem Version](https://badge.fury.io/rb/pipedream.png)](http://badge.fury.io/rb/pipedream)
5
9
 
10
+ [![BoltOps Badge](https://img.boltops.com/boltops/badges/boltops-badge.png)](https://www.boltops.com)
11
+
6
12
  Pipe Dream provides a DSL to make it easy create a CodePipeline pipeline.
7
13
 
8
14
  Pipe Dream installs `pipedream` and `pipe` executables. Both of them do the same thing, `pipe` is just shorter to type.
@@ -28,7 +34,7 @@ First, run `pipe init` to generate a starter `.pipedream` folder structure.
28
34
  File | Description
29
35
  --- | ---
30
36
  pipeline.rb | The CodePipeline pipeline written as a DSL. This is required. Here are the [Pipeline DSL docs](https://pipedream.run/docs/dsl/pipeline/)
31
- schedule.rb | A CloudWatch scheduled event written as a DSL. Here are the [schedule.rb docs](https://pipedream.run/docs/dsl/schedule/)
37
+ schedule.rb | A CloudWatch scheduled event written as a DSL. Here are the [Schedule DSL docs](https://pipedream.run/docs/dsl/schedule/)
32
38
 
33
39
  ## DSL
34
40
 
@@ -1,6 +1,8 @@
1
1
  require "aws-sdk-codepipeline"
2
2
  require "aws-sdk-cloudformation"
3
3
 
4
+ require "aws_mfa_secure/ext/aws" # add MFA support
5
+
4
6
  module Pipedream
5
7
  module AwsServices
6
8
  include Helpers
@@ -45,12 +45,12 @@ module Pipedream
45
45
  end
46
46
  memoize :settings
47
47
 
48
- def check_codepipeline_project!
48
+ def check_pipedream_project!
49
49
  check_path = "#{Pipedream.root}/.pipedream"
50
50
  unless File.exist?(check_path)
51
- puts "ERROR: No .pipedream folder found. Are you sure you are in a project with codepipeline setup?".color(:red)
51
+ puts "ERROR: No .pipedream folder found. Are you sure you are in a project with pipedream setup?".color(:red)
52
52
  puts "Current directory: #{Dir.pwd}"
53
- puts "If you want to set up codepipeline for this prjoect, please create a settings file via: codepipeline init"
53
+ puts "If you want to set up pipedream for this prjoect, please create a settings file via: pipe init"
54
54
  exit 1 unless ENV['TEST']
55
55
  end
56
56
  end
@@ -17,18 +17,16 @@ module Pipedream::Dsl::Pipeline
17
17
 
18
18
  actions = projects.map do |item|
19
19
  if item.is_a?(String)
20
- name = item.underscore.camelize
21
- project_name = adjusted_project_name(item) # add prefix and suffix
20
+ name = item
22
21
  default.deep_merge(
23
22
  name: name,
24
- configuration: { project_name: project_name },
23
+ configuration: { project_name: item },
25
24
  )
26
25
  else # Hash
27
- # With the hash, the user needs to set: name and configuration.project_name
28
-
29
- # Handy shorthands
30
- # The project name will allow this syntax
26
+ # With the hash notation, user needs to set: name and project_name
27
+ #
31
28
  # codebuild(name: "action-name", project_name: "codebuild-project-names")
29
+ #
32
30
  project_name = item.delete(:project_name)
33
31
  if project_name
34
32
  item[:configuration] = { project_name: project_name }
@@ -40,18 +38,5 @@ module Pipedream::Dsl::Pipeline
40
38
 
41
39
  action(*actions)
42
40
  end
43
-
44
- def codebuild_prefix(v)
45
- @codebuild_prefix = v
46
- end
47
-
48
- def codebuild_suffix(v)
49
- @codebuild_suffix = v
50
- end
51
-
52
- private
53
- def adjusted_project_name(name)
54
- [@codebuild_prefix, name, @codebuild_suffix].compact.join
55
- end
56
41
  end
57
42
  end
@@ -40,7 +40,7 @@ module Pipedream
40
40
  end
41
41
  end
42
42
 
43
- def lookup_codepipeline_file(name)
43
+ def lookup_pipedream_file(name)
44
44
  [".pipedream", @options[:type], name].compact.join("/")
45
45
  end
46
46
  end
@@ -32,7 +32,7 @@ module Pipedream
32
32
  end
33
33
 
34
34
  def copy_project
35
- puts "Initialize codepipeline project in .pipedream"
35
+ puts "Initialize pipedream project in .pipedream"
36
36
 
37
37
  excludes = %w[.git]
38
38
  if @options[:mode] == "light"
@@ -55,7 +55,7 @@ module Pipedream
55
55
 
56
56
  private
57
57
  def get_pipeline_path
58
- lookup_codepipeline_file "pipeline.rb"
58
+ lookup_pipedream_file "pipeline.rb"
59
59
  end
60
60
  end
61
61
  end
@@ -38,7 +38,7 @@ module Pipedream
38
38
 
39
39
  private
40
40
  def get_role_path
41
- lookup_codepipeline_file("role.rb")
41
+ lookup_pipedream_file("role.rb")
42
42
  end
43
43
 
44
44
  def default_properties
@@ -61,7 +61,7 @@ module Pipedream
61
61
 
62
62
  private
63
63
  def get_schedule_path
64
- lookup_codepipeline_file("schedule.rb")
64
+ lookup_pipedream_file("schedule.rb")
65
65
  end
66
66
 
67
67
  def events_rule_role
@@ -4,14 +4,14 @@ require 'render_me_pretty'
4
4
  module Pipedream
5
5
  class Setting
6
6
  extend Memoist
7
- def initialize(check_codepipeline_project=true)
8
- @check_codepipeline_project = check_codepipeline_project
7
+ def initialize(check_pipedream_project=true)
8
+ @check_pipedream_project = check_pipedream_project
9
9
  end
10
10
 
11
11
  # data contains the settings.yml config. The order or precedence for settings
12
12
  # is the project ufo/settings.yml and then the ~/.pipedream/settings.yml.
13
13
  def data
14
- Pipedream.check_codepipeline_project! if @check_codepipeline_project
14
+ Pipedream.check_pipedream_project! if @check_pipedream_project
15
15
  return {} unless File.exist?(project_settings_path)
16
16
 
17
17
  # project based settings files
@@ -37,7 +37,7 @@ module Pipedream
37
37
 
38
38
  private
39
39
  def get_sns_path
40
- lookup_codepipeline_file("sns.rb")
40
+ lookup_pipedream_file("sns.rb")
41
41
  end
42
42
  end
43
43
  end
@@ -54,9 +54,9 @@ module Pipedream
54
54
  resource = resp.stack_resources.find do |r|
55
55
  r.logical_resource_id == "CodePipeline"
56
56
  end
57
- resource.physical_resource_id # codepipeline project name
57
+ resource.physical_resource_id # pipeline name
58
58
  else
59
- puts "ERROR: Unable to find the codepipeline project with either full_pipeline_name: #{@full_pipeline_name} or stack name: #{@stack_name}".color(:red)
59
+ puts "ERROR: Unable to find the pipeline with either full_pipeline_name: #{@full_pipeline_name} or stack name: #{@stack_name}".color(:red)
60
60
  exit 1
61
61
  end
62
62
  end
@@ -66,12 +66,15 @@ module Pipedream
66
66
  def codepipeline_info(execution_id)
67
67
  region = `aws configure get region`.strip rescue "us-east-1"
68
68
  url = "https://#{region}.console.aws.amazon.com/codesuite/codepipeline/pipelines/#{pipeline_name}/view"
69
- cli = "aws codepipeline get-pipeline-execution --pipeline-execution-id #{execution_id} --pipeline-name #{pipeline_name}"
70
69
 
71
70
  puts "Pipeline started: #{pipeline_name}"
72
71
  puts "Please check the CodePipeline console for the status."
73
72
  puts "CodePipeline Console: #{url}"
74
- puts "Pipeline cli: #{cli}"
73
+ puts "Pipeline cli commands:"
74
+ puts
75
+ puts " aws codepipeline get-pipeline-execution --pipeline-execution-id #{execution_id} --pipeline-name #{pipeline_name}"
76
+ puts " aws codepipeline get-pipeline-state --name #{pipeline_name}"
77
+ puts
75
78
  end
76
79
 
77
80
  def pipeline_exists?(name)
@@ -1,3 +1,3 @@
1
1
  module Pipedream
2
- VERSION = "0.4.0"
2
+ VERSION = "0.4.5"
3
3
  end
@@ -54,7 +54,7 @@ module Pipedream
54
54
  private
55
55
 
56
56
  def get_webhook_path
57
- lookup_codepipeline_file("webhook.rb")
57
+ lookup_pipedream_file("webhook.rb")
58
58
  end
59
59
  end
60
60
  end
@@ -0,0 +1,25 @@
1
+ # Pipedream Files
2
+
3
+ The files in folder are used by pipedream to build AWS CodePipeline pipelines. For more info, check out the [pipedream docs](https://pipedream.run). Here's a quick start.
4
+
5
+ ## Install Tool
6
+
7
+ gem install pipedream
8
+
9
+ This installs both the `pipe` and `pipedream` commands. They do the same thing, the `pipe` command is just shorter to type.
10
+
11
+ ## Update Project
12
+
13
+ To update the CodePipeline pipelines:
14
+
15
+ pipedream deploy demo
16
+
17
+ ## Start a Execution
18
+
19
+ To start a CodePipeline execution:
20
+
21
+ pipedream start demo
22
+
23
+ To specify a branch:
24
+
25
+ pipedream start demo -b feature
@@ -6,7 +6,7 @@ stage "Source" do
6
6
  )
7
7
  end
8
8
 
9
- # IMPORANT: A valid pipeline requires at least 2 stages befre you are able to run
9
+ # IMPORANT: A valid pipeline requires at least 2 stages before you are able to run
10
10
  #
11
11
  # pipe deploy
12
12
  #
@@ -23,6 +23,7 @@ Gem::Specification.new do |spec|
23
23
  spec.require_paths = ["lib"]
24
24
 
25
25
  spec.add_dependency "activesupport"
26
+ spec.add_dependency "aws-mfa-secure"
26
27
  spec.add_dependency "aws-sdk-cloudformation"
27
28
  spec.add_dependency "aws-sdk-codepipeline"
28
29
  spec.add_dependency "aws-sdk-s3"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pipedream
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tung Nguyen
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-10-02 00:00:00.000000000 Z
11
+ date: 2020-06-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -24,6 +24,20 @@ dependencies:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: aws-mfa-secure
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: aws-sdk-cloudformation
29
43
  requirement: !ruby/object:Gem::Requirement
@@ -250,7 +264,6 @@ files:
250
264
  - ".rspec"
251
265
  - CHANGELOG.md
252
266
  - Gemfile
253
- - Gemfile.lock
254
267
  - Guardfile
255
268
  - LICENSE.txt
256
269
  - README.md
@@ -299,6 +312,7 @@ files:
299
312
  - lib/pipedream/update.rb
300
313
  - lib/pipedream/version.rb
301
314
  - lib/pipedream/webhook.rb
315
+ - lib/template/.pipedream/README.md
302
316
  - lib/template/.pipedream/pipeline.rb.tt
303
317
  - lib/template/.pipedream/schedule.rb
304
318
  - lib/template/.pipedream/settings.yml
@@ -365,7 +379,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
365
379
  - !ruby/object:Gem::Version
366
380
  version: '0'
367
381
  requirements: []
368
- rubygems_version: 3.0.6
382
+ rubygems_version: 3.1.2
369
383
  signing_key:
370
384
  specification_version: 4
371
385
  summary: A beautiful and powerful DSL to create and manage AWS CodePipeline pipelines
@@ -1,112 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- pipedream (0.3.3)
5
- activesupport
6
- aws-sdk-cloudformation
7
- aws-sdk-codepipeline
8
- aws-sdk-s3
9
- aws-sdk-ssm
10
- cfn_camelizer
11
- memoist
12
- rainbow
13
- render_me_pretty
14
- thor
15
- zeitwerk
16
-
17
- GEM
18
- remote: https://rubygems.org/
19
- specs:
20
- activesupport (6.0.0)
21
- concurrent-ruby (~> 1.0, >= 1.0.2)
22
- i18n (>= 0.7, < 2)
23
- minitest (~> 5.1)
24
- tzinfo (~> 1.1)
25
- zeitwerk (~> 2.1, >= 2.1.8)
26
- aws-eventstream (1.0.3)
27
- aws-partitions (1.220.0)
28
- aws-sdk-cloudformation (1.25.0)
29
- aws-sdk-core (~> 3, >= 3.61.1)
30
- aws-sigv4 (~> 1.1)
31
- aws-sdk-codepipeline (1.25.0)
32
- aws-sdk-core (~> 3, >= 3.61.1)
33
- aws-sigv4 (~> 1.1)
34
- aws-sdk-core (3.68.0)
35
- aws-eventstream (~> 1.0, >= 1.0.2)
36
- aws-partitions (~> 1.0)
37
- aws-sigv4 (~> 1.1)
38
- jmespath (~> 1.0)
39
- aws-sdk-kms (1.24.0)
40
- aws-sdk-core (~> 3, >= 3.61.1)
41
- aws-sigv4 (~> 1.1)
42
- aws-sdk-s3 (1.48.0)
43
- aws-sdk-core (~> 3, >= 3.61.1)
44
- aws-sdk-kms (~> 1)
45
- aws-sigv4 (~> 1.1)
46
- aws-sdk-ssm (1.56.0)
47
- aws-sdk-core (~> 3, >= 3.61.1)
48
- aws-sigv4 (~> 1.1)
49
- aws-sigv4 (1.1.0)
50
- aws-eventstream (~> 1.0, >= 1.0.2)
51
- byebug (11.0.1)
52
- cfn_camelizer (0.4.0)
53
- activesupport
54
- memoist
55
- rainbow
56
- cli_markdown (0.1.0)
57
- codeclimate-test-reporter (1.0.9)
58
- simplecov (<= 0.13)
59
- concurrent-ruby (1.1.5)
60
- diff-lcs (1.3)
61
- docile (1.1.5)
62
- i18n (1.6.0)
63
- concurrent-ruby (~> 1.0)
64
- jmespath (1.4.0)
65
- json (2.2.0)
66
- memoist (0.16.0)
67
- minitest (5.12.2)
68
- rainbow (3.0.0)
69
- rake (13.0.0)
70
- render_me_pretty (0.8.3)
71
- activesupport
72
- rainbow
73
- tilt
74
- rspec (3.8.0)
75
- rspec-core (~> 3.8.0)
76
- rspec-expectations (~> 3.8.0)
77
- rspec-mocks (~> 3.8.0)
78
- rspec-core (3.8.2)
79
- rspec-support (~> 3.8.0)
80
- rspec-expectations (3.8.4)
81
- diff-lcs (>= 1.2.0, < 2.0)
82
- rspec-support (~> 3.8.0)
83
- rspec-mocks (3.8.1)
84
- diff-lcs (>= 1.2.0, < 2.0)
85
- rspec-support (~> 3.8.0)
86
- rspec-support (3.8.2)
87
- simplecov (0.13.0)
88
- docile (~> 1.1.0)
89
- json (>= 1.8, < 3)
90
- simplecov-html (~> 0.10.0)
91
- simplecov-html (0.10.2)
92
- thor (0.20.3)
93
- thread_safe (0.3.6)
94
- tilt (2.0.10)
95
- tzinfo (1.2.5)
96
- thread_safe (~> 0.1)
97
- zeitwerk (2.1.10)
98
-
99
- PLATFORMS
100
- ruby
101
-
102
- DEPENDENCIES
103
- bundler
104
- byebug
105
- cli_markdown
106
- codeclimate-test-reporter
107
- pipedream!
108
- rake
109
- rspec
110
-
111
- BUNDLED WITH
112
- 2.0.2