cody 0.1.0 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (104) hide show
  1. checksums.yaml +4 -4
  2. data/.cody/buildspec.yml +8 -0
  3. data/.cody/project.rb +4 -0
  4. data/.cody/settings.yml +13 -0
  5. data/.gitignore +17 -10
  6. data/.gitmodules +9 -0
  7. data/.rspec +1 -1
  8. data/.ruby-version +1 -0
  9. data/CHANGELOG.md +59 -0
  10. data/Gemfile +3 -1
  11. data/Guardfile +19 -0
  12. data/LICENSE.txt +18 -17
  13. data/README.md +145 -18
  14. data/Rakefile +9 -2
  15. data/cody.gemspec +26 -12
  16. data/exe/cody +14 -0
  17. data/img/github-admin-settings-tab.png +0 -0
  18. data/lib/cody.rb +17 -1
  19. data/lib/cody/autoloader.rb +21 -0
  20. data/lib/cody/aws_services.rb +16 -0
  21. data/lib/cody/aws_services/helpers.rb +72 -0
  22. data/lib/cody/cli.rb +61 -0
  23. data/lib/cody/command.rb +82 -0
  24. data/lib/cody/completer.rb +159 -0
  25. data/lib/cody/completer/script.rb +6 -0
  26. data/lib/cody/completer/script.sh +10 -0
  27. data/lib/cody/core.rb +63 -0
  28. data/lib/cody/create.rb +12 -0
  29. data/lib/cody/default/settings.yml +3 -0
  30. data/lib/cody/delete.rb +27 -0
  31. data/lib/cody/deploy.rb +40 -0
  32. data/lib/cody/dsl/project.rb +119 -0
  33. data/lib/cody/dsl/project/ssm.rb +22 -0
  34. data/lib/cody/dsl/role.rb +50 -0
  35. data/lib/cody/dsl/schedule.rb +30 -0
  36. data/lib/cody/evaluate.rb +47 -0
  37. data/lib/cody/help.rb +9 -0
  38. data/lib/cody/help/completion.md +22 -0
  39. data/lib/cody/help/completion_script.md +3 -0
  40. data/lib/cody/help/deploy.md +32 -0
  41. data/lib/cody/help/init.md +71 -0
  42. data/lib/cody/help/start.md +12 -0
  43. data/lib/cody/init.rb +102 -0
  44. data/lib/cody/project.rb +72 -0
  45. data/lib/cody/role.rb +87 -0
  46. data/lib/cody/schedule.rb +102 -0
  47. data/lib/cody/sequence.rb +66 -0
  48. data/lib/cody/setting.rb +82 -0
  49. data/lib/cody/stack.rb +93 -0
  50. data/lib/cody/start.rb +69 -0
  51. data/lib/cody/update.rb +12 -0
  52. data/lib/cody/variables.rb +17 -0
  53. data/lib/cody/version.rb +2 -2
  54. data/lib/template/project/buildspec.yml +28 -0
  55. data/lib/template/project/project.rb.tt +29 -0
  56. data/lib/template/project/role.rb +2 -0
  57. data/lib/template/project/schedule.rb +3 -0
  58. data/lib/template/top/README.md +32 -0
  59. data/lib/template/top/settings.yml +9 -0
  60. data/lib/template/top/variables/base.rb +1 -0
  61. data/lib/template/top/variables/development.rb +1 -0
  62. data/lib/template/top/variables/production.rb +1 -0
  63. data/vendor/aws_data/CHANGELOG.md +7 -0
  64. data/vendor/aws_data/Gemfile +4 -0
  65. data/vendor/aws_data/LICENSE.txt +21 -0
  66. data/vendor/aws_data/README.md +42 -0
  67. data/vendor/aws_data/Rakefile +6 -0
  68. data/vendor/aws_data/aws_data.gemspec +30 -0
  69. data/{bin → vendor/aws_data/bin}/console +1 -1
  70. data/{bin → vendor/aws_data/bin}/setup +0 -0
  71. data/vendor/aws_data/lib/aws_data.rb +91 -0
  72. data/vendor/aws_data/lib/aws_data/version.rb +3 -0
  73. data/vendor/aws_data/spec/aws_data_spec.rb +5 -0
  74. data/vendor/aws_data/spec/spec_helper.rb +14 -0
  75. data/vendor/cfn-status/Gemfile +4 -0
  76. data/vendor/cfn-status/LICENSE.txt +21 -0
  77. data/vendor/cfn-status/README.md +56 -0
  78. data/vendor/cfn-status/Rakefile +6 -0
  79. data/vendor/cfn-status/bin/console +14 -0
  80. data/vendor/cfn-status/bin/setup +8 -0
  81. data/vendor/cfn-status/cfn-status.gemspec +30 -0
  82. data/vendor/cfn-status/lib/cfn/aws_service.rb +56 -0
  83. data/vendor/cfn-status/lib/cfn/status.rb +220 -0
  84. data/vendor/cfn-status/lib/cfn/status/version.rb +5 -0
  85. data/vendor/cfn-status/spec/cfn/status_spec.rb +81 -0
  86. data/vendor/cfn-status/spec/fixtures/cfn/stack-events-complete.json +1080 -0
  87. data/vendor/cfn-status/spec/fixtures/cfn/stack-events-in-progress.json +1080 -0
  88. data/vendor/cfn-status/spec/fixtures/cfn/stack-events-update-rollback-complete.json +1086 -0
  89. data/vendor/cfn-status/spec/spec_helper.rb +14 -0
  90. data/vendor/cfn_camelizer/CHANGELOG.md +10 -0
  91. data/vendor/cfn_camelizer/Gemfile +4 -0
  92. data/vendor/cfn_camelizer/LICENSE.txt +21 -0
  93. data/vendor/cfn_camelizer/README.md +40 -0
  94. data/vendor/cfn_camelizer/Rakefile +6 -0
  95. data/vendor/cfn_camelizer/bin/console +14 -0
  96. data/vendor/cfn_camelizer/bin/setup +8 -0
  97. data/vendor/cfn_camelizer/cfn_camelizer.gemspec +32 -0
  98. data/vendor/cfn_camelizer/lib/camelizer.yml +33 -0
  99. data/vendor/cfn_camelizer/lib/cfn_camelizer.rb +92 -0
  100. data/vendor/cfn_camelizer/lib/cfn_camelizer/version.rb +3 -0
  101. data/vendor/cfn_camelizer/spec/cfn_camelizer_spec.rb +79 -0
  102. data/vendor/cfn_camelizer/spec/spec_helper.rb +14 -0
  103. metadata +268 -21
  104. data/.travis.yml +0 -7
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 88037feb65e59c09d4a534e959f96a16356a410913f2cb0bcd973e6f684dc063
4
- data.tar.gz: 11b86d4d363b2ed593fbbd0de3ae81152507f049794b43a4b5e9fcfd2b2ca842
3
+ metadata.gz: 4026befb0df7ead4c4947e968b3cc889e367b447a87980b23016fcae680ed2d6
4
+ data.tar.gz: 6090a0d98004b6ca2c47d4b18f34c2e0de974e7e9a6055b448ab4ac19f9ed5af
5
5
  SHA512:
