pipedream 0.4.2 → 0.4.6

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
  SHA256:
3
- metadata.gz: 67572d8d7485c6c1f0889483c4383469ca42e20e562b7649eb562dcfad18aae0
4
- data.tar.gz: 943630d8688bdf6e8279dea4365a16ff63e087825baad4fd3ca7fa6948f0923e
3
+ metadata.gz: 9d161dba2b616b8ab983bde8ddd172c5ccd32c13c9cab76f4ddf921fa9636dea
4
+ data.tar.gz: 1810aae5887e61c4506fc1b6355b6b65582adb1f0357ab25a12520f0b666ffc3
5
5
  SHA512:
6
- metadata.gz: 38073cc81fe609bcdee9375fc84b84f77ddbc894fb543dbb88717db1d898658b017c7aa4e58f8ad1d95a3989d7ef3b09520343bf55af73f7f12ca9478f540719
7
- data.tar.gz: d51302177798556778c8faef0823c2b7fba51016ed77d62153b8c07424ed9098d2ac8a4d0f4bdf6f4ca80ef234936d3468e1a12a8bf3e76968caf306b061b1a3
6
+ metadata.gz: aefb74f8043afcd93241910080741556cc7fa7ff10d413e8d224300cdb0eda9b592d1e454c8733da99d14573e177d216258555efcf256da117b0410374fb1409
7
+ data.tar.gz: 72c69e745910403a08585f0c672c26e39d0669b24280941c7f29dd0ba6bc53894d98cb32a208d46ef2c795fce1af87c0932df92c0f6af6c76637ff0c3ac40868
data/.gitignore CHANGED
@@ -14,3 +14,4 @@ spec/reports
14
14
  test/tmp
15
15
  test/version_tmp
16
16
  tmp
17
+ Gemfile.lock
data/CHANGELOG.md CHANGED
@@ -1,7 +1,22 @@
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.6] - 2021-12-29
7
+ - [#4](https://github.com/boltops-tools/pipedream/pull/4) fix activesupport require
8
+ - fix settings merge
9
+
10
+ ## [0.4.5]
11
+ - add aws codepipeline get-pipeline-state command hint in output also
12
+ - dont autocamelize code build project name
13
+ - #3 fix typo
14
+
15
+ ## [0.4.4]
16
+ - add mfa support for normal IAM user
17
+
18
+ ## [0.4.3]
19
+ - fix pipedream renaming
5
20
 
6
21
  ## [0.4.2]
7
22
  - fix project_name
data/README.md CHANGED
@@ -7,6 +7,8 @@
7
7
  ![Build Status](https://codebuild.us-west-2.amazonaws.com/badges?uuid=eyJlbmNyeXB0ZWREYXRhIjoiWk1FM0dldzE5MUM5R3VqVGxxTmRFb1JGNnkxQjJpTDYvajYrQk91YzErNjdNc1VYVElHM3V5ZEJXcStyMmZVc210WG8vUURSV2JST0ZpSWc5Y0pYR3k0PSIsIml2UGFyYW1ldGVyU3BlYyI6IldvYXhLMU8yS2pQdVRKbEoiLCJtYXRlcmlhbFNldFNlcmlhbCI6MX0%3D&branch=master)
8
8
  [![Gem Version](https://badge.fury.io/rb/pipedream.png)](http://badge.fury.io/rb/pipedream)
9
9
 
10
+ [![BoltOps Badge](https://img.boltops.com/boltops/badges/boltops-badge.png)](https://www.boltops.com)
11
+
10
12
  Pipe Dream provides a DSL to make it easy create a CodePipeline pipeline.
11
13
 
12
14
  Pipe Dream installs `pipedream` and `pipe` executables. Both of them do the same thing, `pipe` is just shorter to type.
@@ -32,7 +34,7 @@ First, run `pipe init` to generate a starter `.pipedream` folder structure.
32
34
  File | Description
33
35
  --- | ---
34
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/)
35
- 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/)
36
38
 
37
39
  ## DSL
38
40
 
@@ -44,7 +44,8 @@ module Pipedream::AwsServices
44
44
  #
45
45
  def inferred_stack_name(pipeline_name)
46
46
  items = [pipeline_name, @options[:type], Pipedream.env_extra, "pipe"]
47
- items.insert(2, Pipedream.env) if Pipedream.settings.dig(:stack_naming, :append_env)
47
+ append_env = Pipedream.settings.dig(:stack_naming, :append_env)
48
+ items.insert(2, Pipedream.env) if append_env
48
49
  items.reject(&:blank?).compact.join("-")
49
50
  end
50
51
 
@@ -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,17 +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
20
+ name = item
21
21
  default.deep_merge(
22
22
  name: name,
23
- configuration: { project_name: name },
23
+ configuration: { project_name: item },
24
24
  )
25
25
  else # Hash
26
- # With the hash, the user needs to set: name and configuration.project_name
27
-
28
- # Handy shorthands
29
- # The project name will allow this syntax
26
+ # With the hash notation, user needs to set: name and project_name
27
+ #
30
28
  # codebuild(name: "action-name", project_name: "codebuild-project-names")
29
+ #
31
30
  project_name = item.delete(:project_name)
32
31
  if project_name
33
32
  item[:configuration] = { project_name: project_name }
@@ -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
@@ -25,7 +25,11 @@ module Pipedream
25
25
 
26
26
  all_envs = default.deep_merge(user.deep_merge(project))
27
27
  all_envs = merge_base(all_envs)
28
- data = all_envs[pipe_env] || all_envs["base"] || {}
28
+
29
+ env_data = all_envs[pipe_env] || {}
30
+ base_data = all_envs["base"] || {}
31
+ data = base_data.merge(env_data)
32
+
29
33
  data.deep_symbolize_keys
30
34
  end
31
35
  memoize :data
@@ -76,7 +80,7 @@ module Pipedream
76
80
  end
77
81
 
78
82
  def cb_root
79
- ENV["CODEPIPELINE_ROOT"] || Dir.pwd
83
+ ENV["PIPE_ROOT"] || Dir.pwd
80
84
  end
81
85
  end
82
86
  end
data/lib/pipedream/sns.rb CHANGED
@@ -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.2"
2
+ VERSION = "0.4.6"
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
data/lib/pipedream.rb CHANGED
@@ -2,6 +2,7 @@ $:.unshift(File.expand_path("../", __FILE__))
2
2
  require "pipedream/version"
3
3
  require "rainbow/ext/string"
4
4
  require "memoist"
5
+ require "active_support"
5
6
  require "active_support/core_ext/hash"
6
7
 
7
8
  require "pipedream/autoloader"
@@ -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
  #
data/pipedream.gemspec CHANGED
@@ -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.2
4
+ version: 0.4.6
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: 2021-12-29 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
@@ -366,7 +379,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
366
379
  - !ruby/object:Gem::Version
367
380
  version: '0'
368
381
  requirements: []
369
- rubygems_version: 3.0.6
382
+ rubygems_version: 3.2.32
370
383
  signing_key:
371
384
  specification_version: 4
372
385
  summary: A beautiful and powerful DSL to create and manage AWS CodePipeline pipelines
data/Gemfile.lock DELETED
@@ -1,112 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- pipedream (0.4.1)
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