codepipeline 0.3.0 → 0.3.1

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.
Files changed (202) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +3 -0
  3. data/Gemfile.lock +7 -7
  4. data/codepipe.gemspec +5 -1
  5. data/lib/codepipe/version.rb +1 -1
  6. data/vendor/aws_data/Gemfile +4 -0
  7. data/vendor/aws_data/Gemfile.lock +48 -0
  8. data/{docs/LICENSE → vendor/aws_data/LICENSE.txt} +4 -4
  9. data/vendor/aws_data/README.md +41 -0
  10. data/vendor/aws_data/Rakefile +6 -0
  11. data/vendor/aws_data/aws_data.gemspec +30 -0
  12. data/vendor/aws_data/bin/console +14 -0
  13. data/vendor/aws_data/bin/setup +8 -0
  14. data/vendor/aws_data/lib/aws_data.rb +89 -0
  15. data/vendor/aws_data/lib/aws_data/version.rb +3 -0
  16. data/vendor/aws_data/spec/aws_data_spec.rb +5 -0
  17. data/vendor/aws_data/spec/spec_helper.rb +14 -0
  18. data/vendor/cfn-status/Gemfile +4 -0
  19. data/vendor/cfn-status/Gemfile.lock +49 -0
  20. data/vendor/cfn-status/LICENSE.txt +21 -0
  21. data/vendor/cfn-status/README.md +56 -0
  22. data/vendor/cfn-status/Rakefile +6 -0
  23. data/vendor/cfn-status/bin/console +14 -0
  24. data/vendor/cfn-status/bin/setup +8 -0
  25. data/vendor/cfn-status/cfn-status.gemspec +30 -0
  26. data/vendor/cfn-status/lib/cfn/aws_service.rb +56 -0
  27. data/vendor/cfn-status/lib/cfn/status.rb +220 -0
  28. data/vendor/cfn-status/lib/cfn/status/version.rb +5 -0
  29. data/vendor/cfn-status/spec/cfn/status_spec.rb +81 -0
  30. data/vendor/cfn-status/spec/fixtures/cfn/stack-events-complete.json +1080 -0
  31. data/vendor/cfn-status/spec/fixtures/cfn/stack-events-in-progress.json +1080 -0
  32. data/vendor/cfn-status/spec/fixtures/cfn/stack-events-update-rollback-complete.json +1086 -0
  33. data/vendor/cfn-status/spec/spec_helper.rb +14 -0
  34. data/vendor/cfn_camelizer/CHANGELOG.md +10 -0
  35. data/vendor/cfn_camelizer/Gemfile +4 -0
  36. data/vendor/cfn_camelizer/LICENSE.txt +21 -0
  37. data/vendor/cfn_camelizer/README.md +40 -0
  38. data/vendor/cfn_camelizer/Rakefile +6 -0
  39. data/vendor/cfn_camelizer/bin/console +14 -0
  40. data/vendor/cfn_camelizer/bin/setup +8 -0
  41. data/vendor/cfn_camelizer/cfn_camelizer.gemspec +32 -0
  42. data/vendor/cfn_camelizer/lib/camelizer.yml +27 -0
  43. data/vendor/cfn_camelizer/lib/cfn_camelizer.rb +92 -0
  44. data/vendor/cfn_camelizer/lib/cfn_camelizer/version.rb +3 -0
  45. data/vendor/cfn_camelizer/spec/cfn_camelizer_spec.rb +79 -0
  46. data/vendor/cfn_camelizer/spec/spec_helper.rb +14 -0
  47. metadata +44 -171
  48. data/docs/.gitignore +0 -4
  49. data/docs/CNAME +0 -1
  50. data/docs/Gemfile +0 -3
  51. data/docs/README.md +0 -25
  52. data/docs/_config.yml +0 -73
  53. data/docs/_docs/contributing.md +0 -99
  54. data/docs/_docs/conventions.md +0 -42
  55. data/docs/_docs/deploy.md +0 -59
  56. data/docs/_docs/dsl.md +0 -39
  57. data/docs/_docs/dsl/approve.md +0 -62
  58. data/docs/_docs/dsl/pipeline.md +0 -55
  59. data/docs/_docs/dsl/pipeline/action.md +0 -28
  60. data/docs/_docs/dsl/pipeline/codebuild.md +0 -62
  61. data/docs/_docs/dsl/pipeline/prefix-and-suffix.md +0 -57
  62. data/docs/_docs/dsl/role.md +0 -79
  63. data/docs/_docs/dsl/schedule.md +0 -29
  64. data/docs/_docs/dsl/sns.md +0 -27
  65. data/docs/_docs/dsl/webhook.md +0 -31
  66. data/docs/_docs/ecs-deploy.md +0 -22
  67. data/docs/_docs/examples/codebuild-project.md +0 -21
  68. data/docs/_docs/examples/different-branches.md +0 -49
  69. data/docs/_docs/examples/multiple-codebuild-projects.md +0 -60
  70. data/docs/_docs/install.md +0 -14
  71. data/docs/_docs/next-steps.md +0 -16
  72. data/docs/_docs/settings.md +0 -34
  73. data/docs/_docs/start.md +0 -31
  74. data/docs/_docs/structure.md +0 -25
  75. data/docs/_includes/commands.html +0 -92
  76. data/docs/_includes/content.html +0 -25
  77. data/docs/_includes/edit-on-github.html +0 -9
  78. data/docs/_includes/example.html +0 -12
  79. data/docs/_includes/footer.html +0 -41
  80. data/docs/_includes/google_analytics.html +0 -10
  81. data/docs/_includes/head.html +0 -45
  82. data/docs/_includes/js.html +0 -15
  83. data/docs/_includes/nav.html +0 -17
  84. data/docs/_includes/prev_next.md +0 -19
  85. data/docs/_includes/reference.md +0 -1
  86. data/docs/_includes/subnav.html +0 -47
  87. data/docs/_includes/tutorials.md +0 -38
  88. data/docs/_layouts/default.html +0 -12
  89. data/docs/_reference/pipe-completion.md +0 -44
  90. data/docs/_reference/pipe-completion_script.md +0 -25
  91. data/docs/_reference/pipe-delete.md +0 -25
  92. data/docs/_reference/pipe-deploy.md +0 -26
  93. data/docs/_reference/pipe-init.md +0 -25
  94. data/docs/_reference/pipe-start.md +0 -25
  95. data/docs/_reference/pipe-version.md +0 -21
  96. data/docs/_sass/_bootstrap-overrides.scss +0 -40
  97. data/docs/_sass/_contact.scss +0 -49
  98. data/docs/_sass/_cta.scss +0 -37
  99. data/docs/_sass/_download.scss +0 -31
  100. data/docs/_sass/_features.scss +0 -47
  101. data/docs/_sass/_footer.scss +0 -49
  102. data/docs/_sass/_global.scss +0 -102
  103. data/docs/_sass/_main.scss +0 -370
  104. data/docs/_sass/_masthead.scss +0 -70
  105. data/docs/_sass/_mixins.scss +0 -79
  106. data/docs/_sass/_navbar.scss +0 -92
  107. data/docs/_sass/_syntax.scss +0 -65
  108. data/docs/_sass/_table.scss +0 -34
  109. data/docs/_sass/_timeline.scss +0 -207
  110. data/docs/_sass/_variables.scss +0 -24
  111. data/docs/bin/web +0 -8
  112. data/docs/docs.md +0 -24
  113. data/docs/img/docs/codepipeline-output.png +0 -0
  114. data/docs/img/docs/multiple-codebuild-projects-pipeline.png +0 -0
  115. data/docs/img/logos/boltops-logo-full.png +0 -0
  116. data/docs/img/logos/boltops-logo.png +0 -0
  117. data/docs/img/logos/project-logo.png +0 -0
  118. data/docs/index.html +0 -37
  119. data/docs/js/nav.js +0 -39
  120. data/docs/js/new-age.js +0 -38
  121. data/docs/js/new-age.min.js +0 -6
  122. data/docs/new-age.scss +0 -20
  123. data/docs/quick-start.md +0 -72
  124. data/docs/reference.md +0 -12
  125. data/docs/support.md +0 -22
  126. data/docs/vendor/bootstrap/css/bootstrap-grid.css +0 -1339
  127. data/docs/vendor/bootstrap/css/bootstrap-grid.css.map +0 -1
  128. data/docs/vendor/bootstrap/css/bootstrap-grid.min.css +0 -1
  129. data/docs/vendor/bootstrap/css/bootstrap-grid.min.css.map +0 -1
  130. data/docs/vendor/bootstrap/css/bootstrap-reboot.css +0 -459
  131. data/docs/vendor/bootstrap/css/bootstrap-reboot.css.map +0 -1
  132. data/docs/vendor/bootstrap/css/bootstrap-reboot.min.css +0 -1
  133. data/docs/vendor/bootstrap/css/bootstrap-reboot.min.css.map +0 -1
  134. data/docs/vendor/bootstrap/css/bootstrap.css +0 -9320
  135. data/docs/vendor/bootstrap/css/bootstrap.css.map +0 -1
  136. data/docs/vendor/bootstrap/css/bootstrap.min.css +0 -6
  137. data/docs/vendor/bootstrap/css/bootstrap.min.css.map +0 -1
  138. data/docs/vendor/bootstrap/js/bootstrap.js +0 -3535
  139. data/docs/vendor/bootstrap/js/bootstrap.min.js +0 -7
  140. data/docs/vendor/font-awesome/css/font-awesome.css +0 -2337
  141. data/docs/vendor/font-awesome/css/font-awesome.min.css +0 -4
  142. data/docs/vendor/font-awesome/fonts/FontAwesome.otf +0 -0
  143. data/docs/vendor/font-awesome/fonts/fontawesome-webfont.eot +0 -0
  144. data/docs/vendor/font-awesome/fonts/fontawesome-webfont.svg +0 -2671
  145. data/docs/vendor/font-awesome/fonts/fontawesome-webfont.ttf +0 -0
  146. data/docs/vendor/font-awesome/fonts/fontawesome-webfont.woff +0 -0
  147. data/docs/vendor/font-awesome/fonts/fontawesome-webfont.woff2 +0 -0
  148. data/docs/vendor/font-awesome/less/animated.less +0 -34
  149. data/docs/vendor/font-awesome/less/bordered-pulled.less +0 -25
  150. data/docs/vendor/font-awesome/less/core.less +0 -12
  151. data/docs/vendor/font-awesome/less/fixed-width.less +0 -6
  152. data/docs/vendor/font-awesome/less/font-awesome.less +0 -18
  153. data/docs/vendor/font-awesome/less/icons.less +0 -789
  154. data/docs/vendor/font-awesome/less/larger.less +0 -13
  155. data/docs/vendor/font-awesome/less/list.less +0 -19
  156. data/docs/vendor/font-awesome/less/mixins.less +0 -60
  157. data/docs/vendor/font-awesome/less/path.less +0 -15
  158. data/docs/vendor/font-awesome/less/rotated-flipped.less +0 -20
  159. data/docs/vendor/font-awesome/less/screen-reader.less +0 -5
  160. data/docs/vendor/font-awesome/less/stacked.less +0 -20
  161. data/docs/vendor/font-awesome/less/variables.less +0 -799
  162. data/docs/vendor/font-awesome/scss/_animated.scss +0 -34
  163. data/docs/vendor/font-awesome/scss/_bordered-pulled.scss +0 -25
  164. data/docs/vendor/font-awesome/scss/_core.scss +0 -12
  165. data/docs/vendor/font-awesome/scss/_fixed-width.scss +0 -6
  166. data/docs/vendor/font-awesome/scss/_icons.scss +0 -789
  167. data/docs/vendor/font-awesome/scss/_larger.scss +0 -13
  168. data/docs/vendor/font-awesome/scss/_list.scss +0 -19
  169. data/docs/vendor/font-awesome/scss/_mixins.scss +0 -60
  170. data/docs/vendor/font-awesome/scss/_path.scss +0 -15
  171. data/docs/vendor/font-awesome/scss/_rotated-flipped.scss +0 -20
  172. data/docs/vendor/font-awesome/scss/_screen-reader.scss +0 -5
  173. data/docs/vendor/font-awesome/scss/_stacked.scss +0 -20
  174. data/docs/vendor/font-awesome/scss/_variables.scss +0 -799
  175. data/docs/vendor/font-awesome/scss/font-awesome.scss +0 -18
  176. data/docs/vendor/jquery-easing/jquery.easing.compatibility.js +0 -59
  177. data/docs/vendor/jquery-easing/jquery.easing.js +0 -166
  178. data/docs/vendor/jquery-easing/jquery.easing.min.js +0 -1
  179. data/docs/vendor/jquery/jquery.js +0 -10253
  180. data/docs/vendor/jquery/jquery.min.js +0 -4
  181. data/docs/vendor/simple-line-icons/css/simple-line-icons.css +0 -778
  182. data/docs/vendor/simple-line-icons/fonts/Simple-Line-Icons.eot +0 -0
  183. data/docs/vendor/simple-line-icons/fonts/Simple-Line-Icons.svg +0 -200
  184. data/docs/vendor/simple-line-icons/fonts/Simple-Line-Icons.ttf +0 -0
  185. data/docs/vendor/simple-line-icons/fonts/Simple-Line-Icons.woff +0 -0
  186. data/docs/vendor/simple-line-icons/fonts/Simple-Line-Icons.woff2 +0 -0
  187. data/docs/vendor/simple-line-icons/less/simple-line-icons.less +0 -982
  188. data/docs/vendor/simple-line-icons/scss/simple-line-icons.scss +0 -979
  189. data/docs/vendor/tether/tether.js +0 -1811
  190. data/docs/vendor/tether/tether.min.js +0 -1
  191. data/spec/fixtures/app/.codepipeline/pipeline.rb +0 -12
  192. data/spec/fixtures/app/.codepipeline/schedule.rb +0 -1
  193. data/spec/fixtures/app/.codepipeline/webhook.rb +0 -1
  194. data/spec/fixtures/pipelines/approve.rb +0 -22
  195. data/spec/fixtures/pipelines/approve_existing_sns.rb +0 -24
  196. data/spec/lib/cli_spec.rb +0 -18
  197. data/spec/lib/pipeline/approve_spec.rb +0 -32
  198. data/spec/lib/pipeline_spec.rb +0 -12
  199. data/spec/lib/role_spec.rb +0 -12
  200. data/spec/lib/schedule_spec.rb +0 -12
  201. data/spec/lib/webhook_spec.rb +0 -12
  202. data/spec/spec_helper.rb +0 -35
