codepipeline 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (220) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +16 -11
  3. data/.gitmodules +9 -0
  4. data/.rspec +1 -1
  5. data/CHANGELOG.md +16 -0
  6. data/Gemfile +3 -1
  7. data/Gemfile.lock +111 -0
  8. data/Guardfile +19 -0
  9. data/LICENSE.txt +18 -17
  10. data/README.md +44 -20
  11. data/Rakefile +10 -2
  12. data/codepipe.gemspec +38 -0
  13. data/docs/.gitignore +4 -0
  14. data/docs/CNAME +1 -0
  15. data/docs/Gemfile +3 -0
  16. data/docs/LICENSE +21 -0
  17. data/docs/README.md +25 -0
  18. data/docs/_config.yml +73 -0
  19. data/docs/_docs/contributing.md +99 -0
  20. data/docs/_docs/conventions.md +43 -0
  21. data/docs/_docs/deploy.md +72 -0
  22. data/docs/_docs/dsl.md +13 -0
  23. data/docs/_docs/dsl/approve.md +62 -0
  24. data/docs/_docs/dsl/pipeline.md +56 -0
  25. data/docs/_docs/dsl/pipeline/action.md +28 -0
  26. data/docs/_docs/dsl/pipeline/codebuild.md +62 -0
  27. data/docs/_docs/dsl/pipeline/prefix-and-suffix.md +57 -0
  28. data/docs/_docs/dsl/role.md +79 -0
  29. data/docs/_docs/dsl/schedule.md +29 -0
  30. data/docs/_docs/dsl/sns.md +27 -0
  31. data/docs/_docs/dsl/webhook.md +31 -0
  32. data/docs/_docs/ecs-deploy.md +24 -0
  33. data/docs/_docs/examples/different-branches.md +50 -0
  34. data/docs/_docs/install.md +14 -0
  35. data/docs/_docs/next-steps.md +16 -0
  36. data/docs/_docs/settings.md +34 -0
  37. data/docs/_docs/start.md +31 -0
  38. data/docs/_includes/commands.html +92 -0
  39. data/docs/_includes/content.html +25 -0
  40. data/docs/_includes/edit-on-github.html +9 -0
  41. data/docs/_includes/footer.html +41 -0
  42. data/docs/_includes/google_analytics.html +10 -0
  43. data/docs/_includes/head.html +45 -0
  44. data/docs/_includes/js.html +15 -0
  45. data/docs/_includes/nav.html +17 -0
  46. data/docs/_includes/prev_next.md +19 -0
  47. data/docs/_includes/reference.md +1 -0
  48. data/docs/_includes/subnav.html +46 -0
  49. data/docs/_includes/tutorials.md +38 -0
  50. data/docs/_layouts/default.html +12 -0
  51. data/docs/_reference/pipe-completion.md +44 -0
  52. data/docs/_reference/pipe-completion_script.md +25 -0
  53. data/docs/_reference/pipe-delete.md +25 -0
  54. data/docs/_reference/pipe-deploy.md +26 -0
  55. data/docs/_reference/pipe-init.md +25 -0
  56. data/docs/_reference/pipe-start.md +25 -0
  57. data/docs/_reference/pipe-version.md +21 -0
  58. data/docs/_sass/_bootstrap-overrides.scss +40 -0
  59. data/docs/_sass/_contact.scss +49 -0
  60. data/docs/_sass/_cta.scss +37 -0
  61. data/docs/_sass/_download.scss +31 -0
  62. data/docs/_sass/_features.scss +47 -0
  63. data/docs/_sass/_footer.scss +49 -0
  64. data/docs/_sass/_global.scss +102 -0
  65. data/docs/_sass/_main.scss +364 -0
  66. data/docs/_sass/_masthead.scss +70 -0
  67. data/docs/_sass/_mixins.scss +79 -0
  68. data/docs/_sass/_navbar.scss +92 -0
  69. data/docs/_sass/_syntax.scss +65 -0
  70. data/docs/_sass/_table.scss +34 -0
  71. data/docs/_sass/_timeline.scss +207 -0
  72. data/docs/_sass/_variables.scss +24 -0
  73. data/docs/bin/web +8 -0
  74. data/docs/docs.md +24 -0
  75. data/docs/dsl/pipeline.md +76 -0
  76. data/docs/dsl/role.md +66 -0
  77. data/docs/dsl/schedule.md +20 -0
  78. data/docs/img/docs/codepipeline-output.png +0 -0
  79. data/docs/img/logos/boltops-logo-full.png +0 -0
  80. data/docs/img/logos/boltops-logo.png +0 -0
  81. data/docs/img/logos/project-logo.png +0 -0
  82. data/docs/index.html +35 -0
  83. data/docs/js/nav.js +39 -0
  84. data/docs/js/new-age.js +38 -0
  85. data/docs/js/new-age.min.js +6 -0
  86. data/docs/new-age.scss +20 -0
  87. data/docs/quick-start.md +73 -0
  88. data/docs/reference.md +12 -0
  89. data/docs/support.md +22 -0
  90. data/docs/vendor/bootstrap/css/bootstrap-grid.css +1339 -0
  91. data/docs/vendor/bootstrap/css/bootstrap-grid.css.map +1 -0
  92. data/docs/vendor/bootstrap/css/bootstrap-grid.min.css +1 -0
  93. data/docs/vendor/bootstrap/css/bootstrap-grid.min.css.map +1 -0
  94. data/docs/vendor/bootstrap/css/bootstrap-reboot.css +459 -0
  95. data/docs/vendor/bootstrap/css/bootstrap-reboot.css.map +1 -0
  96. data/docs/vendor/bootstrap/css/bootstrap-reboot.min.css +1 -0
  97. data/docs/vendor/bootstrap/css/bootstrap-reboot.min.css.map +1 -0
  98. data/docs/vendor/bootstrap/css/bootstrap.css +9320 -0
  99. data/docs/vendor/bootstrap/css/bootstrap.css.map +1 -0
  100. data/docs/vendor/bootstrap/css/bootstrap.min.css +6 -0
  101. data/docs/vendor/bootstrap/css/bootstrap.min.css.map +1 -0
  102. data/docs/vendor/bootstrap/js/bootstrap.js +3535 -0
  103. data/docs/vendor/bootstrap/js/bootstrap.min.js +7 -0
  104. data/docs/vendor/font-awesome/css/font-awesome.css +2337 -0
  105. data/docs/vendor/font-awesome/css/font-awesome.min.css +4 -0
  106. data/docs/vendor/font-awesome/fonts/FontAwesome.otf +0 -0
  107. data/docs/vendor/font-awesome/fonts/fontawesome-webfont.eot +0 -0
  108. data/docs/vendor/font-awesome/fonts/fontawesome-webfont.svg +2671 -0
  109. data/docs/vendor/font-awesome/fonts/fontawesome-webfont.ttf +0 -0
  110. data/docs/vendor/font-awesome/fonts/fontawesome-webfont.woff +0 -0
  111. data/docs/vendor/font-awesome/fonts/fontawesome-webfont.woff2 +0 -0
  112. data/docs/vendor/font-awesome/less/animated.less +34 -0
  113. data/docs/vendor/font-awesome/less/bordered-pulled.less +25 -0
  114. data/docs/vendor/font-awesome/less/core.less +12 -0
  115. data/docs/vendor/font-awesome/less/fixed-width.less +6 -0
  116. data/docs/vendor/font-awesome/less/font-awesome.less +18 -0
  117. data/docs/vendor/font-awesome/less/icons.less +789 -0
  118. data/docs/vendor/font-awesome/less/larger.less +13 -0
  119. data/docs/vendor/font-awesome/less/list.less +19 -0
  120. data/docs/vendor/font-awesome/less/mixins.less +60 -0
  121. data/docs/vendor/font-awesome/less/path.less +15 -0
  122. data/docs/vendor/font-awesome/less/rotated-flipped.less +20 -0
  123. data/docs/vendor/font-awesome/less/screen-reader.less +5 -0
  124. data/docs/vendor/font-awesome/less/stacked.less +20 -0
  125. data/docs/vendor/font-awesome/less/variables.less +799 -0
  126. data/docs/vendor/font-awesome/scss/_animated.scss +34 -0
  127. data/docs/vendor/font-awesome/scss/_bordered-pulled.scss +25 -0
  128. data/docs/vendor/font-awesome/scss/_core.scss +12 -0
  129. data/docs/vendor/font-awesome/scss/_fixed-width.scss +6 -0
  130. data/docs/vendor/font-awesome/scss/_icons.scss +789 -0
  131. data/docs/vendor/font-awesome/scss/_larger.scss +13 -0
  132. data/docs/vendor/font-awesome/scss/_list.scss +19 -0
  133. data/docs/vendor/font-awesome/scss/_mixins.scss +60 -0
  134. data/docs/vendor/font-awesome/scss/_path.scss +15 -0
  135. data/docs/vendor/font-awesome/scss/_rotated-flipped.scss +20 -0
  136. data/docs/vendor/font-awesome/scss/_screen-reader.scss +5 -0
  137. data/docs/vendor/font-awesome/scss/_stacked.scss +20 -0
  138. data/docs/vendor/font-awesome/scss/_variables.scss +799 -0
  139. data/docs/vendor/font-awesome/scss/font-awesome.scss +18 -0
  140. data/docs/vendor/jquery-easing/jquery.easing.compatibility.js +59 -0
  141. data/docs/vendor/jquery-easing/jquery.easing.js +166 -0
  142. data/docs/vendor/jquery-easing/jquery.easing.min.js +1 -0
  143. data/docs/vendor/jquery/jquery.js +10253 -0
  144. data/docs/vendor/jquery/jquery.min.js +4 -0
  145. data/docs/vendor/simple-line-icons/css/simple-line-icons.css +778 -0
  146. data/docs/vendor/simple-line-icons/fonts/Simple-Line-Icons.eot +0 -0
  147. data/docs/vendor/simple-line-icons/fonts/Simple-Line-Icons.svg +200 -0
  148. data/docs/vendor/simple-line-icons/fonts/Simple-Line-Icons.ttf +0 -0
  149. data/docs/vendor/simple-line-icons/fonts/Simple-Line-Icons.woff +0 -0
  150. data/docs/vendor/simple-line-icons/fonts/Simple-Line-Icons.woff2 +0 -0
  151. data/docs/vendor/simple-line-icons/less/simple-line-icons.less +982 -0
  152. data/docs/vendor/simple-line-icons/scss/simple-line-icons.scss +979 -0
  153. data/docs/vendor/tether/tether.js +1811 -0
  154. data/docs/vendor/tether/tether.min.js +1 -0
  155. data/exe/codepipeline +14 -0
  156. data/exe/pipe +14 -0
  157. data/lib/codepipe.rb +23 -0
  158. data/lib/codepipe/autoloader.rb +21 -0
  159. data/lib/codepipe/aws_services.rb +20 -0
  160. data/lib/codepipe/aws_services/helpers.rb +71 -0
  161. data/lib/codepipe/build.rb +13 -0
  162. data/lib/codepipe/cli.rb +60 -0
  163. data/lib/codepipe/command.rb +82 -0
  164. data/lib/codepipe/completer.rb +159 -0
  165. data/lib/codepipe/completer/script.rb +6 -0
  166. data/lib/codepipe/completer/script.sh +10 -0
  167. data/lib/codepipe/core.rb +63 -0
  168. data/lib/codepipe/create.rb +12 -0
  169. data/lib/codepipe/delete.rb +27 -0
  170. data/lib/codepipe/deploy.rb +40 -0
  171. data/lib/codepipe/dsl/pipeline.rb +37 -0
  172. data/lib/codepipe/dsl/pipeline/approve.rb +34 -0
  173. data/lib/codepipe/dsl/pipeline/codebuild.rb +57 -0
  174. data/lib/codepipe/dsl/pipeline/github.rb +36 -0
  175. data/lib/codepipe/dsl/role.rb +50 -0
  176. data/lib/codepipe/dsl/schedule.rb +30 -0
  177. data/lib/codepipe/dsl/sns.rb +15 -0
  178. data/lib/codepipe/dsl/ssm.rb +22 -0
  179. data/lib/codepipe/dsl/webhook.rb +27 -0
  180. data/lib/codepipe/evaluate.rb +47 -0
  181. data/lib/codepipe/help.rb +9 -0
  182. data/lib/codepipe/help/completion.md +22 -0
  183. data/lib/codepipe/help/completion_script.md +3 -0
  184. data/lib/codepipe/help/hello.md +5 -0
  185. data/lib/codepipe/init.rb +57 -0
  186. data/lib/codepipe/pipeline.rb +61 -0
  187. data/lib/codepipe/pipeline/s3_bucket.rb +88 -0
  188. data/lib/codepipe/role.rb +181 -0
  189. data/lib/codepipe/schedule.rb +99 -0
  190. data/lib/codepipe/sequence.rb +66 -0
  191. data/lib/codepipe/setting.rb +79 -0
  192. data/lib/codepipe/sns.rb +43 -0
  193. data/lib/codepipe/stack.rb +95 -0
  194. data/lib/codepipe/start.rb +83 -0
  195. data/lib/codepipe/update.rb +12 -0
  196. data/lib/codepipe/version.rb +3 -0
  197. data/lib/codepipe/webhook.rb +60 -0
  198. data/lib/codepipeline.rb +1 -6
  199. data/lib/template/.codepipeline/pipeline.rb.tt +33 -0
  200. data/lib/template/.codepipeline/schedule.rb +3 -0
  201. data/lib/template/.codepipeline/settings.yml +9 -0
  202. data/lib/template/.codepipeline/sns.rb +14 -0
  203. data/spec/fixtures/app/.codepipeline/pipeline.rb +12 -0
  204. data/spec/fixtures/app/.codepipeline/schedule.rb +1 -0
  205. data/spec/fixtures/app/.codepipeline/webhook.rb +1 -0
  206. data/spec/fixtures/pipelines/approve.rb +22 -0
  207. data/spec/fixtures/pipelines/approve_existing_sns.rb +24 -0
  208. data/spec/lib/cli_spec.rb +18 -0
  209. data/spec/lib/pipeline/approve_spec.rb +32 -0
  210. data/spec/lib/pipeline_spec.rb +12 -0
  211. data/spec/lib/role_spec.rb +12 -0
  212. data/spec/lib/schedule_spec.rb +12 -0
  213. data/spec/lib/webhook_spec.rb +12 -0
  214. data/spec/spec_helper.rb +35 -0
  215. metadata +419 -22
  216. data/.travis.yml +0 -7
  217. data/bin/console +0 -14
  218. data/bin/setup +0 -8
  219. data/codepipeline.gemspec +0 -27
  220. data/lib/codepipeline/version.rb +0 -3
