ufo 3.5.7 → 4.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (191) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +24 -0
  3. data/Gemfile.lock +16 -10
  4. data/README.md +12 -13
  5. data/docs/_config.yml +1 -1
  6. data/docs/_docs/auto-completion.md +4 -4
  7. data/docs/_docs/automated-cleanup.md +1 -1
  8. data/docs/_docs/conventions.md +7 -7
  9. data/docs/_docs/customize-cloudformation.md +36 -0
  10. data/docs/_docs/faq.md +9 -7
  11. data/docs/_docs/fargate.md +102 -0
  12. data/docs/_docs/helpers.md +3 -3
  13. data/docs/_docs/load-balancer.md +72 -0
  14. data/docs/_docs/migrations.md +2 -2
  15. data/docs/_docs/next-steps.md +2 -2
  16. data/docs/_docs/params.md +12 -41
  17. data/docs/_docs/route53-support.md +28 -0
  18. data/docs/_docs/run-in-pieces.md +2 -2
  19. data/docs/_docs/security-groups.md +54 -0
  20. data/docs/_docs/settings-cfn.md +11 -0
  21. data/docs/_docs/settings-network.md +34 -0
  22. data/docs/_docs/settings.md +18 -15
  23. data/docs/_docs/single-task.md +3 -3
  24. data/docs/_docs/ssl-support.md +42 -0
  25. data/docs/_docs/structure.md +5 -1
  26. data/docs/_docs/stuck-cloudformation.md +30 -0
  27. data/docs/_docs/tutorial-ufo-docker-build.md +19 -31
  28. data/docs/_docs/tutorial-ufo-init.md +16 -12
  29. data/docs/_docs/tutorial-ufo-ship.md +50 -54
  30. data/docs/_docs/tutorial-ufo-ships.md +9 -7
  31. data/docs/_docs/tutorial-ufo-tasks-build.md +26 -17
  32. data/docs/_docs/ufo-current.md +50 -0
  33. data/docs/_docs/ufo-env-extra.md +21 -0
  34. data/docs/_docs/ufo-env.md +6 -13
  35. data/docs/_docs/ufo-tasks-register.md +3 -3
  36. data/docs/_docs/upgrade4.md +49 -0
  37. data/docs/_docs/variables.md +5 -5
  38. data/docs/_docs/why-cloudformation.md +22 -0
  39. data/docs/_includes/about.html +1 -1
  40. data/docs/_includes/cfn-customize.md +39 -0
  41. data/docs/_includes/commands.html +6 -6
  42. data/docs/_includes/css/ufo.css +1 -0
  43. data/docs/_includes/example.html +13 -13
  44. data/docs/_includes/reference.md +1 -1
  45. data/docs/_includes/subnav.html +22 -5
  46. data/docs/_includes/ufo-ship-options.md +7 -6
  47. data/docs/_reference/ufo-apps.md +36 -0
  48. data/docs/_reference/ufo-cancel.md +24 -0
  49. data/docs/_reference/ufo-completion.md +1 -1
  50. data/docs/_reference/ufo-completion_script.md +1 -1
  51. data/docs/_reference/ufo-current.md +93 -0
  52. data/docs/_reference/ufo-deploy.md +18 -17
  53. data/docs/_reference/ufo-destroy.md +6 -4
  54. data/docs/_reference/ufo-docker-base.md +7 -7
  55. data/docs/_reference/ufo-docker-build.md +9 -9
  56. data/docs/_reference/ufo-docker-clean.md +8 -8
  57. data/docs/_reference/ufo-docker-name.md +4 -4
  58. data/docs/_reference/ufo-docker.md +4 -2
  59. data/docs/_reference/ufo-init.md +31 -20
  60. data/docs/_reference/ufo-network-help.md +15 -0
  61. data/docs/_reference/ufo-network-init.md +38 -0
  62. data/docs/_reference/ufo-network.md +26 -0
  63. data/docs/_reference/ufo-ps.md +53 -0
  64. data/docs/_reference/ufo-releases.md +40 -0
  65. data/docs/_reference/ufo-resources.md +44 -0
  66. data/docs/_reference/ufo-rollback.md +59 -0
  67. data/docs/_reference/ufo-scale.md +23 -3
  68. data/docs/_reference/ufo-ship.md +54 -27
  69. data/docs/_reference/ufo-ships.md +17 -26
  70. data/docs/_reference/ufo-stop.md +31 -0
  71. data/docs/_reference/ufo-task.md +15 -16
  72. data/docs/_reference/ufo-tasks-build.md +10 -10
  73. data/docs/_reference/ufo-tasks-register.md +3 -3
  74. data/docs/_reference/ufo-tasks.md +1 -1
  75. data/docs/_reference/ufo-upgrade-help.md +15 -0
  76. data/docs/_reference/ufo-upgrade-v2to3.md +15 -0
  77. data/docs/_reference/ufo-upgrade-v3_3to3_4.md +15 -0
  78. data/docs/_reference/ufo-upgrade-v3to4.md +27 -0
  79. data/docs/_reference/ufo-upgrade.md +28 -0
  80. data/docs/_reference/ufo-version.md +1 -1
  81. data/docs/articles.md +2 -2
  82. data/docs/docs.md +1 -1
  83. data/docs/img/docs/cloudformation-resources.png +0 -0
  84. data/docs/img/tutorials/ecs-console-task-definitions.png +0 -0
  85. data/docs/img/tutorials/ecs-console-ufo-ship.png +0 -0
  86. data/docs/img/tutorials/ecs-console-ufo-ships.png +0 -0
  87. data/docs/quick-start.md +21 -9
  88. data/docs/reference.md +10 -2
  89. data/exe/ufo +1 -1
  90. data/lib/cfn/stack.yml +259 -0
  91. data/lib/template/.ufo/params.yml.tt +21 -60
  92. data/lib/template/.ufo/settings.yml.tt +6 -1
  93. data/lib/template/.ufo/settings/cfn/default.yml.tt +55 -0
  94. data/lib/template/.ufo/settings/network/default.yml.tt +18 -0
  95. data/lib/template/.ufo/task_definitions.rb.tt +7 -6
  96. data/lib/template/.ufo/templates/fargate.json.erb +1 -1
  97. data/lib/template/.ufo/templates/main.json.erb +1 -0
  98. data/lib/template/.ufo/variables/base.rb.tt +5 -2
  99. data/lib/template/Dockerfile +10 -15
  100. data/lib/template/bin/deploy.tt +2 -2
  101. data/lib/ufo.rb +29 -20
  102. data/lib/ufo/apps.rb +49 -0
  103. data/lib/ufo/apps/cfn_map.rb +70 -0
  104. data/lib/ufo/apps/service.rb +56 -0
  105. data/lib/ufo/aws_service.rb +15 -6
  106. data/lib/ufo/base.rb +32 -0
  107. data/lib/ufo/cancel.rb +23 -0
  108. data/lib/ufo/cli.rb +91 -27
  109. data/lib/ufo/core.rb +35 -3
  110. data/lib/ufo/current.rb +104 -0
  111. data/lib/ufo/destroy.rb +10 -41
  112. data/lib/ufo/docker/builder.rb +5 -4
  113. data/lib/ufo/docker/cleaner.rb +1 -1
  114. data/lib/ufo/docker/pusher.rb +2 -2
  115. data/lib/ufo/ecr/cleaner.rb +1 -1
  116. data/lib/ufo/help/apps.md +12 -0
  117. data/lib/ufo/help/balancer.md +3 -0
  118. data/lib/ufo/help/current.md +65 -0
  119. data/lib/ufo/help/deploy.md +4 -4
  120. data/lib/ufo/help/destroy.md +3 -3
  121. data/lib/ufo/help/docker.md +3 -1
  122. data/lib/ufo/help/docker/base.md +7 -7
  123. data/lib/ufo/help/docker/build.md +9 -9
  124. data/lib/ufo/help/docker/clean.md +8 -8
  125. data/lib/ufo/help/docker/name.md +4 -4
  126. data/lib/ufo/help/help.md +5 -0
  127. data/lib/ufo/help/init.md +24 -16
  128. data/lib/ufo/help/network/init.md +13 -0
  129. data/lib/ufo/help/ps.md +27 -0
  130. data/lib/ufo/help/releases.md +16 -0
  131. data/lib/ufo/help/resources.md +20 -0
  132. data/lib/ufo/help/rollback.md +35 -0
  133. data/lib/ufo/help/scale.md +22 -2
  134. data/lib/ufo/help/ship.md +40 -14
  135. data/lib/ufo/help/ships.md +4 -13
  136. data/lib/ufo/help/stop.md +7 -0
  137. data/lib/ufo/help/task.md +9 -9
  138. data/lib/ufo/help/tasks/build.md +10 -10
  139. data/lib/ufo/help/tasks/register.md +3 -3
  140. data/lib/ufo/help/upgrade/v3to4.md +3 -0
  141. data/lib/ufo/info.rb +62 -0
  142. data/lib/ufo/init.rb +36 -23
  143. data/lib/ufo/log_group.rb +2 -1
  144. data/lib/ufo/network.rb +24 -0
  145. data/lib/ufo/network/fetch.rb +41 -0
  146. data/lib/ufo/network/helper.rb +23 -0
  147. data/lib/ufo/network/init.rb +26 -0
  148. data/lib/ufo/param.rb +5 -5
  149. data/lib/ufo/ps.rb +102 -0
  150. data/lib/ufo/ps/task.rb +78 -0
  151. data/lib/ufo/releases.rb +14 -0
  152. data/lib/ufo/rollback.rb +53 -0
  153. data/lib/ufo/scale.rb +6 -12
  154. data/lib/ufo/sequence.rb +7 -0
  155. data/lib/ufo/setting.rb +7 -6
  156. data/lib/ufo/setting/profile.rb +24 -0
  157. data/lib/ufo/ship.rb +35 -326
  158. data/lib/ufo/stack.rb +203 -0
  159. data/lib/ufo/stack/context.rb +242 -0
  160. data/lib/ufo/stack/helper.rb +28 -0
  161. data/lib/ufo/stack/status.rb +195 -0
  162. data/lib/ufo/stop.rb +47 -0
  163. data/lib/ufo/task.rb +96 -15
  164. data/lib/ufo/tasks/register.rb +1 -1
  165. data/lib/ufo/template_scope.rb +81 -7
  166. data/lib/ufo/upgrade.rb +32 -0
  167. data/lib/ufo/{upgrade3.rb → upgrade/upgrade3.rb} +1 -1
  168. data/lib/ufo/{upgrade33_to_34.rb → upgrade/upgrade33to34.rb} +2 -2
  169. data/lib/ufo/upgrade/upgrade4.rb +161 -0
  170. data/lib/ufo/util.rb +19 -6
  171. data/lib/ufo/version.rb +1 -1
  172. data/spec/fixtures/apps/describe_services.json +96 -0
  173. data/spec/fixtures/cfn/stack-events-complete.json +1080 -0
  174. data/spec/fixtures/cfn/stack-events-in-progress.json +1080 -0
  175. data/spec/fixtures/cfn/stack-events-update-rollback-complete.json +1086 -0
  176. data/spec/fixtures/deployments.json +50 -0
  177. data/spec/fixtures/ps/describe_tasks.json +58 -0
  178. data/spec/fixtures/settings.yml +2 -0
  179. data/spec/lib/apps_spec.rb +20 -0
  180. data/spec/lib/cli_spec.rb +4 -4
  181. data/spec/lib/ps_spec.rb +14 -0
  182. data/spec/lib/setting_spec.rb +2 -1
  183. data/spec/lib/ship_spec.rb +6 -30
  184. data/spec/lib/stack/status_spec.rb +76 -0
  185. data/spec/lib/stop_spec.rb +13 -0
  186. data/spec/lib/task_spec.rb +5 -2
  187. data/spec/spec_helper.rb +1 -1
  188. data/ufo.gemspec +2 -0
  189. metadata +120 -6
  190. data/docs/_reference/ufo-upgrade3.md +0 -23
  191. data/docs/_reference/ufo-upgrade3_3_to_3_4.md +0 -23