6
- metadata.gz: b03704888f81c48d3c6961b8c8da8f961a41d13ec91fffcdd5f2622deb3d2fb332d5eade202e0328a6ec1cae45590d7c32726573b2245e2107e33ab894023d0e
7
- data.tar.gz: d9784d3b3a9030456a135c814583430f62684b5edeb67d1cc3b4f869f81bfd8b9c98693e6aa9eb075f34be21d9b1bcc8119a9bf8dbe3c40eabff02c20d5db02f
6
+ metadata.gz: ee0b4aa46328c7e82a58cdb2ed85cf95fbd22e9092a4770b96975c9cef971977258370e864fc22d188d841532be11d2be20f43aea262df7f90bee48bd7264857
7
+ data.tar.gz: 1a275dacb13bab8c8f0e490058501275dd6fea0eda358fa3648201e982d6e5dc48a9168dd56ed7d4473ba809cde94479f17a1a216bfd323ad0153fe5b7b47370
@@ -0,0 +1,8 @@
1
+ version: 0.2
2
+
3
+ phases:
4
+ build:
5
+ commands:
6
+ - echo Build started on `date`
7
+ - bundle
8
+ - bundle exec rspec
@@ -0,0 +1,4 @@
1
+ github_url("https://github.com/tongueroo/cody")
2
+ linux_image("aws/codebuild/ruby:2.5.3-1.7.0")
3
+ triggers(webhook: true)
4
+ local_cache(false)
@@ -0,0 +1,13 @@
1
+ base:
2
+ # stack_naming:
3
+ # append_env: true # default false
4
+
5
+ development:
6
+ # cluster: development
7
+ # The aws_profile tightly binds CB_ENV to AWS_PROFILE and vice-versa.
8
+ # aws_profile: dev_profile
9
+
10
+ production:
11
+ # cluster: production
12
+ # The aws_profile tightly binds CB_ENV to AWS_PROFILE and vice-versa.
13
+ # aws_profile: prod_profile
data/.gitignore CHANGED
@@ -1,11 +1,18 @@
1
- /.bundle/
2
- /.yardoc
3
- /_yardoc/
4
- /coverage/
5
- /doc/
6
- /pkg/
7
- /spec/reports/
8
- /tmp/
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ _yardoc
7
+ coverage
8
+ doc/
9
+ InstalledFiles
10
+ lib/bundler/man
11
+ pkg
12
+ rdoc
13
+ spec/reports
14
+ test/tmp
15
+ test/version_tmp
16
+ tmp
9
17
 