@@ -0,0 +1,73 @@
1
+ # Site settings
2
+ title: codepipeline
3
+ email: tongueroo@gmail.com
4
+ url: https://codepipeline.org
5
+ description: "CodePipeline DSL"
6
+ keywords: "codepipeline boltops dsl ruby aws"
7
+ skills: ""
8
+ meta_author: Tung Nguyen
9
+
10
+ # Google webmaster tools
11
+ google_verify:
12
+ google_analytics: "UA-98684555-12"
13
+
14
+ # https://ssl.bing.com/webmaster/configure/verify/ownership Option 2 content= goes here
15
+ bing_verify:
16
+
17
+ # Contact form:
18
+ # - static : pass through formspree.io to validate email sending
19
+ # - disqus : replace contact form by disqus thread
20
+ # - comment the line below if you want to stick with the default PHP contact form
21
+ contact: static
22
+
23
+ # If you use disqus you need disqus shortname
24
+ # https://help.disqus.com/customer/portal/articles/466208
25
+ disqus_shortname:
26
+
27
+ # Color settings (hex-codes without the leading hash-tag)
28
+ color:
29
+ primary: 3972c7
30
+ primary-rgb: "24,288,156" #"128,179,255"
31
+ secondary: 2c3e50 #FD6E8A
32
+ secondary-dark: 233140 #A2122F
33
+ links: a3c8ff
34
+
35
+ # Footer settings
36
+ footer:
37
+ copyright: BoltOps, LLC
38
+ location: San Francisco, CA
39
+ social: BoltOps
40
+ credits:
41
+ contact: contact@boltops.com
42
+ phone:
43
+
44
+ # Social networks usernames (many more available: google-plus, flickr, dribbble, pinterest, instagram, tumblr, linkedin, etc.)
45
+ social:
46
+ - title: twitter
47
+ url: http://twitter.com/tongueroo
48
+ - title: github
49
+ url: https://github.com/tongueroo/codepipeline
50
+
51
+ # Credits content
52
+ credits:
53
+
54
+ # Build settings
55
+ markdown: kramdown
56
+ permalink: pretty
57
+
58
+ gh_url: https://github.com/tongueroo/codepipeline
59
+
60
+ collections:
61
+ docs:
62
+ name: "Documentation"
63
+ output: true
64
+ reference:
65
+ name: "Reference"
66
+ output: true
67
+
68
+ defaults:
69
+ - values:
70
+ layout: default
71
+
72
+ plugins_dir:
73
+ - jekyll-coffeescript
@@ -0,0 +1,99 @@
1
+ ---
2
+ title: Contributing
3
+ ---
4
+
5
+ Hi there! Interested in contributing to CodePipeline? We'd love your help. CodePipeline is an open source project, built one contribution at a time by users like you.
6
+
7
+ ## Where to get help or report a problem
8
+
9
+ See [the support guidelines]({% link support.md %})
10
+
11
+ ## Ways to contribute
12
+
13
+ Whether you're a developer, an infrastructure engineer, or just an enthusiast, there are lots of ways to contribute. Here are a few ideas:
14
+
15
+ * [Install CodePipeline on your computer](https://https://codepipeline.org.com/docs/install/) and kick the tires. Does it work? Does it do what you'd expect? If not, [open an issue](https://github.com/tongueroo/codepipeline/issues/new/choose) and let us know.
16
+ * Comment on some of the project's [open issues](https://github.com/tongueroo/codepipeline/issues). Have you experienced the same problem? Know a workaround? Do you have a suggestion for how the feature could be better?
17
+ * Read through [the documentation](https://https://codepipeline.org.com/docs/), and click the "improve this page" button, any time you see something confusing or have a suggestion for something that could be improved.
18
+ * Browse through the [CodePipeline Community forum](https://community.https://codepipeline.org.com), and lend a hand answering questions. There's a good chance you've already experienced what another user is experiencing.
19
+ * Find [an open issue](https://github.com/tongueroo/codepipeline/issues) (especially [those labeled `help wanted`](https://github.com/tongueroo/codepipeline/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22)), and submit a proposed fix. If it's your first pull request, we promise we won't bite and are glad to answer any questions.
20
+ * Help evaluate [open pull requests](https://github.com/tongueroo/codepipeline/pulls), by testing the changes locally and reviewing what's proposed.
21
+
22
+ ## Submitting a pull request
23
+
24
+ ### Pull requests generally
25
+
26
+ * The smaller the proposed change, the better. If you'd like to propose two unrelated changes, submit two pull requests.
27
+
28
+ * The more information, the better. Make judicious use of the pull request body. Describe what changes were made, why you made them, and what impact they will have for users.
29
+
30
+ * If this is your first pull request, it may help to [understand GitHub Flow](https://guides.github.com/introduction/flow/).
31
+
32
+ * If you're submitting a code contribution, be sure to read the [code contributions](#code-contributions) section below.
33
+
34
+ ### Submitting a pull request via github.com
35
+
36
+ Many small changes can be made entirely through the github.com web interface.
37
+
38
+ 1. Navigate to the file within [tongueroo/codepipeline](https://github.com/tongueroo/codepipeline) that you'd like to edit.
39
+ 2. Click the pencil icon in the top right corner to edit the file.
40
+ 3. Make your proposed changes.
41
+ 4. Click "Propose file change."
42
+ 5. Click "Create pull request."
43
+ 6. Add a descriptive title and detailed description for your proposed change. The more information, the better.
44
+ 7. Click "Create pull request."
45
+
46
+ That's it! You'll be automatically subscribed to receive updates as others review your proposed change and provide feedback.
47
+
48
+ ### Submitting a pull request via Git command line
49
+
50
+ 1. Fork the project by clicking "Fork" in the top right corner of [tongueroo/codepipeline](https://github.com/tongueroo/codepipeline).
51
+ 2. Clone the repository locally `git clone https://github.com/<your-username>/codepipeline`.
52
+ 3. Fetch submodules `git submodule init && git submodule update`.
53
+ 4. Create a new, descriptively named branch to contain your change ( `git checkout -b my-awesome-feature` ).
54
+ 5. Hack away, add tests. Not necessarily in that order.
55
+ 6. Make sure everything still passes by running `bundle exec rspec` (see [the tests section](#running-tests-locally) below)
56
+ 7. Push the branch up ( `git push origin my-awesome-feature` ).
57
+ 8. Create a pull request by visiting `https://github.com/<your-username>/codepipeline` and following the instructions at the top of the screen.
58
+
59
+ ## Proposing updates to the documentation
60
+
61
+ We want the CodePipeline documentation to be the best it can be. We've open-sourced our docs and we welcome any pull requests if you find it lacking.
62
+
63
+ ### How to submit changes
64
+
65
+ You can find the documentation for [https://codepipeline.org.com](http://https://codepipeline.org.com) in the [docs](https://github.com/tongueroo/codepipeline/tree/master/docs) directory. See the section above, [submitting a pull request](#submitting-a-pull-request) for information on how to propose a change.
66
+
67
+ One gotcha, all pull requests should be directed at the `master` branch (the default branch).
68
+
69
+ ## Code Contributions
70
+
71
+ Interesting in submitting a pull request? Awesome. Read on. There are a few common gotchas that we'd love to help you avoid.
72
+
73
+ ### Tests and documentation
74
+
75
+ Any time you propose a code change, you should also include updates to the documentation and tests within the same pull request.
76
+
77
+ #### Documentation
78
+
79
+ If your contribution changes any CodePipeline behavior, make sure to update the documentation. Documentation lives in the `docs` folder. It's a Jekyll site and can be started with `cd docs && bin/web`. If the docs are missing information, please feel free to add it in. Great docs make a great project. Include changes to the documentation within your pull request, and once merged, `https://codepipeline.org.com` will be updated.
80
+
81
+ #### Tests
82
+
83
+ * If you're creating a small fix or patch to an existing feature, a simple test is more than enough. You can usually copy/paste from an existing example in the `specs` folder.
84
+
85
+ ### Code contributions generally
86
+
87
+ * Don't bump the Gem version in your pull request (if you don't know what that means, you probably didn't).
88
+
89
+ ## Running tests
90
+
91
+ ### Test Dependencies
92
+
93
+ To run the test suite by running the following command:
94
+
95
+ bundle exec rspec
96
+
97
+ ## Thank You
98
+
99
+ Thanks! Hacking on CodePipeline should be fun. If you find any of this hard to figure out, let us know so we can improve our process or documentation!
@@ -0,0 +1,43 @@
1
+ ---
2
+ title: Naming Conventions
3
+ nav_order: 7
4
+ ---
5
+
6
+ The codepipeline tool follows a few naming conventions.
7
+
8
+ ## Pipeline Name
9
+
10
+ It will set the pipeline name by inferring the name of the parent folder. For example, if the parent folder is `demo`.
11
+
12
+ cd demo
13
+ pipe deploy
14
+
15
+ The pipeline is named `demo`. You can override this easily by providing a pipeline name.
16
+
17
+ cd deploy my-pipeline # explicitly use my-pipeline as pipeline name
18
+
19
+ The pipeline is named `my-pipeline`
20
+
21
+ ## PIPE_ENV_EXTRA
22
+
23
+ The `PIPE_ENV_EXTRA` also affects the name of the pipeline. It gets appended at the end of the pipeline name.
24
+
25
+ PIPE_ENV_EXTRA=2 pipe deploy my-pipeline
26
+
27
+ The pipeline is named `my-pipeline-2`.
28
+
29
+ ## Settings append_env option
30
+
31
+ If the append_env is configured in the [Settings]({% link _docs/settings.md %}).
32
+
33
+ ## Stack Name
34
+
35
+ The CloudFormation stack name which creates the CodePipeline related resources is named the same as the pipeline name with `-cb` appended to the stack name. Examples:
36
+
37
+ Pipeline Name | Stack Name
38
+ --- | ---
39
+ demo | demo-cb
40
+ demo-unit | demo-unit-cb
41
+ demo-web-unit | demo-web-unit-cb
42
+
43
+ {% include prev_next.md %}
@@ -0,0 +1,72 @@
1
+ ---
2
+ title: Deploy
3
+ nav_order: 4
4
+ ---
5
+
6
+ The pipeline is generated from the DSL and created with CloudFormation. By default, the files that the DSL evaluates are:
7
+
8
+ .codepipeline/pipeline.rb
9
+ .codepipeline/role.rb
10
+ .codepipeline/schedule.rb
11
+ .codepipeline/webhook.rb
12
+
13
+ To create the CodePipeline pipeline, you run:
14
+
15
+ codepipeline deploy
16
+
17
+ You'll see output that looks something like this:
18
+
19
+ $ pipe deploy
20
+ Generated CloudFormation template at /tmp/codepipeline.yml
21
+ Deploying stack demo-pipe with CodePipeline project demo
22
+ Creating stack demo-pipe. Check CloudFormation console for status.
23
+ Stack name demo-pipe status CREATE_IN_PROGRESS
24
+ Here's the CloudFormation url to check for more details https://console.aws.amazon.com/cloudformation/home?region=us-west-2#/stacks
25
+ Waiting for stack to complete
26
+ 04:14:03AM CREATE_IN_PROGRESS AWS::CloudFormation::Stack demo-pipe User Initiated
27
+ 04:14:06AM CREATE_IN_PROGRESS AWS::IAM::Role IamRole
28
+ 04:14:07AM CREATE_IN_PROGRESS AWS::IAM::Role IamRole Resource creation Initiated
29
+ 04:14:25AM CREATE_COMPLETE AWS::IAM::Role IamRole
30
+ 04:14:28AM CREATE_IN_PROGRESS AWS::CodePipeline::Pipeline Pipeline
31
+ 04:14:29AM CREATE_IN_PROGRESS AWS::CodePipeline::Pipeline Pipeline Resource creation Initiated
32
+ 04:14:29AM CREATE_COMPLETE AWS::CodePipeline::Pipeline Pipeline
33
+ 04:14:31AM CREATE_IN_PROGRESS AWS::CodePipeline::Webhook Webhook
34
+ 04:14:33AM CREATE_IN_PROGRESS AWS::CodePipeline::Webhook Webhook Resource creation Initiated
35
+ 04:14:33AM CREATE_COMPLETE AWS::CodePipeline::Webhook Webhook
36
+ 04:14:35AM CREATE_COMPLETE AWS::CloudFormation::Stack demo-pipe
37
+ Stack success status: CREATE_COMPLETE
38
+ Time took for stack deployment: 35s.
39
+ $
40
+
41
+ ## Explicit Pipeline Name
42
+
43
+ By default, the pipeline name is inferred and is the parent folder that you are within. You can explicitly specify the pipeline name as the first CLI argument:
44
+
45
+ pipe deploy my-pipeline
46
+
47
+ ## Specify Git Branch
48
+
49
+ It is useful to build pipelines with different source git branches. You can pass a `--branch` option to the `pipe deploy` command. In the `.codepipeline/pipeline.rb` use the DSL method `branch` to reference it. Example:
50
+
51
+ pipe deploy my-pipeline --branch my-branch
52
+
53
+ .codepipeline/pipeline.rb
54
+
55
+ ```ruby
56
+ stage "Source" do
57
+ github(
58
+ source: "tongueroo/demo-test",
59
+ branch: branch, # branch method defaults to "master" or the `pipe deploy --branch` option
60
+ auth_token: ssm("/codebuild/github/tongueroo/oauth_token")
61
+ )
62
+ end
63
+ ```
64
+
65
+ Note: Currently CodePipeline does not support specifying a source git branch at runtime. We can only specific it as part of the pipeline definition.
66
+
67
+
68
+ ## CLI Reference
69
+
70
+ Also, for help info you can check the [pipe deploy]({% link _reference/pipe-deploy.md %}) CLI reference.
71
+
72
+ {% include prev_next.md %}
@@ -0,0 +1,13 @@
1
+ ---
2
+ title: CodePipeline DSL
3
+ nav_order: 8
4
+ ---
5
+
6
+ CodePipeline provides a simple yet powerful DSL to create CodePipeline related resources. Here are some examples of resources it can create:
7
+
8
+ * [pipeline]({% link _docs/dsl/pipeline.md %}): The CodePipeline pipeline. This is required.
9
+ * [iam role]({% link _docs/dsl/role.md %}): The IAM role associated with the CodePipeline pipeline.
10
+ * [webhook]({% link _docs/dsl/webhook.md %}): The webhook associated with the CodePipeline pipeline.
11
+ * [schedule]({% link _docs/dsl/schedule.md %}): An CloudWatch Event rule. The rule triggers the pipeline to start on a scheduled basis.
12
+
13
+ {% include prev_next.md %}
@@ -0,0 +1,62 @@
1
+ ---
2
+ title: Approval Action DSL
3
+ nav_text: Approve
4
+ categories: dsl
5
+ nav_order: 9
6
+ ---
7
+
8
+ You can add an approve action to a stage with the simple `approve` method. There are various helpful forms. Let's start with the simplest form.
9
+
10
+ ## String
11
+
12
+ The approve method take can take a simple String. In this form, it sets the message for the approval action. Essentially, it sets the `configuration.CustomData` property of the Approval action. See [Add an Action to a Pipeline in CodePipeline](https://docs.aws.amazon.com/codepipeline/latest/userguide/approvals-action-add.html) docs for the full structure.
13
+
14
+ ```ruby
15
+ stage "Approve" do
16
+ approve("Approve this deployment")
17
+ end
18
+ ```
19
+
20
+ In this case, the codepipeline tool creates and manages the SNS topic for you.
21
+
22
+ ## Simplified Configuration Hash
23
+
24
+ If the approve method provided a Hash with the `notification_arn` and `custom_data` then the codepipeline tool will set the `configuration` directly. Example:
25
+
26
+ ```ruby
27
+ stage "Approve" do
28
+ approve(
29
+ notification_arn: "arn:aws:sns:us-west-2:536766270177:hello-topic",
30
+ custom_data: "Approve deployment",
31
+ )
32
+ end
33
+ ```
34
+
35
+ In this case, the codepipeline will *not* create an SNS Topic as we're using an existing SNS topic.
36
+
37
+ ## Full Config
38
+
39
+ The convenience methods merely wrap a CodePipeline Approval Action. An example of the Approval Action structure is provided in the [Add an Action to a Pipeline in CodePipeline](https://docs.aws.amazon.com/codepipeline/latest/userguide/approvals-action-add.html) docs.
40
+
41
+ If you need to set the properties more directly, here's an example of using the "Full" Config.
42
+
43
+ ```ruby
44
+ stage "Approve" do
45
+ approve(
46
+ name: "approve",
47
+ action_type_id: {
48
+ category: "Approval",
49
+ owner: "AWS",
50
+ provider: "Manual",
51
+ version: "1",
52
+ },
53
+ run_order: 1,
54
+ configuration: {
55
+ custom_data: "my message",
56
+ notification_arn: {ref: "SnsTopic"}, # defaults to generated SNS topic
57
+ },
58
+ )
59
+ end
60
+ ```
61
+
62
+ {% include prev_next.md %}
@@ -0,0 +1,56 @@
1
+ ---
2
+ title: Pipeline DSL
3
+ nav_text: Pipeline
4
+ categories: dsl
5
+ nav_order: 10
6
+ ---
7
+
8
+ The pipeline DSL allows you to define the stages and actions within that stage with only a few lines of code. In the Quick Start, we define a very short pipeline for as a simple example. Here we'll show more of the DSL power.
9
+
10
+ ```
11
+ stage "Source" do
12
+ github(
13
+ source: "tongueroo/demo-test",
14
+ branch: branch, # branch method defaults to "master" or the `pipe deploy --branch` option
15
+ auth_token: ssm("/codebuild/github/tongueroo/oauth_token")
16
+ )
17
+ end
18
+
19
+ stage "Build" do
20
+ codebuild "demo1", "demo2"
21
+ codebuild "demo3"
22
+ end
23
+
24
+ stage "Approve" do
25
+ approve
26
+ end
27
+
28
+ stage "Deploy" do
29
+ codebuild "deploy"
30
+ end
31
+ ```
32
+
33
+ This pipeline has 3 stages:
34
+
35
+ 1. downloads the source code from Gitub and uploads it to S3 as an output artifact
36
+ 2. starts some codebuild project with output artifact from the previous step
37
+ 3. waits for a manual approval stage
38
+ 4. uses another codebuild to kick off a deploy.
39
+
40
+ ## Build Stage
41
+
42
+ Within the build stage, there are multiple actions. Some of them run in parallel and some in serial.
43
+
44
+ * The demo1 and demo2 codebuild projects run on the same `RunOrder=1`. They run in parallel.
45
+ * The demo3 codebuild project run with `RunOrder=2`. It starts after both demo1 and demo2 finishes.
46
+
47
+ The Pipeline DSL allows to you connect the stages together how you want them with very little code.
48
+
49
+ ## Pipeline Specific DSL Docs
50
+
51
+ {% assign docs = site.docs | where: "categories","dsl-pipeline" %}
52
+ {% for doc in docs -%}
53
+ * [{{doc.nav_text}}]({{doc.url}})
54
+ {% endfor %}
55
+
56
+ {% include prev_next.md %}
@@ -0,0 +1,28 @@
1
+ ---
2
+ title: Action General Method
3
+ nav_text: Action
4
+ categories: dsl-pipeline
5
+ nav_order: 11
6
+ ---
7
+
8
+ The `action` method is a general way to add Actions to your pipeline Stages. Generally, it is recommended to use the helper methods like [codebuild]({% link _docs/dsl/pipeline/codebuild.md %}) and [approve]({% link _docs/dsl/approve.md %}) when possible as it makes the code concise. Here's an example of a pipeline using the general `action` method.
9
+
10
+ ```ruby
11
+ stage "Build" do
12
+ action(
13
+ name: "action1",
14
+ action_type_id: {
15
+ category: "Build",
16
+ owner: "AWS",
17
+ provider: "CodeBuild",
18
+ version: "1",
19
+ },
20
+ run_order: 1,
21
+ configuration: { project_name: 'demo1' },
22
+ # output_artifacts: [name: "BuildArtifact#{name}"], # optional
23
+ input_artifacts: [name: "SourceArtifact"], # default
24
+ )
25
+ end
26
+ ```
27
+
28
+ {% include prev_next.md %}