ufo 4.5.11 → 4.6.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 +4 -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/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 +1 -1
- 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 +1 -1
- 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 +1 -1
- 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 +1 -0
- data/docs/_reference/ufo-logs.md +39 -0
- data/docs/articles.md +2 -2
- data/docs/docs.md +1 -1
- data/docs/quick-start.md +1 -1
- data/docs/reference.md +1 -0
- data/lib/ufo/cli.rb +9 -0
- data/lib/ufo/help/logs.md +10 -0
- data/lib/ufo/logs.rb +55 -0
- data/lib/ufo/version.rb +1 -1
- 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/ufo.gemspec +1 -0
- metadata +27 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e191dff1d9d879e6c78eb6062dbdf8440efcc3a1178125af01aaf807e6632e2c
|
4
|
+
data.tar.gz: 9656eee37d6155be650e7292692db31fe54797c1cf6ea5d9b8f75917ffb0dc7f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3769a6dedd2cb9100c4531a820dd9c1b848acb84a58186d546a7825c4d96765b2a1a8239d6883bfa7e346e2577ed4a0b4d95da29375a266bb13637dbcafd6428
|
7
|
+
data.tar.gz: b5a48692922794b70328f73153c80f09475c91468e1432f4103d56b80bc5e40f10ef92301e711ee1806e41a1be0987b21b5f1c979371a31ae9b72cc1dbf437e6
|
data/CHANGELOG.md
CHANGED
@@ -3,6 +3,10 @@
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
4
4
|
This project *tries* to adhere to [Semantic Versioning](http://semver.org/), even before v1.0.
|
5
5
|
|
6
|
+
## [4.6.0]
|
7
|
+
- #95 Introduce: ufo logs command. Tail logs.
|
8
|
+
- #96 docs and options
|
9
|
+
|
6
10
|
## [4.5.11]
|
7
11
|
- add mfa support for normal IAM user
|
8
12
|
|
data/README.md
CHANGED
@@ -8,6 +8,8 @@
|
|
8
8
|
[![Join the chat at https://gitter.im/tongueroo/ufo](https://badges.gitter.im/tongueroo/ufo.svg)](https://gitter.im/tongueroo/ufo?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
9
9
|
[![Support](https://img.shields.io/badge/get-support-blue.svg)](https://boltops.com?utm_source=badge&utm_medium=badge&utm_campaign=ufo)
|
10
10
|
|
11
|
+
[![BoltOps Badge](https://img.boltops.com/boltops/badges/boltops-badge.png)](https://www.boltops.com)
|
12
|
+
|
11
13
|
Ufo is a tool that builds Docker images and deploys them to [AWS ECS](https://aws.amazon.com/ecs/). The main command is `ufo ship`. Here's summary of what it does:
|
12
14
|
|
13
15
|
1. Builds a docker image.
|
data/docs/_docs/conventions.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
---
|
2
2
|
title: CodeBuild IAM Role
|
3
|
-
nav_order:
|
3
|
+
nav_order: 32
|
4
4
|
---
|
5
5
|
|
6
6
|
Note, the `/tmp/ecs-deploy-policy.json` policy is available at [Minimal Deploy IAM]({% link _docs/extras/minimal-deploy-iam.md %}).
|
@@ -43,4 +43,4 @@ Create the IAM resources:
|
|
43
43
|
|
44
44
|
The `attach-role-policy` command attaches a Customer Managed IAM policy to the IAM role. This is a little more reusable than using an inline policy.
|
45
45
|
|
46
|
-
{% include prev_next.md %}
|
46
|
+
{% include prev_next.md %}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
---
|
2
2
|
title: Dynamic Dockerfile.erb
|
3
|
-
nav_order:
|
3
|
+
nav_order: 33
|
4
4
|
---
|
5
5
|
|
6
6
|
Sometimes you may need a little more dynamic control of your Dockerfile. For these cases, ufo supports dynamically creating a Dockerfile from a Dockerfile.erb. If Dockerfile.erb exists, ufo uses it to generate a Dockerfile as a part of the build process. These means that you should update the source Dockerfile.erb instead, as the Dockerfile will be overwritten. If Dockerfile.erb does not exist, then ufo will use the Dockerfile instead.
|
@@ -57,4 +57,4 @@ Why not use [build args](https://www.jeffgeerling.com/blog/2017/use-arg-dockerfi
|
|
57
57
|
|
58
58
|
Ufo uses a YAML file so users will not have to remember to provide the build arg. It is also easy to update the `dockerfile_variables.yml` with the `ufo docker base` command.
|
59
59
|
|
60
|
-
{% include prev_next.md %}
|
60
|
+
{% include prev_next.md %}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
---
|
2
2
|
title: ECS Network Mode
|
3
|
-
nav_order:
|
3
|
+
nav_order: 27
|
4
4
|
---
|
5
5
|
|
6
6
|
## Pros and Cons: bridge network mode
|
@@ -34,4 +34,4 @@ awsvpc | Fine grain security group permissions for each ECS service. | The numbe
|
|
34
34
|
|
35
35
|
It is generally recommended to use awsvpc mode with ENI trunking supported instances. You get the best of both worlds in this situation: a strong security posture as well as container density.
|
36
36
|
|
37
|
-
{% include prev_next.md %}
|
37
|
+
{% include prev_next.md %}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
---
|
2
2
|
title: Load Balancer Support
|
3
|
-
nav_order:
|
3
|
+
nav_order: 25
|
4
4
|
---
|
5
5
|
|
6
6
|
Ufo can automatically create a load balancer and associate it with an ECS service. The options:
|
@@ -80,4 +80,4 @@ Under the hood, ufo implements load balancer support with CloudFormation. You ca
|
|
80
80
|
|
81
81
|
<img src="/img/docs/cloudformation-resources.png" class="doc-photo" />
|
82
82
|
|
83
|
-
{% include prev_next.md %}
|
83
|
+
{% include prev_next.md %}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
---
|
2
2
|
title: Minimal Deploy IAM Policy
|
3
|
-
nav_order:
|
3
|
+
nav_order: 31
|
4
4
|
---
|
5
5
|
|
6
6
|
The IAM user you use to run the `ufo ship` command needs a minimal set of IAM policies in order to deploy to ECS. Here is a table of the baseline services needed:
|
@@ -76,4 +76,4 @@ If you are using CodeBuild to deploy, you'll probably be interested the IAM poli
|
|
76
76
|
This page refers to your **user** IAM policy used when running `ufo ship`. These are different from the IAM Policies associated with ECS Task. For those iam policies refer to [IAM Roles for Tasks
|
77
77
|
](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-iam-roles.html).
|
78
78
|
|
79
|
-
{% include prev_next.md %}
|
79
|
+
{% include prev_next.md %}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
---
|
2
2
|
title: Redirection Support
|
3
|
-
nav_order:
|
3
|
+
nav_order: 30
|
4
4
|
---
|
5
5
|
|
6
6
|
## Application Load Balancers
|
@@ -24,4 +24,4 @@ listener:
|
|
24
24
|
|
25
25
|
Network Load Balancers work at layer 4, so they do not support redirection. Instead you need to handle redirection within your app.
|
26
26
|
|
27
|
-
{% include prev_next.md %}
|
27
|
+
{% include prev_next.md %}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
---
|
2
2
|
title: Route53 Support
|
3
|
-
nav_order:
|
3
|
+
nav_order: 29
|
4
4
|
---
|
5
5
|
|
6
6
|
Ufo can create a "pretty" route53 record and set it's value to the created ELB DNS name. This is done by configuring the `.ufo/settings/cfn/default.yml` file. Example:
|
@@ -24,4 +24,4 @@ Results in:
|
|
24
24
|
aws route53 create-hosted-zone --name mydomain.com --caller-reference $(date +%s)
|
25
25
|
aws route53 list-hosted-zones
|
26
26
|
|
27
|
-
{% include prev_next.md %}
|
27
|
+
{% include prev_next.md %}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
---
|
2
2
|
title: Security Groups
|
3
|
-
nav_order:
|
3
|
+
nav_order: 26
|
4
4
|
---
|
5
5
|
|
6
6
|
Ufo creates and manages two security groups. One for the ELB and one for the ECS tasks.
|
@@ -33,4 +33,4 @@ In general, ports below 32768 are outside of the ephemeral port range. So an eas
|
|
33
33
|
|
34
34
|
If you are using a network load balancer and are running bridge network mode, then you need to whitelist ports 32768 to 65535 to `0.0.0.0/0`. This is because network load balancers operate at layer 4 of the OSI model and cannot be assigned security groups, so they use the security group of the instance. If you feel this is too loose of permissions, you can use awsvpc mode. There are some considerations for awsvpc mode though which is discussed next.
|
35
35
|
|
36
|
-
{% include prev_next.md %}
|
36
|
+
{% include prev_next.md %}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
---
|
2
2
|
title: SSL Support
|
3
|
-
nav_order:
|
3
|
+
nav_order: 28
|
4
4
|
---
|
5
5
|
|
6
6
|
You can configure SSL support by uncomment the `listener_ssl` option in `.ufo/settings/cfn/default.yml`. Here's an example:
|
@@ -17,4 +17,4 @@ For the certificate arn, you will need to create a certificate with AWS ACM. To
|
|
17
17
|
|
18
18
|
The protocol will be either HTTP or HTTPS for Application Load Balancers and TCP or TLS for Network Load Balancers. Ufo will infer the right value, so you usually don't have to configure the protocol manually. You can configure it if required though.
|
19
19
|
|
20
|
-
{% include prev_next.md %}
|
20
|
+
{% include prev_next.md %}
|
data/docs/_docs/faq.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
---
|
2
2
|
title: FAQ
|
3
|
-
nav_order:
|
3
|
+
nav_order: 45
|
4
4
|
---
|
5
5
|
|
6
6
|
**Q: Is AWS ECS Fargate supported?**
|
@@ -97,4 +97,4 @@ Also, you might have to enable the log driver by adding the ECS_AVAILABLE_LOGGIN
|
|
97
97
|
|
98
98
|
Hope that helps.
|
99
99
|
|
100
|
-
{% include prev_next.md %}
|
100
|
+
{% include prev_next.md %}
|
data/docs/_docs/helpers.md
CHANGED
@@ -19,4 +19,4 @@ To call the helper in task_definitions.rb you must add `helper.` in front. So `
|
|
19
19
|
|
20
20
|
The 2 classes which provide these special helper methods are in [ufo/dsl.rb](https://github.com/tongueroo/ufo/blob/master/lib/ufo/dsl.rb) and [ufo/dsl/helper.rb](https://github.com/tongueroo/ufo/blob/master/lib/ufo/dsl/helper.rb). Refer to these classes for the full list of the helper methods.
|
21
21
|
|
22
|
-
{% include prev_next.md %}
|
22
|
+
{% include prev_next.md %}
|
data/docs/_docs/install.md
CHANGED
@@ -32,4 +32,4 @@ For more information about the Bolts Toolbelt or to get an installer for another
|
|
32
32
|
* Docker: You will need a working version of [Docker](https://docs.docker.com/engine/installation/) installed as ufo shells out and calls the `docker` command.
|
33
33
|
* AWS: Set up your AWS credentials at `~/.aws/credentials` and `~/.aws/config`. This is the [AWS standard way of setting up credentials](https://aws.amazon.com/blogs/security/a-new-and-standardized-way-to-manage-credentials-in-the-aws-sdks/).
|
34
34
|
|
35
|
-
{% include prev_next.md %}
|
35
|
+
{% include prev_next.md %}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
---
|
2
2
|
title: Auto Completion
|
3
|
-
nav_order:
|
3
|
+
nav_order: 44
|
4
4
|
---
|
5
5
|
|
6
6
|
Ufo supports bash auto-completion. To set it up add the following to your `~/.profile` or `.bashrc`:
|
@@ -21,4 +21,4 @@ Auto Completion examples:
|
|
21
21
|
ufo tasks [TAB]
|
22
22
|
ufo tasks build [TAB]
|
23
23
|
|
24
|
-
{% include prev_next.md %}
|
24
|
+
{% include prev_next.md %}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
---
|
2
2
|
title: Automated Clean Up
|
3
|
-
nav_order:
|
3
|
+
nav_order: 43
|
4
4
|
---
|
5
5
|
|
6
6
|
Ufo can be configured to automatically clean old images from the ECR registry after the deploy completes by configuring your [settings.yml]({% link _docs/settings.md %}) file like so:
|
@@ -11,4 +11,4 @@ ecr_keep: 30
|
|
11
11
|
|
12
12
|
Automated Docker images clean up only works if you are using ECR registry.
|
13
13
|
|
14
|
-
{% include prev_next.md %}
|
14
|
+
{% include prev_next.md %}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
---
|
2
2
|
title: Customize CloudFormation
|
3
|
-
nav_order:
|
3
|
+
nav_order: 38
|
4
4
|
---
|
5
5
|
|
6
6
|
Under the hood, ufo creates most of the required resources with a CloudFormation stack. This includes the ELB, Target Group, Listener, Security Groups, ECS Service, and Route 53 records. You might need to customize these resources. Here are the ways to customize the resources that ufo creates.
|
@@ -32,4 +32,4 @@ UFO_ENV_EXTRA=2 ufo ship demo-web -\-cluster dev | demo-web-development-2
|
|
32
32
|
|
33
33
|
The CloudFormation stack is currently generated from a template. The source code for this template is located at [cfn/stack.yml](https://github.com/tongueroo/ufo/blob/master/lib/cfn/stack.yml). This implementation might change in the future.
|
34
34
|
|
35
|
-
{% include prev_next.md %}
|
35
|
+
{% include prev_next.md %}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
---
|
2
2
|
title: Database Migrations
|
3
|
-
nav_order:
|
3
|
+
nav_order: 42
|
4
4
|
---
|
5
5
|
|
6
6
|
A common task is to run database migrations with newer code before deploying the code. This is easily achieved with the `ufo task` command. Here's an example:
|
@@ -22,4 +22,4 @@ The `ufo task` command is generalized so you can run any one-off task. It is not
|
|
22
22
|
2. Registers the ECS Task definition
|
23
23
|
3. Runs a one-off ECS Task
|
24
24
|
|
25
|
-
{% include prev_next.md %}
|
25
|
+
{% include prev_next.md %}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
---
|
2
2
|
title: Run in Pieces
|
3
|
-
nav_order:
|
3
|
+
nav_order: 40
|
4
4
|
---
|
5
5
|
|
6
6
|
The `ufo ship` command goes through a few stages:
|
@@ -27,4 +27,4 @@ Update the service with the task definitions in `.ufo/output` untouched.
|
|
27
27
|
|
28
28
|
Note if you use the `ufo deploy` you should ensure that you have already pushed the docker image to your docker registry. Or else the task will not be able to spin up because the docker image does not exist. This is one of the reasons it is recommended that you use `ufo ship`.
|
29
29
|
|
30
|
-
{% include prev_next.md %}
|
30
|
+
{% include prev_next.md %}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
---
|
2
2
|
title: Run Single Task
|
3
|
-
nav_order:
|
3
|
+
nav_order: 41
|
4
4
|
---
|
5
5
|
|
6
6
|
Sometimes you do not want to run a long running `service` but a one time task. Running Rails migrations are an example of a one off task. Here is an example of how you would run a one time task.
|
@@ -22,4 +22,4 @@ You can describe that task for more details:
|
|
22
22
|
|
23
23
|
You can check out the [ufo task](http://ufoships.com/reference/ufo-task/) reference for more details.
|
24
24
|
|
25
|
-
{% include prev_next.md %}
|
25
|
+
{% include prev_next.md %}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
---
|
2
2
|
title: Stuck CloudFormation
|
3
|
-
nav_order:
|
3
|
+
nav_order: 39
|
4
4
|
---
|
5
5
|
|
6
6
|
The CloudFormation stack update or creation can get stuck in a `*_IN_PROGRESS` state for a very long time, like more than an hour. This happens when you deploy an ECS service that fails to stabilize. Usually, this is an error with the Docker container failing to start up successfully.
|
@@ -26,4 +26,4 @@ To cancel a current deploy, run:
|
|
26
26
|
|
27
27
|
This is the same thing as canceling the stack update in the CloudFormation console.
|
28
28
|
|
29
|
-
{% include prev_next.md %}
|
29
|
+
{% include prev_next.md %}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
---
|
2
2
|
title: Why CloudFormation
|
3
|
-
nav_order:
|
3
|
+
nav_order: 37
|
4
4
|
---
|
5
5
|
|
6
6
|
Version 3 of ufo was a simpler implementation and did not make use of CloudFormation to create the ECS service. In version 4, ufo uses CloudFormation to create the ECS Service. This is because ufo became more powerful. Notably, support for Load Balancers was added. With this power, also came added complexity. So the complexity was push onto CloudFormation. Hence, ECS service is implemented as CloudFormation resource in version 4.
|
@@ -18,4 +18,4 @@ You can check the resources created with CloudFormation by clicking on the stack
|
|
18
18
|
|
19
19
|
<img src="/img/docs/cloudformation-resources.png" class="doc-photo" />
|
20
20
|
|
21
|
-
{% include prev_next.md %}
|
21
|
+
{% include prev_next.md %}
|
data/docs/_docs/next-steps.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
---
|
2
2
|
title: Next Steps
|
3
|
-
nav_order:
|
3
|
+
nav_order: 47
|
4
4
|
---
|
5
5
|
|
6
6
|
This concludes the tutorial guide for ufo. Hopefully you are now more comfortable with ufo's basic usage, concepts, and have a feel for the workflow.
|
@@ -13,4 +13,4 @@ From here, there are a few resources that can help you continue along:
|
|
13
13
|
|
14
14
|
Everyone can contribute to make ufo better, including the documentation. These docs are of the same ufo repo in the [docs folder](https://github.com/tongueroo/ufo/tree/master/docs). Please fork the project and open a pull request! We love your pull requests. Contributions are encouraged and welcomed!
|
15
15
|
|
16
|
-
{% include prev_next.md %}
|
16
|
+
{% include prev_next.md %}
|
data/docs/_docs/settings.md
CHANGED
@@ -51,4 +51,4 @@ An interesting option is `aws_profile`. This allows you to tightly connect an A
|
|
51
51
|
|
52
52
|
Normally, the ECS cluster defaults to whatever UFO_ENV is set to by [convention]({% link _docs/conventions.md %}). For example, when `UFO_ENV=production` the ECS Cluster is `production` and when `UFO_ENV=development` the ECS Cluster is `development`. There are several ways to override this behavior. This is detailed in the [Settings Cluster docs]({% link _docs/settings/cluster.md %}).
|
53
53
|
|
54
|
-
{% include prev_next.md %}
|
54
|
+
{% include prev_next.md %}
|
@@ -33,4 +33,4 @@ The binding is two-way. So:
|
|
33
33
|
|
34
34
|
This behavior prevents you from switching `AWS_PROFILE`s, forgetting to switch `UFO_ENV` and then accidentally deploying a production based docker image to development and vice versa because you forgot to also switch `UFO_ENV` to its respective environment.
|
35
35
|
|
36
|
-
{% include prev_next.md %}
|
36
|
+
{% include prev_next.md %}
|
data/docs/_docs/settings/cfn.md
CHANGED
@@ -32,4 +32,4 @@ elb_subnets | Used to create elb load balancer. Defaults to same subnets as ecs
|
|
32
32
|
ecs_security_groups | Additional security groups to associate with the ECS tasks.
|
33
33
|
elb_security_groups | Additional security groups to associate with the ELB.
|
34
34
|
|
35
|
-
{% include prev_next.md %}
|
35
|
+
{% include prev_next.md %}
|
data/docs/_docs/ssl_errors.md
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
---
|
2
2
|
Title: SSL Errors
|
3
|
-
# nav_order:
|
4
3
|
---
|
5
4
|
|
6
5
|
UFO uses the AWS Ruby SDK and the underlying default SSL certificate chain configured in your active Ruby and
|
@@ -38,4 +37,4 @@ Once you have updated OpenSSL and your `brew` packages, use the helper scripts a
|
|
38
37
|
|
39
38
|
The `update-cert-chain.sh` file was created using the suggestions from <https://gemfury.com/help/could-not-verify-ssl-certificate/>. Please review the information at <https://gemfury.com/help/could-not-verify-ssl-certificate/> if the `Helper Scripts` above do not fully resolve your issue.
|
40
39
|
|
41
|
-
The `test-aws-api-access.rb` uses examples from the <https://docs.aws.amazon.com/sdk-for-ruby/v3/developer-guide/quick-start-guide.html> for using and configuring the Ruby AWS SDK on your system.
|
40
|
+
The `test-aws-api-access.rb` uses examples from the <https://docs.aws.amazon.com/sdk-for-ruby/v3/developer-guide/quick-start-guide.html> for using and configuring the Ruby AWS SDK on your system.
|
data/docs/_docs/structure.md
CHANGED
@@ -58,4 +58,4 @@ Docker push took 12s.
|
|
58
58
|
|
59
59
|
Note in order to push the image to a registry you will need to login into the registry. If you are using DockerHub use the `docker login` command. If you are using AWS ECR then ufo automatically calls the `aws ecr get-login` command and authenticates for you.
|
60
60
|
|
61
|
-
{% include prev_next.md %}
|
61
|
+
{% include prev_next.md %}
|
@@ -35,4 +35,4 @@ ufo ships demo-{web,worker,clock}
|
|
35
35
|
|
36
36
|
In the case of the `ufo ships` command the `--wait` option defaults to false so that all the specified ECS services update in parallel. You can check on the status of the update on the CloudFormation console.
|
37
37
|
|
38
|
-
{% include prev_next.md %}
|
38
|
+
{% include prev_next.md %}
|
data/docs/_docs/tutorial.md
CHANGED
data/docs/_docs/ufo-current.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
---
|
2
2
|
title: Ufo Current
|
3
|
-
nav_order:
|
3
|
+
nav_order: 23
|
4
4
|
---
|
5
5
|
|
6
6
|
## service
|
@@ -46,4 +46,4 @@ This can be shorten with with current also.
|
|
46
46
|
ufo current --services demo-web demo-worker demo-clock
|
47
47
|
ufo ships
|
48
48
|
|
49
|
-
{% include prev_next.md %}
|
49
|
+
{% include prev_next.md %}
|
data/docs/_docs/ufo-env-extra.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
---
|
2
2
|
title: UFO_ENV_EXTRA
|
3
|
-
nav_order:
|
3
|
+
nav_order: 22
|
4
4
|
---
|
5
5
|
|
6
6
|
<div class="video-box"><div class="video-container"><iframe src="https://www.youtube.com/embed/UVQuwQGToYE" frameborder="0" allowfullscreen=""></iframe></div></div>
|
@@ -19,4 +19,4 @@ The precedence:
|
|
19
19
|
1. UFO_ENV_EXTRA - takes highest precedence
|
20
20
|
2. `.ufo/current` env-extra setting - takes lower precedence
|
21
21
|
|
22
|
-
{% include prev_next.md %}
|
22
|
+
{% include prev_next.md %}
|
data/docs/_docs/ufo-env.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
---
|
2
2
|
title: UFO_ENV
|
3
|
-
nav_order:
|
3
|
+
nav_order: 21
|
4
4
|
---
|
5
5
|
|
6
6
|
Ufo's behavior is controlled by the `UFO_ENV` environment variable. For example, the `UFO_ENV` variable is used to layer different ufo variable files together to make it easy to specify settings for different environments like production and development. This is covered thoroughly in the [Variables]({% link _docs/variables.md %}) section. `UFO_ENV` defaults to `development` when not set.
|
@@ -45,4 +45,4 @@ AWS_PROFILE=whatever => UFO_ENV=development # since there are no profiles that m
|
|
45
45
|
|
46
46
|
Notice how `AWS_PROFILE=whatever` results in `UFO_ENV=development`. This is because there are no matching aws_profiles in the `settings.yml`. More info on settings is available at [settings]({% link _docs/settings.md %}).
|
47
47
|
|
48
|
-
{% include prev_next.md %}
|
48
|
+
{% include prev_next.md %}
|
@@ -0,0 +1,50 @@
|
|
1
|
+
---
|
2
|
+
title: ufo logs command
|
3
|
+
nav_order: 20
|
4
|
+
---
|
5
|
+
|
6
|
+
The ufo logs command will tail the logs of the ecs service if you are using the awslogs driver.
|
7
|
+
|
8
|
+
## Examples
|
9
|
+
|
10
|
+
$ ufo logs demo-web
|
11
|
+
2020-01-16 23:58:16 UTC 10.20.120.135 - - [16/Jan/2020:23:58:16 +0000] "GET / HTTP/1.1" 200 3 0.0003
|
12
|
+
2020-01-16 23:58:16 UTC 10.20.120.135 - - [16/Jan/2020:23:58:16 UTC] "GET / HTTP/1.1" 200 3
|
13
|
+
2020-01-16 23:58:16 UTC - -> /
|
14
|
+
|
15
|
+
## Current Set
|
16
|
+
|
17
|
+
If you have a current service name set.
|
18
|
+
|
19
|
+
$ ufo current --service demo-web
|
20
|
+
$ ufo logs # follow by default
|
21
|
+
2020-01-16 23:58:16 UTC 10.20.120.135 - - [16/Jan/2020:23:58:16 +0000] "GET / HTTP/1.1" 200 3 0.0003
|
22
|
+
2020-01-16 23:58:16 UTC 10.20.120.135 - - [16/Jan/2020:23:58:16 UTC] "GET / HTTP/1.1" 200 3
|
23
|
+
2020-01-16 23:58:16 UTC - -> /
|
24
|
+
|
25
|
+
## Options
|
26
|
+
|
27
|
+
By default the logs follow and use the simple format without the log stream. Here's how adjust those options:
|
28
|
+
|
29
|
+
ufo logs --no-follow
|
30
|
+
ufo logs --format detailed # to show stream too
|
31
|
+
|
32
|
+
More info: [ufo logs reference]({% link _reference/ufo-logs.md %})
|
33
|
+
|
34
|
+
## awslog driver
|
35
|
+
|
36
|
+
The generated .ufo task definition defaults to the awslogs driver. If you need it, it looks like this:
|
37
|
+
|
38
|
+
```json
|
39
|
+
"logConfiguration": {
|
40
|
+
"logDriver": "awslogs",
|
41
|
+
"options": {
|
42
|
+
"awslogs-group": "<%= @awslogs_group %>",
|
43
|
+
"awslogs-region": "<%= @awslogs_region || 'us-east-1' %>",
|
44
|
+
"awslogs-stream-prefix": "<%= @awslogs_stream_prefix %>"
|
45
|
+
}
|
46
|
+
}
|
47
|
+
```
|
48
|
+
|
49
|
+
|
50
|
+
{% include prev_next.md %}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
---
|
2
2
|
title: Ufo Task Params
|
3
|
-
nav_order:
|
3
|
+
nav_order: 24
|
4
4
|
---
|
5
5
|
|
6
6
|
You can run one off task with the [ufo task](https://ufoships.com/reference/ufo-task/) command.
|
@@ -40,4 +40,4 @@ ERB and [shared variables]({% link _docs/variables.md %}) are available in the p
|
|
40
40
|
|
41
41
|
Note, the params.yml file does not have access to the `task_definition_name` helper method. That is only available in the `task_definitions.rb` template_definition code blocks.
|
42
42
|
|
43
|
-
{% include prev_next.md %}
|
43
|
+
{% include prev_next.md %}
|
data/docs/_docs/upgrading.md
CHANGED
@@ -3,7 +3,7 @@ title: Upgrading to Version 4.5
|
|
3
3
|
short_title: Version 4.5
|
4
4
|
order: 1
|
5
5
|
categories: upgrading
|
6
|
-
nav_order:
|
6
|
+
nav_order: 35
|
7
7
|
---
|
8
8
|
|
9
9
|
In ufo version 4.4 and 4.5, the default cloudformation stack names used by ufo were changed.
|
@@ -49,4 +49,4 @@ Version | Setting
|
|
49
49
|
|
50
50
|
CloudFormation names the resources it creates with the beginning portion of the stack name. When the stack name prepends the environment then resources like ELBs a little bit harder to identify since they might be named something like this `product-Elb-K0LFFQ9LK50W`. It makes it harder to distinguish ELBs from different apps created by ufo.
|
51
51
|
|
52
|
-
{% include prev_next.md %}
|
52
|
+
{% include prev_next.md %}
|
@@ -3,7 +3,7 @@ title: Upgrading to Version 4.0
|
|
3
3
|
short_title: Version 4.0
|
4
4
|
order: 2
|
5
5
|
categories: upgrading
|
6
|
-
nav_order:
|
6
|
+
nav_order: 36
|
7
7
|
---
|
8
8
|
|
9
9
|
A major change in ufo from version 3 to 4 is that the ECS service is now created by CloudFormation. If you have an existing ECS service deployed by ufo version 3, when you deploy your app again with ufo version 4, there will be a new additional ECS service created. Here is the recommended upgrade path.
|
@@ -45,4 +45,4 @@ File | Changes
|
|
45
45
|
.ufo/settings/cfn/default.yml | Starter cfn settings file.
|
46
46
|
.ufo/settings/network/default.yml | This generated file will have the vpc and subnets that you specified above. You can change them directly in this file to control what network settings ufo uses.
|
47
47
|
|
48
|
-
{% include prev_next.md %}
|
48
|
+
{% include prev_next.md %}
|
data/docs/_docs/variables.md
CHANGED
data/docs/_includes/subnav.html
CHANGED
@@ -26,6 +26,7 @@
|
|
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
28
|
<li><a href="{% link _docs/conventions.md %}">Conventions</a></li>
|
29
|
+
<li><a href="{% link _docs/ufo-logs.md %}">Ufo Logs</a></li>
|
29
30
|
<li><a href="{% link _docs/ufo-env.md %}">Ufo Env</a></li>
|
30
31
|
<li><a href="{% link _docs/ufo-env-extra.md %}">Ufo Env Extra</a></li>
|
31
32
|
<li><a href="{% link _docs/ufo-current.md %}">Ufo Current</a></li>
|
@@ -0,0 +1,39 @@
|
|
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: simple
|
34
|
+
[--verbose], [--no-verbose]
|
35
|
+
[--mute], [--no-mute]
|
36
|
+
[--noop], [--no-noop]
|
37
|
+
[--cluster=CLUSTER] # Cluster. Overrides .ufo/settings.yml.
|
38
|
+
```
|
39
|
+
|
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
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 %})
|
data/lib/ufo/cli.rb
CHANGED
@@ -187,6 +187,15 @@ module Ufo
|
|
187
187
|
Status.new(service, options).run
|
188
188
|
end
|
189
189
|
|
190
|
+
desc "logs", "Prints out logs"
|
191
|
+
long_desc Help.text(:logs)
|
192
|
+
option :follow, default: true, type: :boolean, desc: " Whether to continuously poll for new logs. To exit from this mode, use Control-C."
|
193
|
+
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."
|
194
|
+
option :format, default: "simple", desc: "The format to display the logs. IE: detailed or short. With detailed, the log stream name is also shown."
|
195
|
+
def logs(service=:current)
|
196
|
+
Logs.new(service, options).run
|
197
|
+
end
|
198
|
+
|
190
199
|
desc "completion *PARAMS", "Prints words for auto-completion."
|
191
200
|
long_desc Help.text("completion")
|
192
201
|
def completion(*params)
|
data/lib/ufo/logs.rb
ADDED
@@ -0,0 +1,55 @@
|
|
1
|
+
require "aws-logs"
|
2
|
+
|
3
|
+
module Ufo
|
4
|
+
class Logs < Base
|
5
|
+
include AwsService
|
6
|
+
|
7
|
+
delegate :service, to: :info
|
8
|
+
|
9
|
+
def run
|
10
|
+
log = find_log_group_name
|
11
|
+
puts "Showing logs for log group: #{log["awslogs-group"]} and stream prefix #{log["awslogs-stream-prefix"]}"
|
12
|
+
if log
|
13
|
+
cloudwatch_tail(log)
|
14
|
+
else
|
15
|
+
puts "Unable to find log group for service: #{service.service_name}"
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
def find_log_group_name
|
20
|
+
resp = ecs.describe_task_definition(task_definition: info.service.task_definition)
|
21
|
+
|
22
|
+
container_definitions = resp.task_definition.container_definitions
|
23
|
+
|
24
|
+
unless container_definitions.size == 1
|
25
|
+
puts "ERROR: ufo logs command only supports 1 container definition in the ECS task definition".color(:red)
|
26
|
+
return
|
27
|
+
end
|
28
|
+
|
29
|
+
definition = container_definitions.first
|
30
|
+
log_conf = definition.log_configuration
|
31
|
+
|
32
|
+
if log_conf && log_conf.log_driver == "awslogs"
|
33
|
+
# options["awslogs-group"]
|
34
|
+
# options["awslogs-region"]
|
35
|
+
# options["awslogs-stream-prefix"]
|
36
|
+
log_conf.options
|
37
|
+
else
|
38
|
+
puts "Only supports awslogs driver. Detected log_driver: #{log_conf.log_driver}"
|
39
|
+
return
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
def cloudwatch_tail(log={})
|
44
|
+
since = @options[:since] || "10m" # by default, search only 10 mins in the past
|
45
|
+
cw_tail = AwsLogs::Tail.new(
|
46
|
+
log_group_name: log["awslogs-group"],
|
47
|
+
log_stream_name_prefix: log["awslogs-stream-prefix"],
|
48
|
+
since: since,
|
49
|
+
follow: @options[:follow],
|
50
|
+
format: @options[:format],
|
51
|
+
)
|
52
|
+
cw_tail.run
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
data/lib/ufo/version.rb
CHANGED
@@ -0,0 +1,70 @@
|
|
1
|
+
{
|
2
|
+
"task_definition": {
|
3
|
+
"task_definition_arn": "arn:aws:ecs:us-west-2:112233445566:task-definition/demo-web:1",
|
4
|
+
"container_definitions": [
|
5
|
+
{
|
6
|
+
"name": "web",
|
7
|
+
"image": "112233445566.dkr.ecr.us-west-2.amazonaws.com/demo/sinatra:ufo-2020-01-16T22-56-26-a28378e80",
|
8
|
+
"cpu": 256,
|
9
|
+
"memory": 1024,
|
10
|
+
"memory_reservation": 1024,
|
11
|
+
"port_mappings": [
|
12
|
+
{
|
13
|
+
"container_port": 4567,
|
14
|
+
"host_port": 4567,
|
15
|
+
"protocol": "tcp"
|
16
|
+
}
|
17
|
+
],
|
18
|
+
"essential": true,
|
19
|
+
"command": [
|
20
|
+
"bin/web"
|
21
|
+
],
|
22
|
+
"environment": [],
|
23
|
+
"log_configuration": {
|
24
|
+
"log_driver": "awslogs",
|
25
|
+
"options": {
|
26
|
+
"awslogs-group": "ecs/demo-web",
|
27
|
+
"awslogs-region": "us-west-2",
|
28
|
+
"awslogs-stream-prefix": "demo"
|
29
|
+
}
|
30
|
+
}
|
31
|
+
}
|
32
|
+
],
|
33
|
+
"family": "demo-web",
|
34
|
+
"task_role_arn": "arn:aws:iam::112233445566:role/demo",
|
35
|
+
"network_mode": "awsvpc",
|
36
|
+
"revision": 1,
|
37
|
+
"volumes": [
|
38
|
+
],
|
39
|
+
"status": "ACTIVE",
|
40
|
+
"requires_attributes": [
|
41
|
+
{
|
42
|
+
"name": "com.amazonaws.ecs.capability.logging-driver.awslogs"
|
43
|
+
},
|
44
|
+
{
|
45
|
+
"name": "com.amazonaws.ecs.capability.ecr-auth"
|
46
|
+
},
|
47
|
+
{
|
48
|
+
"name": "com.amazonaws.ecs.capability.docker-remote-api.1.19"
|
49
|
+
},
|
50
|
+
{
|
51
|
+
"name": "com.amazonaws.ecs.capability.docker-remote-api.1.21"
|
52
|
+
},
|
53
|
+
{
|
54
|
+
"name": "com.amazonaws.ecs.capability.task-iam-role"
|
55
|
+
},
|
56
|
+
{
|
57
|
+
"name": "com.amazonaws.ecs.capability.docker-remote-api.1.18"
|
58
|
+
},
|
59
|
+
{
|
60
|
+
"name": "ecs.capability.task-eni"
|
61
|
+
}
|
62
|
+
],
|
63
|
+
"placement_constraints": [
|
64
|
+
|
65
|
+
],
|
66
|
+
"compatibilities": [
|
67
|
+
"EC2"
|
68
|
+
]
|
69
|
+
}
|
70
|
+
}
|
@@ -0,0 +1,70 @@
|
|
1
|
+
{
|
2
|
+
"task_definition": {
|
3
|
+
"task_definition_arn": "arn:aws:ecs:us-west-2:112233445566:task-definition/demo-web:1",
|
4
|
+
"container_definitions": [
|
5
|
+
{
|
6
|
+
"name": "web",
|
7
|
+
"image": "112233445566.dkr.ecr.us-west-2.amazonaws.com/demo/sinatra:ufo-2020-01-16T22-56-26-a28378e80",
|
8
|
+
"cpu": 256,
|
9
|
+
"memory": 1024,
|
10
|
+
"memory_reservation": 1024,
|
11
|
+
"port_mappings": [
|
12
|
+
{
|
13
|
+
"container_port": 4567,
|
14
|
+
"host_port": 4567,
|
15
|
+
"protocol": "tcp"
|
16
|
+
}
|
17
|
+
],
|
18
|
+
"essential": true,
|
19
|
+
"command": [
|
20
|
+
"bin/web"
|
21
|
+
],
|
22
|
+
"environment": [],
|
23
|
+
"log_configuration": {
|
24
|
+
"log_driver": "whatever",
|
25
|
+
"options": {
|
26
|
+
"awslogs-group": "ecs/demo-web",
|
27
|
+
"awslogs-region": "us-west-2",
|
28
|
+
"awslogs-stream-prefix": "demo"
|
29
|
+
}
|
30
|
+
}
|
31
|
+
}
|
32
|
+
],
|
33
|
+
"family": "demo-web",
|
34
|
+
"task_role_arn": "arn:aws:iam::112233445566:role/demo",
|
35
|
+
"network_mode": "awsvpc",
|
36
|
+
"revision": 1,
|
37
|
+
"volumes": [
|
38
|
+
],
|
39
|
+
"status": "ACTIVE",
|
40
|
+
"requires_attributes": [
|
41
|
+
{
|
42
|
+
"name": "com.amazonaws.ecs.capability.logging-driver.awslogs"
|
43
|
+
},
|
44
|
+
{
|
45
|
+
"name": "com.amazonaws.ecs.capability.ecr-auth"
|
46
|
+
},
|
47
|
+
{
|
48
|
+
"name": "com.amazonaws.ecs.capability.docker-remote-api.1.19"
|
49
|
+
},
|
50
|
+
{
|
51
|
+
"name": "com.amazonaws.ecs.capability.docker-remote-api.1.21"
|
52
|
+
},
|
53
|
+
{
|
54
|
+
"name": "com.amazonaws.ecs.capability.task-iam-role"
|
55
|
+
},
|
56
|
+
{
|
57
|
+
"name": "com.amazonaws.ecs.capability.docker-remote-api.1.18"
|
58
|
+
},
|
59
|
+
{
|
60
|
+
"name": "ecs.capability.task-eni"
|
61
|
+
}
|
62
|
+
],
|
63
|
+
"placement_constraints": [
|
64
|
+
|
65
|
+
],
|
66
|
+
"compatibilities": [
|
67
|
+
"EC2"
|
68
|
+
]
|
69
|
+
}
|
70
|
+
}
|
@@ -0,0 +1,55 @@
|
|
1
|
+
describe Ufo::Logs do
|
2
|
+
let(:logs) do
|
3
|
+
logs = Ufo::Logs.new("test-web", {})
|
4
|
+
allow(logs).to receive(:exit).and_return(null)
|
5
|
+
allow(logs).to receive(:info).and_return(null)
|
6
|
+
allow(logs).to receive(:ecs).and_return(ecs)
|
7
|
+
logs
|
8
|
+
end
|
9
|
+
let(:ecs) do
|
10
|
+
ecs = double(:ecs).as_null_object
|
11
|
+
allow(ecs).to receive(:describe_task_definition).and_return(mock_response(fixture))
|
12
|
+
ecs
|
13
|
+
end
|
14
|
+
let(:null) { double(:null).as_null_object }
|
15
|
+
|
16
|
+
context "awslogs conf" do
|
17
|
+
let(:fixture) { "spec/fixtures/mocks/logs/awslogs.json" }
|
18
|
+
it "find_log_group_name" do
|
19
|
+
log_group_name = logs.find_log_group_name
|
20
|
+
expect(log_group_name).to eq({"awslogs-group" => "ecs/demo-web", "awslogs-region" => "us-west-2", "awslogs-stream-prefix" => "demo" })
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
context "not a awslogs conf" do
|
25
|
+
let(:fixture) { "spec/fixtures/mocks/logs/no-awslogs.json" }
|
26
|
+
it "find_log_group_name" do
|
27
|
+
log_group_name = logs.find_log_group_name
|
28
|
+
expect(log_group_name).to be nil
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
def mock_response(file)
|
33
|
+
data = JSON.load(IO.read(file))
|
34
|
+
|
35
|
+
td = data["task_definition"]
|
36
|
+
container_definitions = td["container_definitions"].map do |c|
|
37
|
+
l = c["log_configuration"]
|
38
|
+
log_configuration = Aws::ECS::Types::LogConfiguration.new(
|
39
|
+
log_driver: l["log_driver"],
|
40
|
+
options: l["options"],
|
41
|
+
)
|
42
|
+
Aws::ECS::Types::ContainerDefinition.new(
|
43
|
+
name: c["name"],
|
44
|
+
log_configuration: log_configuration,
|
45
|
+
)
|
46
|
+
end
|
47
|
+
task_definition = Aws::ECS::Types::TaskDefinition.new(
|
48
|
+
task_definition_arn: td["task_definition_arn"],
|
49
|
+
container_definitions: container_definitions,
|
50
|
+
)
|
51
|
+
Aws::ECS::Types::DescribeTaskDefinitionResponse.new(
|
52
|
+
task_definition: task_definition,
|
53
|
+
)
|
54
|
+
end
|
55
|
+
end
|
data/ufo.gemspec
CHANGED
@@ -18,6 +18,7 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
|
+
spec.add_dependency "aws-logs"
|
21
22
|
spec.add_dependency "aws-mfa-secure"
|
22
23
|
spec.add_dependency "aws-sdk-cloudformation"
|
23
24
|
spec.add_dependency "aws-sdk-cloudwatchlogs"
|
metadata
CHANGED
@@ -1,15 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ufo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.
|
4
|
+
version: 4.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tung Nguyen
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-01-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: aws-logs
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
13
27
|
- !ruby/object:Gem::Dependency
|
14
28
|
name: aws-mfa-secure
|
15
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -311,7 +325,6 @@ files:
|
|
311
325
|
- README.md
|
312
326
|
- Rakefile
|
313
327
|
- docs/.gitignore
|
314
|
-
- docs/.ruby-version
|
315
328
|
- docs/CNAME
|
316
329
|
- docs/Gemfile
|
317
330
|
- docs/LICENSE
|
@@ -358,6 +371,7 @@ files:
|
|
358
371
|
- docs/_docs/ufo-current.md
|
359
372
|
- docs/_docs/ufo-env-extra.md
|
360
373
|
- docs/_docs/ufo-env.md
|
374
|
+
- docs/_docs/ufo-logs.md
|
361
375
|
- docs/_docs/ufo-task-params.md
|
362
376
|
- docs/_docs/ufo-tasks-register.md
|
363
377
|
- docs/_docs/upgrading.md
|
@@ -414,6 +428,7 @@ files:
|
|
414
428
|
- docs/_reference/ufo-docker-push.md
|
415
429
|
- docs/_reference/ufo-docker.md
|
416
430
|
- docs/_reference/ufo-init.md
|
431
|
+
- docs/_reference/ufo-logs.md
|
417
432
|
- docs/_reference/ufo-network-help.md
|
418
433
|
- docs/_reference/ufo-network-init.md
|
419
434
|
- docs/_reference/ufo-network.md
|
@@ -544,6 +559,7 @@ files:
|
|
544
559
|
- lib/ufo/help/docker/push.md
|
545
560
|
- lib/ufo/help/help.md
|
546
561
|
- lib/ufo/help/init.md
|
562
|
+
- lib/ufo/help/logs.md
|
547
563
|
- lib/ufo/help/network/init.md
|
548
564
|
- lib/ufo/help/ps.md
|
549
565
|
- lib/ufo/help/releases.md
|
@@ -561,6 +577,7 @@ files:
|
|
561
577
|
- lib/ufo/info.rb
|
562
578
|
- lib/ufo/init.rb
|
563
579
|
- lib/ufo/log_group.rb
|
580
|
+
- lib/ufo/logs.rb
|
564
581
|
- lib/ufo/network.rb
|
565
582
|
- lib/ufo/network/fetch.rb
|
566
583
|
- lib/ufo/network/helper.rb
|
@@ -604,6 +621,8 @@ files:
|
|
604
621
|
- spec/fixtures/dockerfiles/ecr/Dockerfile
|
605
622
|
- spec/fixtures/home_existing/.aws/config
|
606
623
|
- spec/fixtures/home_existing/.docker/config.json
|
624
|
+
- spec/fixtures/mocks/logs/awslogs.json
|
625
|
+
- spec/fixtures/mocks/logs/no-awslogs.json
|
607
626
|
- spec/fixtures/ps/describe_tasks.json
|
608
627
|
- spec/fixtures/settings.yml
|
609
628
|
- spec/lib/apps_spec.rb
|
@@ -612,6 +631,7 @@ files:
|
|
612
631
|
- spec/lib/completion_spec.rb
|
613
632
|
- spec/lib/ecr_auth_spec.rb
|
614
633
|
- spec/lib/ecr_cleaner_spec.rb
|
634
|
+
- spec/lib/logs_spec.rb
|
615
635
|
- spec/lib/ps_spec.rb
|
616
636
|
- spec/lib/register_spec.rb
|
617
637
|
- spec/lib/setting_spec.rb
|
@@ -640,7 +660,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
640
660
|
- !ruby/object:Gem::Version
|
641
661
|
version: '0'
|
642
662
|
requirements: []
|
643
|
-
rubygems_version: 3.
|
663
|
+
rubygems_version: 3.1.2
|
644
664
|
signing_key:
|
645
665
|
specification_version: 4
|
646
666
|
summary: AWS ECS Deploy Tool
|
@@ -655,6 +675,8 @@ test_files:
|
|
655
675
|
- spec/fixtures/dockerfiles/ecr/Dockerfile
|
656
676
|
- spec/fixtures/home_existing/.aws/config
|
657
677
|
- spec/fixtures/home_existing/.docker/config.json
|
678
|
+
- spec/fixtures/mocks/logs/awslogs.json
|
679
|
+
- spec/fixtures/mocks/logs/no-awslogs.json
|
658
680
|
- spec/fixtures/ps/describe_tasks.json
|
659
681
|
- spec/fixtures/settings.yml
|
660
682
|
- spec/lib/apps_spec.rb
|
@@ -663,6 +685,7 @@ test_files:
|
|
663
685
|
- spec/lib/completion_spec.rb
|
664
686
|
- spec/lib/ecr_auth_spec.rb
|
665
687
|
- spec/lib/ecr_cleaner_spec.rb
|
688
|
+
- spec/lib/logs_spec.rb
|
666
689
|
- spec/lib/ps_spec.rb
|
667
690
|
- spec/lib/register_spec.rb
|
668
691
|
- spec/lib/setting_spec.rb
|