10
- # rspec failure tracking
11
- .rspec_status
18
+ Gemfile.lock
@@ -0,0 +1,9 @@
1
+ [submodule "vendor/cfn-status"]
2
+ path = vendor/cfn-status
3
+ url = https://github.com/tongueroo/cfn-status
4
+ [submodule "vendor/cfn_camelizer"]
5
+ path = vendor/cfn_camelizer
6
+ url = https://github.com/tongueroo/cfn_camelizer
7
+ [submodule "vendor/aws_data"]
8
+ path = vendor/aws_data
9
+ url = https://github.com/tongueroo/aws_data
data/.rspec CHANGED
@@ -1,3 +1,3 @@
1
- --format documentation
2
1
  --color
2
+ --format documentation
3
3
  --require spec_helper
@@ -0,0 +1 @@
1
+ 2.5.6
@@ -0,0 +1,59 @@
1
+ # Change Log
2
+
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.
5
+
6
+ ## [0.7.0]
7
+ - Rename to Cody
8
+ - Breaking changes: .cody folder, CODY_ENV, -cody stack name suffix
9
+
10
+ ## [0.6.6]
11
+ - add mode option: bare and full
12
+
13
+ ## [0.6.5]
14
+ - allow no settings.yml file
15
+
16
+ ## [0.6.4]
17
+ - fix vendor gem dependencies in gem package
18
+
19
+ ## [0.6.3]
20
+ - add aws_data gem dependency
21
+
22
+ ## [0.6.2]
23
+ - add s3 read-only access to default role
24
+ - fix settings
25
+
26
+ ## [0.6.1]
27
+ - cody init: no variables by default
28
+ - fix handle rollback
29
+
30
+ ## [0.6.0]
31
+ - named stack with -cody at the very end
32
+ - add docs
33
+ - cody init --no-variables option
34
+
35
+ ## [0.5.0]
36
+ - add --wait option
37
+ - change default append_env setting to false
38
+ - fix default iam policy
39
+
40
+ ## [0.4.0]
41
+ - Add managed_iam_policy support
42
+ - #2 Add schedule dsl
43
+ - starter template fix: add settings.yml for correct cb project detection
44
+
45
+ ## [0.3.0]
46
+ - rework cb cli interface
47
+ - project_name as cli main parameter
48
+ - type option for subprojects in .cody folder
49
+ - update to zeitwerk for autoloading
50
+
51
+ ## [0.2.0]
52
+ - First good release.
53
+ - Project and Role DSL
54
+ - codebuild commands: init, deploy, start
55
+ - lookup path support
56
+ - Docs in main readme and readme folder
57
+
58
+ ## [0.1.0]
59
+ - Initial release.
data/Gemfile CHANGED
@@ -1,4 +1,6 @@
1
1
  source "https://rubygems.org"