@@ -0,0 +1,53 @@
1
+ ---
2
+ title: ufo ps
3
+ reference: true
4
+ ---
5
+
6
+ ## Usage
7
+
8
+ ufo ps SERVICE
9
+
10
+ ## Description
11
+
12
+ Show process info on ECS service.
13
+
14
+ ## Examples
15
+
16
+ $ ufo ps
17
+ => Service: demo-web
18
+ Service name: development-demo-web-Ecs-7GAUAXH5F56M
19
+ Status: ACTIVE
20
+ Running count: 2
21
+ Desired count: 2
22
+ Launch type: FARGATE
23
+ Task definition: demo-web:85
24
+ Elb: develop-Elb-1M74CLRS2G0Z4-686742146.us-east-1.elb.amazonaws.com
25
+ +----------+------+-------------+----------------+---------+-------+
26
+ | Id | Name | Release | Started | Status | Notes |
27
+ +----------+------+-------------+----------------+---------+-------+
28
+ | f590ee5e | web | demo-web:85 | 47 minutes ago | RUNNING | |
29
+ | fb60ba9f | web | demo-web:85 | 45 minutes ago | RUNNING | |
30
+ +----------+------+-------------+----------------+---------+-------+
31
+
32
+ Skip the summary info:
33
+
34
+ $ ufo ps --no-summary
35
+ +----------+------+-------------+----------------+---------+-------+
36
+ | Id | Name | Release | Started | Status | Notes |
37
+ +----------+------+-------------+----------------+---------+-------+
38
+ | f590ee5e | web | demo-web:85 | 48 minutes ago | RUNNING | |
39
+ | fb60ba9f | web | demo-web:85 | 45 minutes ago | RUNNING | |
40
+ +----------+------+-------------+----------------+---------+-------+
41
+
42
+
43
+ ## Options
44
+
45
+ ```
46
+ [--summary], [--no-summary] # Display summary header info.
47
+ # Default: true
48
+ [--verbose], [--no-verbose]
49
+ [--mute], [--no-mute]
50
+ [--noop], [--no-noop]
51
+ [--cluster=CLUSTER] # Cluster. Overrides .ufo/settings.yml.
52
+ ```
53
+
@@ -0,0 +1,40 @@
1
+ ---
2
+ title: ufo releases
3
+ reference: true
4
+ ---
5
+
6
+ ## Usage
7
+
8
+ ufo releases SERVICE
9
+
10
+ ## Description
11
+
12
+ Show possible 'releases' or task definitions for the service.
13
+
14
+ ## Example
15
+
16
+ $ ufo releases
17
+ Recent task definitions for this service:
18
+ demo-web:86
19
+ demo-web:85
20
+ demo-web:84
21
+ demo-web:83
22
+ demo-web:82
23
+ demo-web:81
24
+ demo-web:80
25
+ demo-web:79
26
+ demo-web:78
27
+ demo-web:77
28
+ demo-web:76
29
+ $
30
+
31
+
32
+ ## Options
33
+
34
+ ```
35
+ [--verbose], [--no-verbose]
36
+ [--mute], [--no-mute]
37
+ [--noop], [--no-noop]
38
+ [--cluster=CLUSTER] # Cluster. Overrides .ufo/settings.yml.
39
+ ```
40
+
@@ -0,0 +1,44 @@
1
+ ---
2
+ title: ufo resources
3
+ reference: true
4
+ ---
5
+
6
+ ## Usage
7
+
8
+ ufo resources SERVICE
9
+
10
+ ## Description
11
+
12
+ The ECS service resources.
13
+
14
+ Displays information about the service.
15
+
16
+ ## Examples
17
+
18
+ $ ufo resources demo-web
19
+ Resources:
20
+ Ecs - AWS::ECS::Service:
21
+ arn:aws:ecs:us-east-1:111111111111:service/dev-demo-web-Ecs-KN8OVQ7L2N40
22
+ EcsSecurityGroupRule - AWS::EC2::SecurityGroupIngress:
23
+ EcsSecurityGroupRule
24
+ EcsSecurityGroup - AWS::EC2::SecurityGroup:
25
+ sg-63c17228
26
+ Elb - AWS::ElasticLoadBalancingV2::LoadBalancer:
27
+ arn:aws:elasticloadbalancing:us-east-1:111111111111:loadbalancer/app/dev-hi-Elb-1KEVRDILLSUC9/0b9434b7a9a66fb7
28
+ ElbSecurityGroup - AWS::EC2::SecurityGroup:
29
+ sg-11b1025a
30
+ Listener - AWS::ElasticLoadBalancingV2::Listener:
31
+ arn:aws:elasticloadbalancing:us-east-1:111111111111:listener/app/dev-hi-Elb-1KEVRDILLSUC9/0b9434b7a9a66fb7/1996f1f252d7ba2e
32
+ TargetGroup - AWS::ElasticLoadBalancingV2::TargetGroup:
33
+ arn:aws:elasticloadbalancing:us-east-1:111111111111:targetgroup/dev-h-Targe-1VUFA8577XWT7/7e67276c182fdc87
34
+
35
+
36
+ ## Options
37
+
38
+ ```
39
+ [--verbose], [--no-verbose]
40
+ [--mute], [--no-mute]
41
+ [--noop], [--no-noop]
42
+ [--cluster=CLUSTER] # Cluster. Overrides .ufo/settings.yml.
43
+ ```
44
+
@@ -0,0 +1,59 @@
1
+ ---
2
+ title: ufo rollback
3
+ reference: true
4
+ ---
5
+
6
+ ## Usage
7
+
8
+ ufo rollback SERVICE VERSION
9
+
10
+ ## Description
11
+
12
+ Rolls back to older task definition.
13
+
14
+ ## Examples
15
+
16
+ You only need to specific the task definition version number, though you can specify the name also
17
+
18
+ ufo rollback demo-web 1
19
+ ufo rollback demo-web demo-web:1
20
+
21
+ To see recent task definitions:
22
+
23
+ ufo releases
24
+
25
+ If you set a current service with `ufo current`, then the commands get shorten:
26
+
27
+ ufo rollback demo-web:1
28
+ ufo rollback 1
29
+
30
+ Note, task definitions get created by many ways with more than just `ufo ship`. So it the previous version might not be the latest version number minus one.
31
+
32
+ ## Using image name
33
+
34
+ Another way to specify the version for rollback is with the container definition's image value. Here's the portion of the ecs task definition that you would look for:
35
+
36
+ ...
37
+ "container_definitions": [
38
+ {
39
+ "name": "web",
40
+ "image": "tongueroo/demo-ufo:ufo-2018-06-21T15-03-52-ac60240",
41
+ "cpu": 256,
42
+ ...
43
+
44
+ You only need to specify enough for a match to be found. Ufo searches the 30 most recent task definitions. So all of these would work:
45
+
46
+ ufo rollback tongueroo/demo-ufo:ufo-2018-06-21T15-03-52-ac60240
47
+ ufo rollback 2018-06-21T15-03-52
48
+ ufo rollback ac60240
49
+
50
+
51
+ ## Options
52
+
53
+ ```
54
+ [--verbose], [--no-verbose]
55
+ [--mute], [--no-mute]
56
+ [--noop], [--no-noop]
57
+ [--cluster=CLUSTER] # Cluster. Overrides .ufo/settings.yml.
58
+ ```
59
+
@@ -13,8 +13,28 @@ Scale the ECS service.
13
13
 
14
14
  Ufo provides a command to scale up and down an ECS service quickly. It is a simple wrapper for `aws ecs update-service --service xxx ----desired-count xxx`. Here's an example of how you use it:
15
15
 
16
- $ ufo scale hi-web 3
17
- Scale hi-web service in stag cluster to 3
16
+ $ ufo scale 3
17
+ Scale demo-web service in development cluster to 3
18
+
19
+ It is useful to use `ufo ps` to check the status.
20
+
21
+ $ ufo ps
22
+ => Service: demo-web
23
+ Service name: development-demo-web-Ecs-7GAUAXH5F56M
24
+ Status: ACTIVE
25
+ Running count: 2
26
+ Desired count: 3
27
+ Launch type: FARGATE
28
+ Task definition: demo-web:85
29
+ Elb: develop-Elb-1M74CLRS2G0Z4-686742146.us-east-1.elb.amazonaws.com
30
+ +----------+------+-------------+----------------+--------------+-------+
31
+ | Id | Name | Release | Started | Status | Notes |
32
+ +----------+------+-------------+----------------+--------------+-------+
33
+ | 8f95ef9d | web | demo-web:85 | PENDING | PROVISIONING | |
34
+ | f590ee5e | web | demo-web:85 | 50 minutes ago | RUNNING | |
35
+ | fb60ba9f | web | demo-web:85 | 48 minutes ago | RUNNING | |
36
+ +----------+------+-------------+----------------+--------------+-------+
37
+ $
18
38
 
19
39
  While scaling via this method is quick and convenient the [ECS Service AutoScaling](http://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-auto-scaling.html) that is built into ECS is a much more powerful way to manage scaling your ECS service.
20
40
 
@@ -25,6 +45,6 @@ While scaling via this method is quick and convenient the [ECS Service AutoScali
25
45
  [--verbose], [--no-verbose]
26
46
  [--mute], [--no-mute]
27
47
  [--noop], [--no-noop]
28
- [--cluster=CLUSTER] # Cluster. Overrides ufo/settings.yml.
48
+ [--cluster=CLUSTER] # Cluster. Overrides .ufo/settings.yml.
29
49
  ```
30
50
 
@@ -19,15 +19,15 @@ The main command you use when using ufo is: `ufo ship`. This command:
19
19
 
20
20
  Basic usage is:
21
21
 
22
- ufo ship hi-web
22
+ ufo ship demo-web
23
23
 
24
24
  The ECS service gets created if the service does not yet exist on the cluster.
25
25
 
26
26
  ### Conventions
27
27
 
28
- By convention the task and service names match. If you need override to this convention then you can specific the task. For example if you want to ship to the `hi-web-1` service and use the `hi-web` task, run:
28
+ By convention the task and service names match. If you need override to this convention then you can specific the task. For example if you want to ship to the `demo-web-1` service and use the `demo-web` task, run:
29
29
 
30
- ufo ship hi-web-1 --task hi-web
30
+ ufo ship demo-web-1 --task demo-web
31
31
 
32
32
  ## Options in Detail
33
33
 
@@ -37,15 +37,31 @@ The command has a decent amount of options, you can see the options available wi
37
37
 
38
38
  As you can see there are plenty of options for `ufo ship`. Let's demonstrate usage of them in a few examples.
39
39
 
40
- ### Load Balancer Target Group
40
+ ### Load Balancer
41
41
 
42
- When you are deploying to a service with the word 'web' in it, ufo assumes that this is a web service that uses a load balancer in front of it. This is also covered a in the [Conventions]({% link _docs/conventions.md %}) page. The deploy will prompt you for the ELB `--target-group` if the ECS does not yet exist. For non-web container the `--target-group` option gets ignored. The prommpt can be bypassed by specifying a valid `--target-group` option or specifying the `---no-target-group-prompt` option.
42
+ ECS services can be associated with a Load Balancer upon creation. Ufo can automatically create a load balancer. The options:
43
43
 
44
- ufo ship hi-web --no-target-group-prompt
44
+ 1. Automatically create the ELB.
45
+ 2. Provide a target group from an existing ELB.
46
+ 3. No ELB is created.
45
47
 
46
- Or if you would like to specify the target-group upfront and not be bother with the prompted later you can use the `--target-group` option.
48
+ Here are examples for each of them:
47
49
 
48
- ufo ship hi-web --target-group=arn:aws:elasticloadbalancing:us-east-1:12345689:targetgroup/hi-web/12345
50
+ ufo ship demo-web --elb=true
51
+
52
+ # Use existing target group from pre-created ELB:
53
+ ufo ship demo-web --elb=arn:aws:elasticloadbalancing:us-east-1:123456789:targetgroup/target-name/2378947392743
54
+
55
+ # Disable creating elb and prompt:
56
+ ufo ship demo-web --elb=false
57
+
58
+ Note, if the docker container's name is web then the `--elb` flag defaults to true automatically.
59
+
60
+ If you need to create a network load balancer with pre-allocated EIPs, you can use `--elb-eip-ids`, example:
61
+
62
+ ufo deploy demo-web --elb-eip-ids eipalloc-a8de9ca1 eipalloc-a8de9ca2
63
+
64
+ More info available at the [load balancer docs](http://ufoships.com/docs/load-balancer/).
49
65
 
50
66
  ### Deploying Task Definition without Docker Build
51
67
 
@@ -55,27 +71,37 @@ Let's you want skip the docker build phase and only want use ufo to deploy a tas
55
71
 
56
72
  By default when ufo updates the ECS service with the new task definition it does so asynchronuously. You then normally visit the ECS service console and then refresh until you see that the deployment is completed. You can also have ufo poll and wait for the deployment to be done with the `--wait` option
57
73
 
58
- ufo ship hi-web --wait
74
+ ufo ship demo-web --wait
59
75
 
60
76
  You should see output similar to this:
61
77
 
62
- Shipping hi-web...
63
- hi-web service updated on cluster with task hi-web
64
- Waiting for deployment of task definition hi-web:8 to complete
78
+ Shipping demo-web...
79
+ demo-web service updated on cluster with task demo-web
80
+ Waiting for deployment of task definition demo-web:8 to complete
65
81
  ......
66
82
  Time waiting for ECS deployment: 31s.
67
83
  Software shipped!
68
84
 
85
+ ### Route 53 DNS Support
86
+
87
+ Ufo can automatically create a "pretty" route53 record an set it to the created ELB dns name. This is done in by configuring the `.ufo/settings/network/[profile].yml` file. Example:
88
+
89
+ dns:
90
+ name: "{stack_name}.mydomain.com."
91
+ hosted_zone_name: mydomain.com. # dont forget the trailing period
92
+
93
+ Refer to [Route53 Support](http://ufoships.com/docs/route53-support/) for more info.
94
+
69
95
  ### Cleaning up Docker Images Automatically
70
96
 
71
97
  Since ufo builds the Docker image every time there's a deployment you will end up with a long list of docker images. Ufo automatically cleans up older docker images at the end of the deploy process if you are using AWS ECR. By default ufo keeps the most recent 30 Docker images. This can be adjust with the `--ecr-keep` option.
72
98
 
73
- docker ship hi-web --ecr-keep 2
99
+ docker ship demo-web --ecr-keep 2
74
100
 
75
101
  You should see something like this:
76
102
 
77
103
  Cleaning up docker images...
78
- Running: docker rmi tongueroo/hi:ufo-2017-06-12T06-46-12-a18aa30
104
+ Running: docker rmi tongueroo/demo-ufo:ufo-2017-06-12T06-46-12-a18aa30
79
105
 
80
106
  If you are using DockerHub or another registry, ufo does not automatically clean up images.
81
107
 
@@ -83,18 +109,19 @@ If you are using DockerHub or another registry, ufo does not automatically clean
83
109
  ## Options
84
110
 
85
111
  ```
86
- [--task=TASK] # ECS task name, to override the task name convention.
87
- [--target-group=TARGET_GROUP] # ELB Target Group ARN.
88
- [--target-group-prompt], [--no-target-group-prompt] # Enable Target Group ARN prompt
89
- # Default: true
90
- [--wait], [--no-wait] # Wait for deployment to complete
91
- [--pretty], [--no-pretty] # Pretty format the json for the task definitions
92
- # Default: true
93
- [--stop-old-tasks], [--no-stop-old-tasks] # Stop old tasks after waiting for deploying to complete
94
- [--ecr-keep=N] # ECR specific cleanup of old images. Specifies how many images to keep. Only runs if the images are ECR images. Defaults keeps all images.
95
- [--verbose], [--no-verbose]
96
- [--mute], [--no-mute]
97
- [--noop], [--no-noop]
98
- [--cluster=CLUSTER] # Cluster. Overrides ufo/settings.yml.
112
+ [--ecr-keep=N] # ECR specific cleanup of old images. Specifies how many images to keep. Only runs if the images are ECR images. Defaults keeps all images.
113
+ [--elb=ELB] # Decides to create elb, not create elb or use existing target group.
114
+ [--elb-eip-ids=one two three] # EIP Allocation ids to use for network load balancer.
115
+ [--elb-type=ELB_TYPE] # ELB type: application or network. Keep current deployed elb type when not specified.
116
+ [--pretty], [--no-pretty] # Pretty format the json for the task definitions
117
+ # Default: true
118
+ [--stop-old-tasks], [--no-stop-old-tasks] # Stop old tasks as part of deployment to speed it up
119
+ [--task=TASK] # ECS task name, to override the task name convention.
120
+ [--wait], [--no-wait] # Wait for deployment to complete
121
+ # Default: true
122
+ [--verbose], [--no-verbose]
123
+ [--mute], [--no-mute]
124
+ [--noop], [--no-noop]
125
+ [--cluster=CLUSTER] # Cluster. Overrides .ufo/settings.yml.
99
126
  ```
100
127
 
@@ -19,7 +19,7 @@ The `ufo ships` command allows you to deploy the *same* Docker image and task de
19
19
 
20
20
  Instead of using the [ufo ship]({% link _reference/ufo-ship.md %}) and build and deploying the code 3 times you can instead use `ufo ships`. This will result in the *same* Docker image and *same* task definition being deployed to all 3 services. Example usage:
21
21
 
22
- ufo ships hi-web hi-worker hi-clock
22
+ ufo ships demo-web demo-worker demo-clock
23
23
 
24
24
  ## Shell expansion
25
25
 
@@ -30,14 +30,14 @@ Since the ECS service names are provided as a list you can shorten the command b
30
30
  If you're new to shell expansion, run this to understand why above works just as well:
31
31
 
32
32
  $ echo hi-{web,worker,clock}
33
- hi-web hi-worker hi-clock
33
+ demo-web demo-worker demo-clock
34
34
 
35
35
  ## Overriding convention
36
36
 
37
37
  As explained in detail in [Conventions]({% link _docs/conventions.md %}) the task definition and service name are the same by convention. This convention also applies for each of the services being shipped in the list. The task definition and service names match for each of the services in the list. If you would like to override the convention as part of the ships command then you use a special syntax. In the special syntax the service and task definition is separated by a colon. Examples:
38
38
 
39
- ufo ships hi-web-1:hi-web hi-clock-1 hi-worker-1
40
- ufo ships hi-web-1:my-task hi-clock-1:another-task hi-worker-1:third-task
39
+ ufo ships demo-web-1:demo-web demo-clock-1 demo-worker-1
40
+ ufo ships demo-web-1:my-task demo-clock-1:another-task demo-worker-1:third-task
41
41
 
42
42
  ## ufo ships Options
43
43
 
@@ -47,31 +47,22 @@ The `ufo ships`, `ufo ship`, `ufo deploy` command support the same options. The
47
47
 
48
48
  Note: The `--task` option is not used with the `ufo ships` command.
49
49
 
50
- ## ELB Target Group
51
-
52
- For each service being deployed to, ufo will create the ECS service if the service does not yet exist on the cluster. The deploy process will prompt you for the ELB `--target-group` if you are deploying to a 'web' service that does not yet exist. Ufo determines that it is a web service by the name of the service. If the service has 'web' in the name then it is considered a web service. If it is not a web service then the `--target-group` option gets ignored.
53
-
54
- The prommt can be bypassed by specifying a valid `--target-group` option or specifying the `---no-target-group-prompt` option. ## Examples
55
-
56
- ufo ships hi-web hi-clock hi-worker --target-group arn:aws:elasticloadbalancing:us-east-1:123456789:targetgroup/hi-web/jsdlfjsdkd
57
- ufo ships hi-web hi-clock hi-worker --no-target-group-prompt
58
-
59
50
 
60
51
  ## Options
61
52
 
62
53
  ```
63
- [--task=TASK] # ECS task name, to override the task name convention.
64
- [--target-group=TARGET_GROUP] # ELB Target Group ARN.
65
- [--target-group-prompt], [--no-target-group-prompt] # Enable Target Group ARN prompt
66
- # Default: true
67
- [--wait], [--no-wait] # Wait for deployment to complete
68
- [--pretty], [--no-pretty] # Pretty format the json for the task definitions
69
- # Default: true
70
- [--stop-old-tasks], [--no-stop-old-tasks] # Stop old tasks after waiting for deploying to complete
71
- [--ecr-keep=N] # ECR specific cleanup of old images. Specifies how many images to keep. Only runs if the images are ECR images. Defaults keeps all images.
72
- [--verbose], [--no-verbose]
73
- [--mute], [--no-mute]
74
- [--noop], [--no-noop]
75
- [--cluster=CLUSTER] # Cluster. Overrides ufo/settings.yml.
54
+ [--ecr-keep=N] # ECR specific cleanup of old images. Specifies how many images to keep. Only runs if the images are ECR images. Defaults keeps all images.
55
+ [--elb=ELB] # Decides to create elb, not create elb or use existing target group.
56
+ [--elb-eip-ids=one two three] # EIP Allocation ids to use for network load balancer.
57
+ [--elb-type=ELB_TYPE] # ELB type: application or network. Keep current deployed elb type when not specified.
58
+ [--pretty], [--no-pretty] # Pretty format the json for the task definitions
59
+ # Default: true
60
+ [--stop-old-tasks], [--no-stop-old-tasks] # Stop old tasks as part of deployment to speed it up
61
+ [--task=TASK] # ECS task name, to override the task name convention.
62
+ [--wait], [--no-wait] # Wait for deployment to complete
63
+ [--verbose], [--no-verbose]
64
+ [--mute], [--no-mute]
65
+ [--noop], [--no-noop]
66
+ [--cluster=CLUSTER] # Cluster. Overrides .ufo/settings.yml.
76
67
  ```
77
68
 
@@ -0,0 +1,31 @@
1
+ ---
2
+ title: ufo stop
3
+ reference: true
4
+ ---
5
+
6
+ ## Usage
7
+
8
+ ufo stop SERVICE
9
+
10
+ ## Description
11
+
12
+ Stop tasks from old deployments. Can speed up deployments with network load balancer.
13
+
14
+ ECS deployments can sometimes take a while. One reason could be because the old ECS tasks can take some time to drain and removed. The recommended way to speed this draining process up is configuring the `deregistration_delay.timeout_seconds` to a low value. You can configured this in `.ufo/settings/cfn/default.yml`. For more info refer to http://localhost:4000/docs/settings-cfn/ This setting works well for Application Load Balancers.
15
+
16
+ However, for Network Load Balancers, it seems like the deregistration_delay is not currently being respected. In this case, it take an annoying load time and this command can help speed up the process.
17
+
18
+ The command looks for any extra old ongoing deployments and stops the tasks associated with them. This can cause errors for any inflight requests.
19
+
20
+ ufo stop demo-web
21
+
22
+
23
+ ## Options
24
+
25
+ ```
26
+ [--verbose], [--no-verbose]
27
+ [--mute], [--no-mute]
28
+ [--noop], [--no-noop]
29
+ [--cluster=CLUSTER] # Cluster. Overrides .ufo/settings.yml.
30
+ ```
31
+