@@ -1,28 +0,0 @@
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 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 %}
@@ -1,62 +0,0 @@
1
- ---
2
- title: Codebuild Project
3
- nav_text: Codebuild
4
- categories: dsl-pipeline
5
- nav_order: 12
6
- ---
7
-
8
- The `codebuild` method is one of the most useful methods in the `pipeline.rb` DSL arsenal. With it, you can add codebuild projects to your pipeline and sequence them quickly. Let's start with the simplest form.
9
-
10
- ## String Form
11
-
12
- With the String form, the String sets both the name of the CodePipeline Action and CodeBuild Project.
13
-
14
- ```ruby
15
- stage "Deploy" do
16
- codebuild "demo1"
17
- codebuild "demo2", "demo3" # runs in parallel
18
- codebuild "demo4"
19
- end
20
- ```
21
-
22
- With just a few lines of code, we have define the pipeline to run the `demo1` codebuild project first. Then run `demo2` and `demo3` in parallel. Last, run `demo4`.
23
-
24
- ## Simplified Hash Form
25
-
26
- With the Simplified Hash form, we have more control over the CodePipeline Action and CodeBuild Project names.
27
-
28
- ```ruby
29
- stage "Deploy" do
30
- codebuild(name: "action1", project_name: "demo1")
31
- codebuild({name: "action2", project_name: "demo2"}, {name: "action3", project_name: "demo3"}) # runs in parallel
32
- codebuild(name: "action4", project_name: "demo4")
33
- end
34
- ```
35
-
36
- In this form, we can explicitly set what the Action Name shows up as in the CodePipeline. We can also set the CodeBuild project name explicitly.
37
-
38
- ## Full Hash Form
39
-
40
- With the Full Hash Form, we have full control of the Action properties. To keep this example concise, we'll declare only one codebuild Action.
41
-
42
- ```ruby
43
- stage "Build" do
44
- codebuild(
45
- name: "action1",
46
- action_type_id: {
47
- category: "Build",
48
- owner: "AWS",
49
- provider: "CodeBuild",
50
- version: "1",
51
- },
52
- run_order: 1,
53
- configuration: { project_name: 'demo1' },
54
- # output_artifacts: [name: "BuildArtifact#{name}"], # optional
55
- input_artifacts: [name: "SourceArtifact"], # default
56
- )
57
- end
58
- ```
59
-
60
- The various forms all use ultimately all merge the properties down to the Full Hash Form. Generally, it is recommended you start with the simplest form and use the more complex forms when required.
61
-
62
- {% include prev_next.md %}
@@ -1,57 +0,0 @@
1
- ---
2
- title: Prefix and Suffix Option
3
- nav_text: Prefix and Suffix
4
- categories: dsl-pipeline
5
- nav_order: 13
6
- ---
7
-
8
- Somewhat interesting options are the `codebuild_prefix` and `codebuild_suffix` option. These options affect the `codebuild` method and allow you to remove some duplication in the pipeline declaration.
9
-
10
- ## Example
11
-
12
- An example helps explain:
13
-
14
- Let's say you have 3 codebuild projects that deploy different tiers of the same codebase:
15
-
16
- * demo-web-deploy
17
- * demo-clock-deploy
18
- * demo-worker-deploy
19
-
20
- The setup makes use of 3 codebuild projects, so we have control over deploying each tier separately if desired. Typically, to define this with `pipeline.rb`, it could look something like this.
21
-
22
- ```ruby
23
- # Example 1
24
- stage "Deploy" do
25
- codebuild "demo-web-deploy", "demo-clock-deploy", "demo-worker-deploy"
26
- end
27
- ```
28
-
29
- The resulting Action names in the Stage would be a little lengthy and look like this: `DemoWebDeploy`, `DemoClockDeploy`, `DemoWorkerDeploy`. If you wanted to use shorter names like `Web`, `Clock`, and `Worker`, you'd need to use the [Simpified Hash Form]({% link _docs/dsl/pipeline/codebuild.md %}).
30
-
31
- ```ruby
32
- # Example 2
33
- stage "Deploy" do
34
- codebuild(
35
- {name: "Web", project_name: "demo-web-deploy"},
36
- {name: "Clock", project_name: "demo-clock-deploy"},
37
- {name: "Worker", project_name: "demo-worker-deploy"}
38
- end
39
- ```
40
-
41
- ## Prefix and Suffix Option
42
-
43
- If you use the `codebuild_prefix` and `codebuild_suffix`, it'll remove the need to use the Simplified Hash Form.
44
-
45
- ```ruby
46
- # Example 3
47
- codebuild_prefix "demo-"
48
- codebuild_suffix "-deploy"
49
-
50
- stage "Deploy" do
51
- codebuild "web", "clock", "worker"
52
- end
53
- ```
54
-
55
- So Example 2 and Examle 3 are equivalent.
56
-
57
- {% include prev_next.md %}
@@ -1,79 +0,0 @@
1
- ---
2
- title: Role DSL
3
- nav_text: Role
4
- categories: dsl
5
- nav_order: 14
6
- ---
7
-
8
- The codepipeline tool can create the IAM service role associated with the pipeline. Here's an example:
9
-
10
- .codepipeline/role.rb:
11
-
12
- ```ruby
13
- iam_policy("logs", "ssm")
14
- ```
15
-
16
- For more control, here's a longer form:
17
-
18
- ```ruby
19
- iam_policy(
20
- action: [
21
- "logs:CreateLogGroup",
22
- "logs:CreateLogStream",
23
- "logs:PutLogEvents",
24
- "ssm:*",
25
- ],
26
- effect: "Allow",
27
- resource: "*"
28
- )
29
- ```
30
-
31
- You can also create managed IAM policy.
32
-
33
- ```ruby
34
- managed_iam_policy("AmazonS3ReadOnlyAccess")
35
- ```
36
-
37
- You can also add multiple managed IAM policies:
38
-
39
- ```ruby
40
- managed_iam_policy("AmazonS3ReadOnlyAccess", "AmazonEC2ReadOnlyAccess")
41
- ```
42
-
43
- ## Full DSL
44
-
45
- The convenience methods merely wrap properties of the [AWS::IAM::Role
46
- CloudFormation Resource](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-role.html). If you wanted to set the CloudFormation properties more directly, here's an example of using the "Full" DSL.
47
-
48
- .codepipeline/role.rb:
49
-
50
- ```ruby
51
- assume_role_policy_document(
52
- statement: [{
53
- action: ["sts:AssumeRole"],
54
- effect: "Allow",
55
- principal: {
56
- service: ["codepipeline.amazonaws.com"]
57
- }
58
- }],
59
- version: "2012-10-17"
60
- )
61
- path("/")
62
- policies([{
63
- policy_name: "CodeBuildAccess",
64
- policy_document: {
65
- version: "2012-10-17",
66
- statement: [{
67
- action: [
68
- "logs:CreateLogGroup",
69
- "logs:CreateLogStream",
70
- "logs:PutLogEvents",
71
- ],
72
- effect: "Allow",
73
- resource: "*"
74
- }]
75
- }
76
- }])
77
- ```
78
-
79
- {% include prev_next.md %}
@@ -1,29 +0,0 @@
1
- ---
2
- title: Schedule DSL
3
- nav_text: Schedule
4
- categories: dsl
5
- nav_order: 15
6
- ---
7
-
8
- The codepipeline tool supports creating a CloudWatch scheduled event rule that will trigger the codepipeline project periodically. You define the schedule in `.codepipeline/schedule.rb`. Here's an example of what that looks like:
9
-
10
- .codepipeline/schedule.rb:
11
-
12
- ```ruby
13
- rate "1 day"
14
- # or
15
- cron("0 10 * * ? *") # Run at 10:00 am (UTC) every day
16
- ```
17
-
18
- ## Full DSL
19
-
20
- The convenience methods merely wrap properties of the [AWS::Events::Rule](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-events-rule.html#cfn-events-rule-description). If you wanted to set the CloudFormation properties more directly, here's an example of using the Full DSL.
21
-
22
- .codepipeline/schedule.rb:
23
-
24
- ```ruby
25
- description "my description"
26
- schedule_expression "rate(1 day)"
27
- ```
28
-
29
- {% include prev_next.md %}
@@ -1,27 +0,0 @@
1
- ---
2
- title: Sns Topic DSL
3
- nav_text: Sns Topic
4
- categories: dsl
5
- nav_order: 16
6
- ---
7
-
8
- The codepipeline tool can optionally create an SNS Topic and associate it with your [Approval Action]({% link _docs/dsl/approve.md %}).
9
- If you have created an Approval Action in the pipeline with the `approve` method, then the codepipeline tool will create and manage the SNS topic for you.
10
-
11
- For most cases, the default SNS topic should suffice. However, if you wish to control the SNS topic properties you can do so with a `.codepipeline/sns.rb` file. Here's an example:
12
-
13
- ```ruby
14
- display_name "my display_name"
15
- kms_master_key_id "String"
16
- subscription([{
17
- endpoint: 'my@email.com',
18
- protocol: 'email', # protocol values: https://docs.aws.amazon.com/sns/latest/api/API_Subscribe.html
19
- }])
20
- topic_name "string", # Recommend not setting because update requires: Replacement. Allow CloudFormation to set it so 2 pipelines dont have same SNS Topic name that collides
21
- ```
22
-
23
- The methods in the `sns.rb` are simply properties of the [SNS::Topic](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sns-topic.html) CloudFormation Resource
24
-
25
- Note: The codepipeline tool will only create the SNS Topic if you have declared an Approval Action in the `pipeline.rb` without specifying an existing SNS Topic ARN.
26
-
27
- {% include prev_next.md %}
@@ -1,31 +0,0 @@
1
- ---
2
- title: Webhook DSL
3
- nav_text: Webhook
4
- categories: dsl
5
- nav_order: 17
6
- ---
7
-
8
- The simplest way to declare a webhook is to use the `github_token` method. This single line is enough to configure and set up the webhook.
9
-
10
- .codepipeline/webhook.rb:
11
-
12
- ```ruby
13
- github_token(ssm("/codebuild/github/oauth_token"))
14
- ```
15
-
16
- ## Full DSL
17
-
18
- The convenience methods merely wrap properties of the [AWS::CodePipeline::Webhook](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-codepipeline-webhook.html). If you wanted to set the CloudFormation properties more directly, here's an example of using the Full DSL.
19
-
20
- .codepipeline/webhook.rb:
21
-
22
- ```ruby
23
- authentication "GITHUB_HMAC"
24
- authentication_configuration(secret_token: ssm("/codebuild/github/oauth_token"))
25
- filters([{
26
- json_path: "$.ref",
27
- match_equals: "refs/heads/{Branch}",
28
- }])
29
- ```
30
-
31
- {% include prev_next.md %}
@@ -1,22 +0,0 @@
1
- ---
2
- title: 'ECS Deploy: Codebuild ufo ship vs CodePipeline ECS Deploy'
3
- nav_order: 21
4
- ---
5
-
6
- CodePipeline comes with many [Action Type Integrations](https://docs.aws.amazon.com/codepipeline/latest/userguide/integrations-action-type.html). One of the Integrations is [Amazon Elastic Container Service](https://docs.aws.amazon.com/codepipeline/latest/userguide/integrations-action-type.html#integrations-deploy) deployment. It is recommended to use [codebuild and ufo](https://codebuild.cloud/docs/examples/ecs/) to handle deployment to ECS though. We discuss some reasons below.
7
-
8
- ## Timeout
9
-
10
- With the CodePipeline ECS Deploy if your ECS service fails to stabilize then the pipeline stage will not timeout until 60 minutes later. There is no built-in way to abort the pipeline stage. This is discussed here: [CodePipeline stage timeouts / abort?](https://forums.aws.amazon.com/thread.jspa?threadID=216350).
11
-
12
- A workaround is discussed here: [How to stop an execution or set set timeout for an action in AWS CodePipeline?](https://stackoverflow.com/questions/50925732/how-to-stop-an-execution-or-set-set-timeout-for-an-action-in-aws-codepipeline/50929558). So to workaround waiting for 60 minutes, we can update the pipeline. This is a little bit inconvenient.
13
-
14
- By using a codebuild project, we have control over the timeout.
15
-
16
- ## It's Less Powerful
17
-
18
- The way the current CodePipeline ECS Deploy Action works is that it pulls down the current ECS task definition that ECS service is using. It then replaces the image property on it. Last, it then updates the ECS service with the newly built Docker image.
19
-
20
- The [ufo tool](https://ufoships.com) is more powerful. The `ufo ship` command also handles creating the [ELB Load Balancer]((https://ufoships.com/docs/extras/load-balancer/)) and a vanity [Route53 endpoint](https://ufoships.com/docs/extras/route53-support/) for us. Also, it keeps task definitions codified.
21
-
22
- {% include prev_next.md %}
@@ -1,21 +0,0 @@
1
- ---
2
- title: Create CodeBuild Project
3
- nav_text: Create CodeBuild
4
- categories: examples
5
- nav_order: 18
6
- ---
7
-
8
- It is common to use codebuild as a Stage Action in the pipeline. Here's are instructions to quickly create a codebuild project.
9
-
10
- We'll use the [codebuild.cloud](https://codebuild.cloud) tool to help with this. Here are the commands.
11
-
12
- cb init # generates starter .codebuild files including the buildspec.yml
13
- # commit and yours the .codebuild files
14
- git add .codebuild
15
- git commit -m 'add .codebuild files'
16
- git push
17
- pipe deploy demo # creates a codebuild project
18
-
19
- There's also an example where we quickly create 4 test codebuild projects here: [Multiple CodeBuild Projects](https://codepipeline.org/docs/examples/multiple-codebuild-projects/).
20
-
21
- {% include prev_next.md %}
@@ -1,49 +0,0 @@
1
- ---
2
- title: Using Different Branches
3
- nav_text: Different Branches
4
- categories: examples
5
- nav_order: 19
6
- ---
7
-
8
- CodePipeline currently does not supports starting the pipeline execution with different branches natively. To get around this, we can:
9
-
10
- 1. update the pipeline before starting it.
11
- 2. create additional pipelines.
12
-
13
- The codepipeline tool supports both methods.
14
-
15
- ## Update Pipeline Approach
16
-
17
- With the update pipeline approach, the pipeline gets updated if the current pipeline branch is different from the requested branch before a pipeline execution starts. Examples:
18
-
19
- pipe start -b master
20
- pipe start -b qa
21
-
22
- Note: With this approach, since the pipeline gets updated, the pipeline will maintain the last branch it was started with.
23
-
24
- ## Multiple Pipelines Approach
25
-
26
- You might normally set the branch option in your pipeline.rb. Example:
27
-
28
- ```ruby
29
- stage "Source" do
30
- github(
31
- source: "user/repo",
32
- auth_token: ssm("/github/user/token")
33
- )
34
- end
35
- ```
36
-
37
- When we deploy to create the pipelines, we can explicitly specify the branch to use. The cli option overrides the branch specified in `pipeline.rb`. Examples:
38
-
39
- pipe deploy demo-master -b master
40
- pipe deploy demo-qa -b qa
41
-
42
- This creates 2 pipelines. The demo-master pipeline will use the master branch, and the demo-qa pipeline will use the qa branch.
43
-
44
- To start the pipelines:
45
-
46
- pipe start demo-master
47
- pipe start demo-qa
48
-
49
- {% include prev_next.md %}
@@ -1,60 +0,0 @@
1
- ---
2
- title: Multiple CodeBuild Projects
3
- nav_text: Multiple CodeBuild
4
- categories: examples
5
- nav_order: 20
6
- ---
7
-
8
- In this example guide, we'll create a couple of test CodeBuild projects and quickly connect them up to a pipeline.
9
-
10
- ## CodeBuild Projects
11
-
12
- We'll use the the [codebuild](https://codebuild.cloud/) tool to quickly get going.
13
-
14
- You can use any project, even an empty folder. You just have to make sure it is first pushed to GitHub. If you need an example project, you can try this one: [tongueroo/demo-ufo](https://github.com/tongueroo/demo-ufo).
15
-
16
- First, you can use `cb init` create some starter ``.codebuild` files.
17
-
18
- cd init
19
- git add .
20
- git commit -m 'add starter .codebuild files'
21
- git push
22
-
23
- Then create the 4 CodeBuild projects for testing:
24
-
25
- for i in 1 2 3 4 ; do pipe deploy demo$i --no-wait ; done
26
-
27
- ## CodePipeline
28
-
29
- Let's define a pipeline now with the 4 CodeBuild test projects. First, use `pipe init` to create the starter `.codepipeline` files. Update your `pipeline.rb` with the following:
30
-
31
- codepipeline/pipeline.rb:
32
-
33
- ```ruby
34
- stage "Source" do
35
- github(
36
- source: "tongueroo/demo-ufo", # replace with your repo
37
- auth_token: ssm("/github/user/token")
38
- )
39
- end
40
-
41
- stage "Build" do
42
- codebuild "demo1"
43
- codebuild "demo2", "demo3" # runs in parallel
44
- codebuild "demo4"
45
- end
46
- ```
47
-
48
- Deploy it with:
49
-
50
- pipe deploy
51
-
52
- Last, start the pipeline execution:
53
-
54
- pipe start
55
-
56
- That's it! The pipeline will look like this:
57
-
58
- ![](/img/docs/multiple-codebuild-projects-pipeline.png)
59
-
60
- {% include prev_next.md %}