2
2
 
3
- # Specify your gem's dependencies in cody.gemspec
3
+ # Specify your gem dependencies in codebuild.gemspec
4
4
  gemspec
5
+
6
+ gem "codeclimate-test-reporter", group: :test, require: nil
@@ -0,0 +1,19 @@
1
+ guard "bundler", cmd: "bundle" do
2
+ watch("Gemfile")
3
+ watch(/^.+\.gemspec/)
4
+ end
5
+
6
+ guard :rspec, cmd: "bundle exec rspec" do
7
+ require "guard/rspec/dsl"
8
+ dsl = Guard::RSpec::Dsl.new(self)
9
+
10
+ # RSpec files
11
+ rspec = dsl.rspec
12
+ watch(rspec.spec_helper) { rspec.spec_dir }
13
+ watch(rspec.spec_support) { rspec.spec_dir }
14
+ watch(rspec.spec_files)
15
+
16
+ # Ruby files
17
+ ruby = dsl.ruby
18
+ dsl.watch_spec_files_for(ruby.lib_files)
19
+ end
@@ -1,21 +1,22 @@
1
- The MIT License (MIT)
2
-
3
1
  Copyright (c) 2019 Tung Nguyen
4
2
 
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
11
12
 
12
- The above copyright notice and this permission notice shall be included in
13
- all copies or substantial portions of the Software.
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
14
15
 
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
- THE SOFTWARE.
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md CHANGED
@@ -1,39 +1,166 @@
1
1
  # Cody
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/cody`. To experiment with that code, run `bin/console` for an interactive prompt.
3
+ ![Build Status](https://codebuild.us-west-2.amazonaws.com/badges?uuid=eyJlbmNyeXB0ZWREYXRhIjoiWWFRbjVNQlIvZGtSS2NMTGlRY3pWYm1lTGFFSG5acDc4b09hL2lHWGVxeHZaMGYxVTc0cGEwOHBHWHF6MjZiNlZNU0JqS0lvTnZkdWI5enRDczRZYStnPSIsIml2UGFyYW1ldGVyU3BlYyI6ImsyUDJNc2E3SlpYOGFYYy8iLCJtYXRlcmlhbFNldFNlcmlhbCI6MX0%3D&branch=master)
4
+ [![Gem Version](https://badge.fury.io/rb/cody.png)](http://badge.fury.io/rb/cody)
4
5
 
5
- TODO: Delete this and the text above, and describe your gem
6
+ Cody lets you create a AWS CodeBuild projects with a beautiful DSL.
6
7
 
7
- ## Installation
8
+ The documentation site is at: [cody.run](https://cody.run/)
8
9
 
9
- Add this line to your application's Gemfile:
10
+ ## Quick Start
11
+
12
+ cody init
13
+ cody deploy
14
+ cody start
15
+
16
+ ## Private Repo
17
+
18
+ IMPORTANT: Before deploying, if you are using a private repo, use [aws codebuild import-source-credentials](https://docs.aws.amazon.com/cli/latest/reference/codebuild/import-source-credentials.html) to add credentials so that codebuild can clone down the repo. Refer to the [CodeBuilld Github Oauth/](https://cody.run/docs/github_oauth/) for more info.
19
+
20
+ ## Usage
21
+
22
+ 1. **init**: generate starter .cody files.
23
+ 2. **deploy**: deploy the CodeBuild project on AWS.
24
+ 3. **start**: kick off a CodeBuild project run.
25
+
26
+ ### Init and Structure
27
+
28
+ First, run `cody init` to generate a starter `.cody` folder structure.
29
+
30
+ $ tree .cody
31
+ .cody
32
+ ├── buildspec.yml
33
+ ├── project.rb
34
+ └── role.rb
35
+
36
+ File | Description
37
+ --- | ---
38
+ buildspec.yml | The build commands to run. Here are the [buildspec.yml syntax docs](https://docs.aws.amazon.com/codebuild/latest/userguide/build-spec-ref.html).
39
+ project.rb | The codebuild project written as a DSL. Here are the [Project DSL docs](https://cody.run/docs/dsl/project/)
40
+ role.rb | The IAM role associated with the codebuild project written as a DSL. Here are the [IAM Role DSL docs](https://cody.run/docs/dsl/role/)
41
+
42
+ ### Deploy
43
+
44
+ Adjust the files in `.cody` to fit your needs. When you're ready, deploy the CodeBuild project with:
45
+
46
+ cody deploy PROJECT_NAME
47
+
48
+ More examples:
49
+
50
+ cody deploy # infers the CodeBuild project name from the parent folder
51
+ cody deploy PROJECT_NAME # explicitly specify project name
52
+
53
+ It is useful to just see the generated CloudFormation template with `--noop` mode:
54
+
55
+ cody deploy --noop # see generated CloudFormation template
56
+
57
+ For more help:
58
+
59
+ cody deploy -h
60
+
61
+ ### Start
62
+
63
+ When you are ready to start a codebuild project run, you can use `codebuild start`. Examples:
64
+
65
+ cody start # infers the name from the parent folder
66
+ cody start PROJECT_NAME # looks up project via CodeBuild project name
67
+
68
+ The `cody start` command understands multiple identifiers. It will look up the codebuild project either via CloudFormation or the CodeBuild project name.
69
+
70
+ ## Project DSL
71
+
72
+ The tool provides a DSL to create a codebuild project. Here's an example.
73
+
74
+ .cody/project.rb:
10
75
 
11
76
  ```ruby
