ufo 4.5.11 → 5.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +29 -0
- data/README.md +2 -0
- data/docs/_docs/conventions.md +1 -1
- data/docs/_docs/extras/codebuild-iam-role.md +2 -2
- data/docs/_docs/extras/dockerfile-erb.md +2 -2
- data/docs/_docs/extras/ecs-network-mode.md +2 -2
- data/docs/_docs/extras/load-balancer.md +2 -2
- data/docs/_docs/extras/minimal-deploy-iam.md +2 -2
- data/docs/_docs/extras/notification-arns.md +21 -0
- data/docs/_docs/extras/redirection-support.md +2 -2
- data/docs/_docs/extras/route53-support.md +2 -2
- data/docs/_docs/extras/security-groups.md +2 -2
- data/docs/_docs/extras/ssl-support.md +2 -2
- data/docs/_docs/faq.md +2 -2
- data/docs/_docs/helpers.md +7 -5
- data/docs/_docs/iam-roles.md +111 -0
- data/docs/_docs/install.md +1 -1
- data/docs/_docs/more/auto-completion.md +2 -2
- data/docs/_docs/more/automated-cleanup.md +2 -2
- data/docs/_docs/more/customize-cloudformation.md +2 -2
- data/docs/_docs/more/migrations.md +2 -2
- data/docs/_docs/more/run-in-pieces.md +2 -2
- data/docs/_docs/more/single-task.md +2 -2
- data/docs/_docs/more/stuck-cloudformation.md +2 -2
- data/docs/_docs/more/why-cloudformation.md +2 -2
- data/docs/_docs/next-steps.md +2 -2
- data/docs/_docs/quick-start-ec2.md +2 -1
- data/docs/_docs/secrets.md +112 -0
- data/docs/_docs/settings.md +1 -1
- data/docs/_docs/settings/aws_profile.md +1 -1
- data/docs/_docs/settings/cfn.md +1 -1
- data/docs/_docs/settings/cluster.md +8 -14
- data/docs/_docs/settings/network.md +1 -1
- data/docs/_docs/ssl_errors.md +1 -2
- data/docs/_docs/structure.md +1 -1
- data/docs/_docs/tutorial-ufo-docker-build.md +1 -1
- data/docs/_docs/tutorial-ufo-init.md +1 -1
- data/docs/_docs/tutorial-ufo-ship.md +1 -1
- data/docs/_docs/tutorial-ufo-ships.md +1 -1
- data/docs/_docs/tutorial-ufo-tasks-build.md +1 -1
- data/docs/_docs/tutorial.md +1 -1
- data/docs/_docs/ufo-current.md +2 -2
- data/docs/_docs/ufo-env-extra.md +2 -2
- data/docs/_docs/ufo-env.md +2 -2
- data/docs/_docs/ufo-logs.md +50 -0
- data/docs/_docs/ufo-task-params.md +2 -2
- data/docs/_docs/upgrading.md +2 -2
- data/docs/_docs/upgrading/upgrade4.5.md +2 -2
- data/docs/_docs/upgrading/upgrade4.md +2 -2
- data/docs/_docs/variables.md +1 -1
- data/docs/_includes/subnav.html +4 -0
- data/docs/_reference/ufo-deploy.md +1 -2
- data/docs/_reference/ufo-init.md +1 -1
- data/docs/_reference/ufo-logs.md +40 -0
- data/docs/_reference/ufo-rollback.md +2 -0
- data/docs/_reference/ufo-ship.md +1 -2
- data/docs/_reference/ufo-ships.md +1 -2
- data/docs/_reference/ufo-tasks-build.md +1 -2
- data/docs/articles.md +2 -2
- data/docs/docs.md +1 -1
- data/docs/quick-start.md +2 -1
- data/docs/reference.md +1 -0
- data/lib/template/.secrets +3 -0
- data/lib/template/.ufo/settings.yml.tt +1 -0
- data/lib/template/.ufo/settings/cfn/default.yml.tt +27 -27
- data/lib/template/.ufo/settings/network/default.yml.tt +9 -0
- data/lib/template/.ufo/templates/fargate.json.erb +3 -0
- data/lib/template/.ufo/templates/main.json.erb +3 -0
- data/lib/template/.ufo/variables/base.rb.tt +1 -0
- data/lib/ufo.rb +2 -1
- data/lib/ufo/autoloader.rb +9 -0
- data/lib/ufo/cli.rb +12 -1
- data/lib/ufo/command.rb +7 -0
- data/lib/ufo/core.rb +1 -9
- data/lib/ufo/docker/cleaner.rb +1 -1
- data/lib/ufo/dsl.rb +6 -1
- data/lib/ufo/dsl/helper.rb +21 -27
- data/lib/ufo/dsl/helper/vars.rb +98 -0
- data/lib/ufo/dsl/outputter.rb +12 -9
- data/lib/ufo/help/init.md +1 -1
- data/lib/ufo/help/logs.md +10 -0
- data/lib/ufo/log_group.rb +1 -0
- data/lib/ufo/logs.rb +56 -0
- data/lib/ufo/role/builder.rb +66 -0
- data/lib/ufo/role/dsl.rb +21 -0
- data/lib/ufo/role/registry.rb +24 -0
- data/lib/ufo/rollback.rb +2 -1
- data/lib/ufo/setting/profile.rb +11 -7
- data/lib/ufo/setting/security_groups.rb +22 -0
- data/lib/ufo/settings.rb +20 -0
- data/lib/ufo/stack.rb +24 -24
- data/lib/ufo/stack/builder.rb +26 -0
- data/lib/ufo/stack/builder/base.rb +54 -0
- data/lib/ufo/stack/builder/conditions.rb +23 -0
- data/lib/ufo/stack/builder/outputs.rb +24 -0
- data/lib/ufo/stack/builder/parameters.rb +45 -0
- data/lib/ufo/stack/builder/resources.rb +20 -0
- data/lib/ufo/stack/builder/resources/base.rb +4 -0
- data/lib/ufo/stack/builder/resources/dns.rb +17 -0
- data/lib/ufo/stack/builder/resources/ecs.rb +63 -0
- data/lib/ufo/stack/builder/resources/elb.rb +45 -0
- data/lib/ufo/stack/builder/resources/listener.rb +42 -0
- data/lib/ufo/stack/builder/resources/listener_ssl.rb +16 -0
- data/lib/ufo/stack/builder/resources/roles/base.rb +22 -0
- data/lib/ufo/stack/builder/resources/roles/execution_role.rb +4 -0
- data/lib/ufo/stack/builder/resources/roles/task_role.rb +4 -0
- data/lib/ufo/stack/builder/resources/security_group/base.rb +4 -0
- data/lib/ufo/stack/builder/resources/security_group/ecs.rb +44 -0
- data/lib/ufo/stack/builder/resources/security_group/ecs_rule.rb +25 -0
- data/lib/ufo/stack/builder/resources/security_group/elb.rb +57 -0
- data/lib/ufo/stack/builder/resources/target_group.rb +39 -0
- data/lib/ufo/stack/builder/resources/task_definition.rb +24 -0
- data/lib/ufo/stack/builder/resources/task_definition/reconstructor.rb +49 -0
- data/lib/ufo/stack/context.rb +41 -48
- data/lib/ufo/stack/custom_properties.rb +59 -0
- data/lib/ufo/stack/helper.rb +2 -5
- data/lib/ufo/stack/template_body.rb +13 -0
- data/lib/ufo/task.rb +2 -7
- data/lib/ufo/tasks.rb +1 -1
- data/lib/ufo/tasks/builder.rb +0 -1
- data/lib/ufo/tasks/register.rb +11 -8
- data/lib/ufo/template_scope.rb +1 -66
- data/lib/ufo/utils/squeezer.rb +24 -0
- data/lib/ufo/version.rb +1 -1
- data/spec/fixtures/iam_roles/task_role.rb +17 -0
- data/spec/fixtures/mocks/logs/awslogs.json +70 -0
- data/spec/fixtures/mocks/logs/no-awslogs.json +70 -0
- data/spec/lib/logs_spec.rb +55 -0
- data/spec/lib/role/builder_spec.rb +67 -0
- data/spec/lib/role/dsl_spec.rb +12 -0
- data/ufo.gemspec +2 -0
- metadata +82 -5
- data/lib/cfn/stack.yml +0 -283
data/docs/_docs/variables.md
CHANGED
data/docs/_includes/subnav.html
CHANGED
@@ -25,7 +25,10 @@
|
|
25
25
|
</li>
|
26
26
|
<li><a href="{% link _docs/variables.md %}">Shared Variables</a></li>
|
27
27
|
<li><a href="{% link _docs/helpers.md %}">Helpers</a></li>
|
28
|
+
<li><a href="{% link _docs/secrets.md %}">Secrets</a></li>
|
29
|
+
<li><a href="{% link _docs/iam-roles.md %}">IAM Roles</a></li>
|
28
30
|
<li><a href="{% link _docs/conventions.md %}">Conventions</a></li>
|
31
|
+
<li><a href="{% link _docs/ufo-logs.md %}">Ufo Logs</a></li>
|
29
32
|
<li><a href="{% link _docs/ufo-env.md %}">Ufo Env</a></li>
|
30
33
|
<li><a href="{% link _docs/ufo-env-extra.md %}">Ufo Env Extra</a></li>
|
31
34
|
<li><a href="{% link _docs/ufo-current.md %}">Ufo Current</a></li>
|
@@ -43,6 +46,7 @@
|
|
43
46
|
<li><a href="{% link _docs/extras/minimal-deploy-iam.md %}">Minimal Deploy IAM</a></li>
|
44
47
|
<li><a href="{% link _docs/extras/codebuild-iam-role.md %}">CodeBuild IAM Role</a></li>
|
45
48
|
<li><a href="{% link _docs/extras/dockerfile-erb.md %}">Dockerfile.erb</a></li>
|
49
|
+
<li><a href="{% link _docs/extras/notification-arns.md %}">Notification Arns</a></li>
|
46
50
|
</ul>
|
47
51
|
</li>
|
48
52
|
<li><a href="{% link _docs/upgrading.md %}">Upgrading</a>
|
@@ -58,13 +58,12 @@ A more detailed post is available here: [How to Create Unlimited Extra Environme
|
|
58
58
|
[--elb=ELB] # Decides to create elb, not create elb or use existing target group.
|
59
59
|
[--elb-eip-ids=one two three] # EIP Allocation ids to use for network load balancer.
|
60
60
|
[--elb-type=ELB_TYPE] # ELB type: application or network. Keep current deployed elb type when not specified.
|
61
|
-
[--pretty], [--no-pretty] # Pretty format the json for the task definitions
|
62
|
-
# Default: true
|
63
61
|
[--scheduling-strategy=SCHEDULING_STRATEGY] # Scheduling strategy to use for the service. IE: replica, daemon
|
64
62
|
[--stop-old-tasks], [--no-stop-old-tasks] # Stop old tasks as part of deployment to speed it up
|
65
63
|
[--task=TASK] # ECS task name, to override the task name convention.
|
66
64
|
[--wait], [--no-wait] # Wait for deployment to complete
|
67
65
|
# Default: true
|
66
|
+
[--image-override=IMAGE_OVERRIDE] # Override image in task definition for quick testing
|
68
67
|
[--register], [--no-register] # Register task definition
|
69
68
|
# Default: true
|
70
69
|
[--build], [--no-build] # Build task definition
|
data/docs/_reference/ufo-init.md
CHANGED
@@ -52,7 +52,7 @@ The `image` is the base portion of image name that will be pushed to the docker
|
|
52
52
|
|
53
53
|
The generated `tongueroo/demo-ufo:ufo-2018-02-08T21-04-02-3c86158` image name gets pushed to the docker registry.
|
54
54
|
|
55
|
-
The `--vpc-id`
|
55
|
+
The `--vpc-id`, `--ecs-subnets`, and `--elb-subnets` options are optional but very useful. If not specified then ufo will use the default vpc for the network settings like subnets and security groups, which might not be what you want.
|
56
56
|
|
57
57
|
## Directory Structure
|
58
58
|
|
@@ -0,0 +1,40 @@
|
|
1
|
+
---
|
2
|
+
title: ufo logs
|
3
|
+
reference: true
|
4
|
+
---
|
5
|
+
|
6
|
+
## Usage
|
7
|
+
|
8
|
+
ufo logs
|
9
|
+
|
10
|
+
## Description
|
11
|
+
|
12
|
+
Prints out logs
|
13
|
+
|
14
|
+
## Examples
|
15
|
+
|
16
|
+
ufo logs demo-web
|
17
|
+
|
18
|
+
If you have a current service name set.
|
19
|
+
|
20
|
+
ufo current --service demo-web
|
21
|
+
ufo logs # follow by default
|
22
|
+
ufo logs --no-follow
|
23
|
+
ufo logs --format detailed # to show stream too
|
24
|
+
|
25
|
+
|
26
|
+
## Options
|
27
|
+
|
28
|
+
```
|
29
|
+
[--follow], [--no-follow] # Whether to continuously poll for new logs. To exit from this mode, use Control-C.
|
30
|
+
# Default: true
|
31
|
+
[--since=SINCE] # From what time to begin displaying logs. By default, logs will be displayed starting from 1 minutes in the past. The value provided can be an ISO 8601 timestamp or a relative time.
|
32
|
+
[--format=FORMAT] # The format to display the logs. IE: detailed or short. With detailed, the log stream name is also shown.
|
33
|
+
# Default: detailed
|
34
|
+
[--filter-pattern=FILTER_PATTERN] # The filter pattern to use. If not provided, all the events are matched
|
35
|
+
[--verbose], [--no-verbose]
|
36
|
+
[--mute], [--no-mute]
|
37
|
+
[--noop], [--no-noop]
|
38
|
+
[--cluster=CLUSTER] # Cluster. Overrides .ufo/settings.yml.
|
39
|
+
```
|
40
|
+
|
@@ -51,6 +51,8 @@ You only need to specify enough for a match to be found. Ufo searches the 30 mo
|
|
51
51
|
## Options
|
52
52
|
|
53
53
|
```
|
54
|
+
[--wait], [--no-wait] # Wait for deployment to complete
|
55
|
+
# Default: true
|
54
56
|
[--verbose], [--no-verbose]
|
55
57
|
[--mute], [--no-mute]
|
56
58
|
[--noop], [--no-noop]
|
data/docs/_reference/ufo-ship.md
CHANGED
@@ -115,13 +115,12 @@ You can change the scheduling strategy by explicitly specifying it. Otherwise,
|
|
115
115
|
[--elb=ELB] # Decides to create elb, not create elb or use existing target group.
|
116
116
|
[--elb-eip-ids=one two three] # EIP Allocation ids to use for network load balancer.
|
117
117
|
[--elb-type=ELB_TYPE] # ELB type: application or network. Keep current deployed elb type when not specified.
|
118
|
-
[--pretty], [--no-pretty] # Pretty format the json for the task definitions
|
119
|
-
# Default: true
|
120
118
|
[--scheduling-strategy=SCHEDULING_STRATEGY] # Scheduling strategy to use for the service. IE: replica, daemon
|
121
119
|
[--stop-old-tasks], [--no-stop-old-tasks] # Stop old tasks as part of deployment to speed it up
|
122
120
|
[--task=TASK] # ECS task name, to override the task name convention.
|
123
121
|
[--wait], [--no-wait] # Wait for deployment to complete
|
124
122
|
# Default: true
|
123
|
+
[--image-override=IMAGE_OVERRIDE] # Override image in task definition for quick testing
|
125
124
|
[--verbose], [--no-verbose]
|
126
125
|
[--mute], [--no-mute]
|
127
126
|
[--noop], [--no-noop]
|
@@ -55,12 +55,11 @@ Note: The `--task` option is not used with the `ufo ships` command.
|
|
55
55
|
[--elb=ELB] # Decides to create elb, not create elb or use existing target group.
|
56
56
|
[--elb-eip-ids=one two three] # EIP Allocation ids to use for network load balancer.
|
57
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
58
|
[--scheduling-strategy=SCHEDULING_STRATEGY] # Scheduling strategy to use for the service. IE: replica, daemon
|
61
59
|
[--stop-old-tasks], [--no-stop-old-tasks] # Stop old tasks as part of deployment to speed it up
|
62
60
|
[--task=TASK] # ECS task name, to override the task name convention.
|
63
61
|
[--wait], [--no-wait] # Wait for deployment to complete
|
62
|
+
[--image-override=IMAGE_OVERRIDE] # Override image in task definition for quick testing
|
64
63
|
[--verbose], [--no-verbose]
|
65
64
|
[--mute], [--no-mute]
|
66
65
|
[--noop], [--no-noop]
|
@@ -173,7 +173,6 @@ If you need to modify the task definition template to suite your own needs it is
|
|
173
173
|
## Options
|
174
174
|
|
175
175
|
```
|
176
|
-
[--
|
177
|
-
# Default: true
|
176
|
+
[--image-override=IMAGE_OVERRIDE] # Override image in task definition for quick testing
|
178
177
|
```
|
179
178
|
|
data/docs/articles.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
---
|
2
2
|
title: Articles
|
3
|
-
nav_order:
|
3
|
+
nav_order: 46
|
4
4
|
---
|
5
5
|
|
6
6
|
* [How to Create Unlimited Extra Environments
|
@@ -11,4 +11,4 @@ nav_order: 45
|
|
11
11
|
* [Heroku vs ECS Fargate vs EC2 On-Demand vs EC2 Spot Pricing Comparison](https://blog.boltops.com/2018/04/22/heroku-vs-ecs-fargate-vs-ec2-on-demand-vs-ec2-spot-pricing-comparison)
|
12
12
|
* [Ufo Ship on AWS ECS Presentation](http://www.slideshare.net/tongueroo/ufo-ship-for-aws-ecs-70885296)
|
13
13
|
|
14
|
-
{% include prev_next.md %}
|
14
|
+
{% include prev_next.md %}
|
data/docs/docs.md
CHANGED
data/docs/quick-start.md
CHANGED
@@ -26,6 +26,7 @@ This quickstart assumes:
|
|
26
26
|
|
27
27
|
* You have push access to the repo. Refer to the Notes "Repo Push Access" section below for more info.
|
28
28
|
* The `ecsTaskExecutionRole` needs to exist on your AWS account. If you do not have an ecsTaskExecutionRole yet, create one by following: [Create ecsTaskExecutionRole with AWS CLI]({% link _docs/aws-ecs-task-execution-role.md %}).
|
29
|
+
* The ECS Cluster is in the default VPC. If it is not you need to use the `--vpc-id`, `--ecs-subnets`, and `--elb-subnets` options in the [ufo init]({% link _reference/ufo-init.md %}) command.
|
29
30
|
|
30
31
|
## What Happened
|
31
32
|
|
@@ -129,4 +130,4 @@ Here's an article that compares the cost of ECS Fargate: [Heroku vs ECS Fargate
|
|
129
130
|
|
130
131
|
{% include repo_push_access.md %}
|
131
132
|
|
132
|
-
{% include prev_next.md %}
|
133
|
+
{% include prev_next.md %}
|
data/docs/reference.md
CHANGED
@@ -12,6 +12,7 @@ title: CLI Reference
|
|
12
12
|
* [ufo destroy]({% link _reference/ufo-destroy.md %})
|
13
13
|
* [ufo docker]({% link _reference/ufo-docker.md %})
|
14
14
|
* [ufo init]({% link _reference/ufo-init.md %})
|
15
|
+
* [ufo logs]({% link _reference/ufo-logs.md %})
|
15
16
|
* [ufo network]({% link _reference/ufo-network.md %})
|
16
17
|
* [ufo ps]({% link _reference/ufo-ps.md %})
|
17
18
|
* [ufo releases]({% link _reference/ufo-releases.md %})
|
@@ -13,6 +13,7 @@ base:
|
|
13
13
|
# replacment might not work. For example, adding and removing a load balancer.
|
14
14
|
# In these cases, you must delete the entire ecs service and recreate it.
|
15
15
|
stack_naming: append_env
|
16
|
+
auto_camelize: false # new default setting in ufo v5
|
16
17
|
|
17
18
|
development:
|
18
19
|
# cluster: development
|
@@ -3,38 +3,38 @@
|
|
3
3
|
# CloudFormation. These options are inserting into the generated template.
|
4
4
|
# More info: https://ufoships.com/docs/customize-cloudformation
|
5
5
|
|
6
|
-
|
7
|
-
|
6
|
+
Elb:
|
7
|
+
Scheme: internet-facing
|
8
8
|
|
9
9
|
# https://docs.aws.amazon.com/fr_fr/elasticloadbalancing/latest/APIReference/API_CreateTargetGroup.html
|
10
10
|
#
|
11
11
|
# When using SSL with network elb, the target group protocol is usually http still
|
12
12
|
# unless you also handle SSL termination at the app level.
|
13
|
-
|
14
|
-
|
15
|
-
#
|
13
|
+
TargetGroup:
|
14
|
+
Port: 80 # only used with ECS if awsvpc mode
|
15
|
+
# Protocol: TCP # valid values - application elb: HTTP HTTPS, network elb: TCP
|
16
16
|
# ufo sets defaults in cloudformation template
|
17
17
|
# application elb: HTTP
|
18
18
|
# network elb: TCP
|
19
19
|
# so we can keep this commented out, unless we need HTTPS at the app level
|
20
20
|
# Health check settings are supported by application load balancer only:
|
21
|
-
#
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
#
|
26
|
-
#
|
27
|
-
|
28
|
-
-
|
29
|
-
|
21
|
+
# HealthCheckPath: /up # health check
|
22
|
+
HealthCheckIntervalSeconds: 10 # default: 30. Network ELB can only take 10 or 30
|
23
|
+
HealthyThresholdCount: 2
|
24
|
+
UnhealthyThresholdCount: 2 # default: 10
|
25
|
+
# HealthCheckProtocol: HTTP # HTTP or HTTPS
|
26
|
+
# HealthCheckPort: traffic-port
|
27
|
+
TargetGroupAttributes:
|
28
|
+
- Key: deregistration_delay.timeout_seconds
|
29
|
+
Value: 10
|
30
30
|
|
31
31
|
# https://docs.aws.amazon.com/fr_fr/elasticloadbalancing/latest/APIReference/API_CreateListener.html
|
32
32
|
#
|
33
33
|
# This is the default listener and normally should listen to port 80.
|
34
|
-
|
35
|
-
|
34
|
+
Listener:
|
35
|
+
Port: 80
|
36
36
|
# For Application Load Balancers, the supported protocols are HTTP and HTTPS. For Network Load Balancers, the supported protocol is TCP.
|
37
|
-
#
|
37
|
+
# Protocol: TCP # valid values - application elb: HTTP HTTPS, network elb: TCP, TLS
|
38
38
|
# ufo sets these defaults:
|
39
39
|
# application elb: HTTP # unless port is 443
|
40
40
|
# application elb: HTTPS # if port is 443
|
@@ -43,8 +43,8 @@ listener:
|
|
43
43
|
# Can keep protocol commented out,
|
44
44
|
# unless need to override the defaults.
|
45
45
|
# If using the listener to handle SSL
|
46
|
-
#
|
47
|
-
# -
|
46
|
+
# Certificates:
|
47
|
+
# - CertificateArn: arn:aws:acm:us-east-1:111111111111:certificate/11111111-2222-3333-4444-555555555555
|
48
48
|
|
49
49
|
# An optional second listener can be created.
|
50
50
|
# If HTTPS and SSL is required then the listener_ssl config is what you should use.
|
@@ -53,11 +53,11 @@ listener:
|
|
53
53
|
# to handle SSL termination.
|
54
54
|
#
|
55
55
|
# ufo creates an ssl listener when listener_ssl is set.
|
56
|
-
#
|
57
|
-
#
|
58
|
-
# #
|
59
|
-
# # -
|
60
|
-
# #
|
56
|
+
# ListenerSsl:
|
57
|
+
# Port: 443
|
58
|
+
# # Certificates:
|
59
|
+
# # - CertificateArn: arn:aws:acm:us-east-1:111111111111:certificate/11111111-2222-3333-4444-555555555555
|
60
|
+
# # Protocol: TCP # valid values - application elb: HTTP HTTPS, network elb: TCP, TLS
|
61
61
|
# # ufo handles setting the defaults:
|
62
62
|
# # application elb: HTTPS
|
63
63
|
# # network elb: TLS
|
@@ -66,7 +66,7 @@ listener:
|
|
66
66
|
# Note, the route53 record set for the domain name must already exist.
|
67
67
|
# The {stack_name} variable gets replaced with the name of the CloudFormation stack name.
|
68
68
|
# Example: {stack_name} => demo-web
|
69
|
-
#
|
70
|
-
#
|
71
|
-
#
|
69
|
+
# Dns:
|
70
|
+
# Name: "{stack_name}.yourdomain."
|
71
|
+
# HostedZoneName: yourdomain. # dont forget the trailing period
|
72
72
|
# TTL: '60' # ttl has special upcase casing
|
@@ -15,3 +15,12 @@ elb_subnets: # defaults to same subnets as ecs_subnets when not set
|
|
15
15
|
# ecs_security_groups:
|
16
16
|
# - sg-bbb
|
17
17
|
# - sg-ccc
|
18
|
+
|
19
|
+
# Also supports extra security groups specific to each ECS service
|
20
|
+
# ecs_security_groups:
|
21
|
+
# demo-web:
|
22
|
+
# - sg-bbb
|
23
|
+
# - sg-ccc
|
24
|
+
# demo-worker:
|
25
|
+
# - sg-bbb
|
26
|
+
# - sg-ccc
|
@@ -2,6 +2,7 @@
|
|
2
2
|
# More info on how variables work: http://ufoships.com/docs/variables/
|
3
3
|
@image = helper.full_image_name # includes the git sha tongueroo/demo-ufo:ufo-[sha].
|
4
4
|
@environment = helper.env_file(".env")
|
5
|
+
@secrets = helper.secrets_file(".secrets")
|
5
6
|
<% if @options[:launch_type] == "fargate" -%>
|
6
7
|
# Ensure that the cpu and memory values are a supported combination by Fargate.
|
7
8
|
# More info: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-cpu-memory-error.html"
|
data/lib/ufo.rb
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
$stdout.sync = true unless ENV["UFO_STDOUT_SYNC"] == "0"
|
2
2
|
|
3
3
|
$:.unshift(File.expand_path('../', __FILE__))
|
4
|
-
require '
|
4
|
+
require 'active_support/core_ext/class'
|
5
|
+
require 'deep_merge/rails_compat'
|
5
6
|
require 'fileutils'
|
6
7
|
require 'memoist'
|
7
8
|
require 'rainbow/ext/string'
|
data/lib/ufo/autoloader.rb
CHANGED
@@ -14,8 +14,17 @@ module Ufo
|
|
14
14
|
loader = Zeitwerk::Loader.new
|
15
15
|
loader.inflector = Inflector.new
|
16
16
|
loader.push_dir(File.dirname(__dir__)) # lib
|
17
|
+
|
18
|
+
helpers = "#{ufo_root}/.ufo/helpers"
|
19
|
+
loader.push_dir(helpers) if File.exist?(helpers) # project helpers
|
20
|
+
|
17
21
|
loader.setup
|
18
22
|
end
|
23
|
+
|
24
|
+
# Autoloader runs so early that Ufo.root is not available, so we must declare it here
|
25
|
+
def ufo_root
|
26
|
+
ENV['UFO_ROOT'] || '.'
|
27
|
+
end
|
19
28
|
end
|
20
29
|
end
|
21
30
|
end
|
data/lib/ufo/cli.rb
CHANGED
@@ -37,11 +37,11 @@ module Ufo
|
|
37
37
|
option :elb, desc: "Decides to create elb, not create elb or use existing target group."
|
38
38
|
option :elb_eip_ids, type: :array, desc: "EIP Allocation ids to use for network load balancer."
|
39
39
|
option :elb_type, desc: "ELB type: application or network. Keep current deployed elb type when not specified."
|
40
|
-
option :pretty, type: :boolean, default: true, desc: "Pretty format the json for the task definitions"
|
41
40
|
option :scheduling_strategy, desc: "Scheduling strategy to use for the service. IE: replica, daemon"
|
42
41
|
option :stop_old_tasks, type: :boolean, default: false, desc: "Stop old tasks as part of deployment to speed it up"
|
43
42
|
option :task, desc: "ECS task name, to override the task name convention."
|
44
43
|
option :wait, type: :boolean, desc: "Wait for deployment to complete", default: true
|
44
|
+
option :image_override, desc: "Override image in task definition for quick testing"
|
45
45
|
end
|
46
46
|
|
47
47
|
desc "deploy SERVICE", "Deploy task definition to ECS service without re-building the definition."
|
@@ -75,6 +75,7 @@ module Ufo
|
|
75
75
|
|
76
76
|
desc "rollback SERVICE VERSION", "Rolls back to older task definition."
|
77
77
|
long_desc Help.text(:rollback)
|
78
|
+
option :wait, type: :boolean, desc: "Wait for deployment to complete", default: true
|
78
79
|
def rollback(service=:current, version)
|
79
80
|
service = service == :current ? Current.service! : service
|
80
81
|
rollback = Rollback.new(service, options.merge(version: version))
|
@@ -187,6 +188,16 @@ module Ufo
|
|
187
188
|
Status.new(service, options).run
|
188
189
|
end
|
189
190
|
|
191
|
+
desc "logs", "Prints out logs"
|
192
|
+
long_desc Help.text(:logs)
|
193
|
+
option :follow, default: true, type: :boolean, desc: " Whether to continuously poll for new logs. To exit from this mode, use Control-C."
|
194
|
+
option :since, desc: "From what time to begin displaying logs. By default, logs will be displayed starting from 1 minutes in the past. The value provided can be an ISO 8601 timestamp or a relative time."
|
195
|
+
option :format, default: "detailed", desc: "The format to display the logs. IE: detailed or short. With detailed, the log stream name is also shown."
|
196
|
+
option :filter_pattern, desc: "The filter pattern to use. If not provided, all the events are matched"
|
197
|
+
def logs(service=:current)
|
198
|
+
Logs.new(service, options).run
|
199
|
+
end
|
200
|
+
|
190
201
|
desc "completion *PARAMS", "Prints words for auto-completion."
|
191
202
|
long_desc Help.text("completion")
|
192
203
|
def completion(*params)
|
data/lib/ufo/command.rb
CHANGED
@@ -77,6 +77,13 @@ module Ufo
|
|
77
77
|
def website
|
78
78
|
"http://ufoships.com"
|
79
79
|
end
|
80
|
+
|
81
|
+
# https://github.com/erikhuda/thor/issues/244
|
82
|
+
# Deprecation warning: Thor exit with status 0 on errors. To keep this behavior, you must define `exit_on_failure?` in `Lono::CLI`
|
83
|
+
# You can silence deprecations warning by setting the environment variable THOR_SILENCE_DEPRECATION.
|
84
|
+
def exit_on_failure?
|
85
|
+
true
|
86
|
+
end
|
80
87
|
end
|
81
88
|
end
|
82
89
|
end
|
data/lib/ufo/core.rb
CHANGED
@@ -4,6 +4,7 @@ require 'yaml'
|
|
4
4
|
module Ufo
|
5
5
|
module Core
|
6
6
|
extend Memoist
|
7
|
+
include Ufo::Settings
|
7
8
|
|
8
9
|
def check_task_definition!(task_definition)
|
9
10
|
task_definition_path = "#{Ufo.root}/.ufo/output/#{task_definition}.json"
|
@@ -49,15 +50,6 @@ module Ufo
|
|
49
50
|
end
|
50
51
|
end
|
51
52
|
|
52
|
-
def settings
|
53
|
-
Setting.new.data
|
54
|
-
end
|
55
|
-
memoize :settings
|
56
|
-
|
57
|
-
def cfn_profile
|
58
|
-
settings[:cfn_profile] || "default"
|
59
|
-
end
|
60
|
-
|
61
53
|
def check_ufo_project!
|
62
54
|
check_path = "#{Ufo.root}/.ufo/settings.yml"
|
63
55
|
unless File.exist?(check_path)
|
data/lib/ufo/docker/cleaner.rb
CHANGED