12
- gem 'cody'
77
+ # name("demo") # recommended to leave unset and use the conventional name that cody sets
78
+ github_url("https://github.com/tongueroo/demo-ufo")
79
+ linux_image("aws/codebuild/ruby:2.5.3-1.7.0")
80
+ environment_variables(
81
+ UFO_ENV: "development",
82
+ API_KEY: "ssm:/codebuild/demo/api_key" # ssm param example
83
+ )
13
84
  ```
14
85
 
15
- And then execute:
86
+ Here's a list of some of the convenience shorthand DSL methods:
16
87
 
17
- $ bundle
88
+ * github_url(url)
89
+ * github_source(options={})
90
+ * linux_image(name)
91
+ * linux_environment(options={})
92
+ * environment_variables(vars)
93
+ * local_cache(enable=true)
18
94
 
19
- Or install it yourself as:
95
+ Please refer to [lib/codebuild/dsl/project.rb](lib/codebuild/dsl/project.rb) for the full list.
20
96
 
21
- $ gem install cody
97
+ More slightly more control, you may be interested in the `github_source` and `linux_environment` methods. For even more control, see [DSL docs](https://cody.run/docs/dsl/).
22
98
 
23
- ## Usage
99
+ ## IAM Role DSL
24
100
 
25
- TODO: Write usage instructions here
101
+ Cody can create the IAM service role associated with the codebuild project. Here's an example:
26
102
 
27
- ## Development
103
+ .cody/role.rb:
28
104
 
29
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
105
+ ```ruby
106
+ iam_policy("logs", "ssm")
107
+ ```
30
108
 
31
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
109
+ For more control, here's a longer form:
32
110
 
33
- ## Contributing
111
+ ```ruby
112
+ iam_policy(
113
+ action: [
114
+ "logs:CreateLogGroup",
115
+ "logs:CreateLogStream",
116
+ "logs:PutLogEvents",
117
+ "ssm:*",
118
+ ],
119
+ effect: "Allow",
120
+ resource: "*"
121
+ )
122
+ ```
123
+
124
+ You can also create managed iam policy.
125
+
126
+ ```ruby
127
+ managed_iam_policy("AmazonS3ReadOnlyAccess")
128
+ ```
129
+
130
+ ## Schedule Support
131
+
132
+ .cody/schedule.rb:
133
+
134
+ ```ruby
135
+ rate "1 day"
136
+ ```
34
137
 
35
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/cody.
138
+ ## Full DSL
36
139
 
37
- ## License
140
+ The convenience DSL methods shown above are short and clean. They merely wrap a DSL that map to the properties of CloudFormation resources like [AWS::CodeBuild::Project](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-codebuild-project.html) and [AWS::IAM::Role](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-role.html). Refer the [DSL docs](https://cody.run/docs/dsl/) for more info.
141
+
142
+ ## Type Option
143
+
144
+ By default, cody looks up files in the `.cody` folder. You can affect the behavior of the Type logic with the `--Type` option. More info [Type docs](https://cody.run/docs/type-option/).
145
+
146
+ ## Installation
147
+
148
+ Add this line to your application's Gemfile:
149
+
150
+ gem "cody"
151
+
152
+ And then execute:
153
+
154
+ bundle
155
+
156
+ Or install it yourself as:
157
+
158
+ gem install cody
159
+
160
+ ## Contributing
38
161
 
39
- The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
162
+ 1. Fork it
163
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
164
+ 3. Commit your changes (`git commit -am "Add some feature"`)
165
+ 4. Push to the branch (`git push origin my-new-feature`)
166
+ 5. Create new Pull Request
data/Rakefile CHANGED
@@ -1,6 +1,13 @@
1
1
  require "bundler/gem_tasks"
2
2
  require "rspec/core/rake_task"
3
3
 
4
- RSpec::Core::RakeTask.new(:spec)
4
+ task default: :spec
5
5
 
6
- task :default => :spec
6
+ RSpec::Core::RakeTask.new
7
+
8
+ require_relative "lib/cody"
9
+ require "cli_markdown"
10
+ desc "Generates cli reference docs as markdown"
11
+ task :docs do
12
+ CliMarkdown::Creator.create_all(cli_class: Cody::CLI, cli_name: "cody")
13
+ end
@@ -1,4 +1,5 @@
1
- lib = File.expand_path("lib", __dir__)
1
+ # coding: utf-8
2
+ lib = File.expand_path("../lib", __FILE__)
2
3
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
4
  require "cody/version"
4
5
 
@@ -7,23 +8,36 @@ Gem::Specification.new do |spec|
7
8
  spec.version = Cody::VERSION
8
9
  spec.authors = ["Tung Nguyen"]
9
10
  spec.email = ["tongueroo@gmail.com"]
10
-
11
- spec.summary = %q{Cody}
11
+ spec.summary = "Cody provides a beautiful DSL to create and manage AWS CodeBuild projects"
12
12
  spec.homepage = "https://github.com/tongueroo/cody"
13
13
  spec.license = "MIT"
14
14
 
15
- spec.metadata["homepage_uri"] = spec.homepage
16
-
17
- # Specify which files should be added to the gem when it is released.
18
- # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
19
- spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
20
- `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
15
+ vendor_files = Dir.glob("vendor/**/*")
16
+ gem_files = `git -C "#{File.dirname(__FILE__)}" ls-files -z`.split("\x0").reject do |f|
17
+ f.match(%r{^(test|spec|features|docs)/})
21
18
  end
19
+ spec.files = gem_files + vendor_files
22
20
  spec.bindir = "exe"
23
21
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
22
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
24
23
  spec.require_paths = ["lib"]
25
24
 
26
- spec.add_development_dependency "bundler", "~> 2.0"
27
- spec.add_development_dependency "rake", "~> 10.0"
28
- spec.add_development_dependency "rspec", "~> 3.0"
25
+ spec.add_dependency "activesupport"
26
+ spec.add_dependency "aws-sdk-cloudformation"
27
+ spec.add_dependency "aws-sdk-codebuild"
28
+ spec.add_dependency "aws-sdk-ssm"
29
+ spec.add_dependency "memoist"
30
+ spec.add_dependency "rainbow"
31
+ spec.add_dependency "render_me_pretty"
32
+ spec.add_dependency "thor"
33
+ spec.add_dependency "zeitwerk"
34
+
35
+ # spec.add_dependency "aws_data" # using vendor/cfn_camelizer for now
36
+ # spec.add_dependency "cfn_camelizer" # using vendor/cfn_camelizer for now
37
+
38
+ spec.add_development_dependency "bundler"
39
+ spec.add_development_dependency "byebug"
40
+ spec.add_development_dependency "cli_markdown"
41
+ spec.add_development_dependency "rake"
42
+ spec.add_development_dependency "rspec"
29
43
  end