ufo 3.5.7 → 4.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 +24 -0
- data/Gemfile.lock +16 -10
- data/README.md +12 -13
- data/docs/_config.yml +1 -1
- data/docs/_docs/auto-completion.md +4 -4
- data/docs/_docs/automated-cleanup.md +1 -1
- data/docs/_docs/conventions.md +7 -7
- data/docs/_docs/customize-cloudformation.md +36 -0
- data/docs/_docs/faq.md +9 -7
- data/docs/_docs/fargate.md +102 -0
- data/docs/_docs/helpers.md +3 -3
- data/docs/_docs/load-balancer.md +72 -0
- data/docs/_docs/migrations.md +2 -2
- data/docs/_docs/next-steps.md +2 -2
- data/docs/_docs/params.md +12 -41
- data/docs/_docs/route53-support.md +28 -0
- data/docs/_docs/run-in-pieces.md +2 -2
- data/docs/_docs/security-groups.md +54 -0
- data/docs/_docs/settings-cfn.md +11 -0
- data/docs/_docs/settings-network.md +34 -0
- data/docs/_docs/settings.md +18 -15
- data/docs/_docs/single-task.md +3 -3
- data/docs/_docs/ssl-support.md +42 -0
- data/docs/_docs/structure.md +5 -1
- data/docs/_docs/stuck-cloudformation.md +30 -0
- data/docs/_docs/tutorial-ufo-docker-build.md +19 -31
- data/docs/_docs/tutorial-ufo-init.md +16 -12
- data/docs/_docs/tutorial-ufo-ship.md +50 -54
- data/docs/_docs/tutorial-ufo-ships.md +9 -7
- data/docs/_docs/tutorial-ufo-tasks-build.md +26 -17
- data/docs/_docs/ufo-current.md +50 -0
- data/docs/_docs/ufo-env-extra.md +21 -0
- data/docs/_docs/ufo-env.md +6 -13
- data/docs/_docs/ufo-tasks-register.md +3 -3
- data/docs/_docs/upgrade4.md +49 -0
- data/docs/_docs/variables.md +5 -5
- data/docs/_docs/why-cloudformation.md +22 -0
- data/docs/_includes/about.html +1 -1
- data/docs/_includes/cfn-customize.md +39 -0
- data/docs/_includes/commands.html +6 -6
- data/docs/_includes/css/ufo.css +1 -0
- data/docs/_includes/example.html +13 -13
- data/docs/_includes/reference.md +1 -1
- data/docs/_includes/subnav.html +22 -5
- data/docs/_includes/ufo-ship-options.md +7 -6
- data/docs/_reference/ufo-apps.md +36 -0
- data/docs/_reference/ufo-cancel.md +24 -0
- data/docs/_reference/ufo-completion.md +1 -1
- data/docs/_reference/ufo-completion_script.md +1 -1
- data/docs/_reference/ufo-current.md +93 -0
- data/docs/_reference/ufo-deploy.md +18 -17
- data/docs/_reference/ufo-destroy.md +6 -4
- data/docs/_reference/ufo-docker-base.md +7 -7
- data/docs/_reference/ufo-docker-build.md +9 -9
- data/docs/_reference/ufo-docker-clean.md +8 -8
- data/docs/_reference/ufo-docker-name.md +4 -4
- data/docs/_reference/ufo-docker.md +4 -2
- data/docs/_reference/ufo-init.md +31 -20
- data/docs/_reference/ufo-network-help.md +15 -0
- data/docs/_reference/ufo-network-init.md +38 -0
- data/docs/_reference/ufo-network.md +26 -0
- data/docs/_reference/ufo-ps.md +53 -0
- data/docs/_reference/ufo-releases.md +40 -0
- data/docs/_reference/ufo-resources.md +44 -0
- data/docs/_reference/ufo-rollback.md +59 -0
- data/docs/_reference/ufo-scale.md +23 -3
- data/docs/_reference/ufo-ship.md +54 -27
- data/docs/_reference/ufo-ships.md +17 -26
- data/docs/_reference/ufo-stop.md +31 -0
- data/docs/_reference/ufo-task.md +15 -16
- data/docs/_reference/ufo-tasks-build.md +10 -10
- data/docs/_reference/ufo-tasks-register.md +3 -3
- data/docs/_reference/ufo-tasks.md +1 -1
- data/docs/_reference/ufo-upgrade-help.md +15 -0
- data/docs/_reference/ufo-upgrade-v2to3.md +15 -0
- data/docs/_reference/ufo-upgrade-v3_3to3_4.md +15 -0
- data/docs/_reference/ufo-upgrade-v3to4.md +27 -0
- data/docs/_reference/ufo-upgrade.md +28 -0
- data/docs/_reference/ufo-version.md +1 -1
- data/docs/articles.md +2 -2
- data/docs/docs.md +1 -1
- data/docs/img/docs/cloudformation-resources.png +0 -0
- data/docs/img/tutorials/ecs-console-task-definitions.png +0 -0
- data/docs/img/tutorials/ecs-console-ufo-ship.png +0 -0
- data/docs/img/tutorials/ecs-console-ufo-ships.png +0 -0
- data/docs/quick-start.md +21 -9
- data/docs/reference.md +10 -2
- data/exe/ufo +1 -1
- data/lib/cfn/stack.yml +259 -0
- data/lib/template/.ufo/params.yml.tt +21 -60
- data/lib/template/.ufo/settings.yml.tt +6 -1
- data/lib/template/.ufo/settings/cfn/default.yml.tt +55 -0
- data/lib/template/.ufo/settings/network/default.yml.tt +18 -0
- data/lib/template/.ufo/task_definitions.rb.tt +7 -6
- data/lib/template/.ufo/templates/fargate.json.erb +1 -1
- data/lib/template/.ufo/templates/main.json.erb +1 -0
- data/lib/template/.ufo/variables/base.rb.tt +5 -2
- data/lib/template/Dockerfile +10 -15
- data/lib/template/bin/deploy.tt +2 -2
- data/lib/ufo.rb +29 -20
- data/lib/ufo/apps.rb +49 -0
- data/lib/ufo/apps/cfn_map.rb +70 -0
- data/lib/ufo/apps/service.rb +56 -0
- data/lib/ufo/aws_service.rb +15 -6
- data/lib/ufo/base.rb +32 -0
- data/lib/ufo/cancel.rb +23 -0
- data/lib/ufo/cli.rb +91 -27
- data/lib/ufo/core.rb +35 -3
- data/lib/ufo/current.rb +104 -0
- data/lib/ufo/destroy.rb +10 -41
- data/lib/ufo/docker/builder.rb +5 -4
- data/lib/ufo/docker/cleaner.rb +1 -1
- data/lib/ufo/docker/pusher.rb +2 -2
- data/lib/ufo/ecr/cleaner.rb +1 -1
- data/lib/ufo/help/apps.md +12 -0
- data/lib/ufo/help/balancer.md +3 -0
- data/lib/ufo/help/current.md +65 -0
- data/lib/ufo/help/deploy.md +4 -4
- data/lib/ufo/help/destroy.md +3 -3
- data/lib/ufo/help/docker.md +3 -1
- data/lib/ufo/help/docker/base.md +7 -7
- data/lib/ufo/help/docker/build.md +9 -9
- data/lib/ufo/help/docker/clean.md +8 -8
- data/lib/ufo/help/docker/name.md +4 -4
- data/lib/ufo/help/help.md +5 -0
- data/lib/ufo/help/init.md +24 -16
- data/lib/ufo/help/network/init.md +13 -0
- data/lib/ufo/help/ps.md +27 -0
- data/lib/ufo/help/releases.md +16 -0
- data/lib/ufo/help/resources.md +20 -0
- data/lib/ufo/help/rollback.md +35 -0
- data/lib/ufo/help/scale.md +22 -2
- data/lib/ufo/help/ship.md +40 -14
- data/lib/ufo/help/ships.md +4 -13
- data/lib/ufo/help/stop.md +7 -0
- data/lib/ufo/help/task.md +9 -9
- data/lib/ufo/help/tasks/build.md +10 -10
- data/lib/ufo/help/tasks/register.md +3 -3
- data/lib/ufo/help/upgrade/v3to4.md +3 -0
- data/lib/ufo/info.rb +62 -0
- data/lib/ufo/init.rb +36 -23
- data/lib/ufo/log_group.rb +2 -1
- data/lib/ufo/network.rb +24 -0
- data/lib/ufo/network/fetch.rb +41 -0
- data/lib/ufo/network/helper.rb +23 -0
- data/lib/ufo/network/init.rb +26 -0
- data/lib/ufo/param.rb +5 -5
- data/lib/ufo/ps.rb +102 -0
- data/lib/ufo/ps/task.rb +78 -0
- data/lib/ufo/releases.rb +14 -0
- data/lib/ufo/rollback.rb +53 -0
- data/lib/ufo/scale.rb +6 -12
- data/lib/ufo/sequence.rb +7 -0
- data/lib/ufo/setting.rb +7 -6
- data/lib/ufo/setting/profile.rb +24 -0
- data/lib/ufo/ship.rb +35 -326
- data/lib/ufo/stack.rb +203 -0
- data/lib/ufo/stack/context.rb +242 -0
- data/lib/ufo/stack/helper.rb +28 -0
- data/lib/ufo/stack/status.rb +195 -0
- data/lib/ufo/stop.rb +47 -0
- data/lib/ufo/task.rb +96 -15
- data/lib/ufo/tasks/register.rb +1 -1
- data/lib/ufo/template_scope.rb +81 -7
- data/lib/ufo/upgrade.rb +32 -0
- data/lib/ufo/{upgrade3.rb → upgrade/upgrade3.rb} +1 -1
- data/lib/ufo/{upgrade33_to_34.rb → upgrade/upgrade33to34.rb} +2 -2
- data/lib/ufo/upgrade/upgrade4.rb +161 -0
- data/lib/ufo/util.rb +19 -6
- data/lib/ufo/version.rb +1 -1
- data/spec/fixtures/apps/describe_services.json +96 -0
- data/spec/fixtures/cfn/stack-events-complete.json +1080 -0
- data/spec/fixtures/cfn/stack-events-in-progress.json +1080 -0
- data/spec/fixtures/cfn/stack-events-update-rollback-complete.json +1086 -0
- data/spec/fixtures/deployments.json +50 -0
- data/spec/fixtures/ps/describe_tasks.json +58 -0
- data/spec/fixtures/settings.yml +2 -0
- data/spec/lib/apps_spec.rb +20 -0
- data/spec/lib/cli_spec.rb +4 -4
- data/spec/lib/ps_spec.rb +14 -0
- data/spec/lib/setting_spec.rb +2 -1
- data/spec/lib/ship_spec.rb +6 -30
- data/spec/lib/stack/status_spec.rb +76 -0
- data/spec/lib/stop_spec.rb +13 -0
- data/spec/lib/task_spec.rb +5 -2
- data/spec/spec_helper.rb +1 -1
- data/ufo.gemspec +2 -0
- metadata +120 -6
- data/docs/_reference/ufo-upgrade3.md +0 -23
- data/docs/_reference/ufo-upgrade3_3_to_3_4.md +0 -23
@@ -11,18 +11,18 @@ reference: true
|
|
11
11
|
|
12
12
|
Deploy task definition to ECS service without re-building the definition.
|
13
13
|
|
14
|
-
It is useful to sometimes deploy only the task definition without re-building it. Say for example, you are debugging the task definition and just want to directly edit the `.ufo/output/
|
14
|
+
It is useful to sometimes deploy only the task definition without re-building it. Say for example, you are debugging the task definition and just want to directly edit the `.ufo/output/demo-web.json` definition. You can accomplish this with the `ufo deploy` command. The `ufo deploy` command will deploy the task definition in `.ufo/output` unmodified. Example:
|
15
15
|
|
16
|
-
ufo deploy
|
16
|
+
ufo deploy demo-web
|
17
17
|
|
18
18
|
The above command does the following:
|
19
19
|
|
20
|
-
1. register the `.ufo/output/
|
20
|
+
1. register the `.ufo/output/demo-web.json` task definition to ECS untouched.
|
21
21
|
2. deploys it to ECS by updating the service
|
22
22
|
|
23
23
|
### ufo tasks build
|
24
24
|
|
25
|
-
To regenerate a `.ufo/output/
|
25
|
+
To regenerate a `.ufo/output/demo-web.json` definition:
|
26
26
|
|
27
27
|
ufo tasks build
|
28
28
|
|
@@ -42,18 +42,19 @@ The `ufo ships`, `ufo ship`, `ufo deploy` command support the same options. The
|
|
42
42
|
## Options
|
43
43
|
|
44
44
|
```
|
45
|
-
[--
|
46
|
-
[--
|
47
|
-
[--
|
48
|
-
|
49
|
-
[--
|
50
|
-
|
51
|
-
|
52
|
-
[--
|
53
|
-
[--
|
54
|
-
|
55
|
-
[--
|
56
|
-
[--
|
57
|
-
[--
|
45
|
+
[--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.
|
46
|
+
[--elb=ELB] # Decides to create elb, not create elb or use existing target group.
|
47
|
+
[--elb-eip-ids=one two three] # EIP Allocation ids to use for network load balancer.
|
48
|
+
[--elb-type=ELB_TYPE] # ELB type: application or network. Keep current deployed elb type when not specified.
|
49
|
+
[--pretty], [--no-pretty] # Pretty format the json for the task definitions
|
50
|
+
# Default: true
|
51
|
+
[--stop-old-tasks], [--no-stop-old-tasks] # Stop old tasks as part of deployment to speed it up
|
52
|
+
[--task=TASK] # ECS task name, to override the task name convention.
|
53
|
+
[--wait], [--no-wait] # Wait for deployment to complete
|
54
|
+
# Default: true
|
55
|
+
[--verbose], [--no-verbose]
|
56
|
+
[--mute], [--no-mute]
|
57
|
+
[--noop], [--no-noop]
|
58
|
+
[--cluster=CLUSTER] # Cluster. Overrides .ufo/settings.yml.
|
58
59
|
```
|
59
60
|
|
@@ -13,22 +13,24 @@ Destroy the ECS service.
|
|
13
13
|
|
14
14
|
## Examples
|
15
15
|
|
16
|
-
Ufo provides a quick way to destroy an ECS service.
|
16
|
+
Ufo provides a quick way to destroy an ECS service. This is effectively the same thing as deleting the CloudFormation stack.
|
17
17
|
|
18
|
-
ufo destroy
|
18
|
+
ufo destroy demo-web
|
19
19
|
|
20
20
|
If you would like to bypass the prompt, you can use the `--sure` option.
|
21
21
|
|
22
|
-
ufo destroy
|
22
|
+
ufo destroy demo-web --sure
|
23
23
|
|
24
24
|
|
25
25
|
## Options
|
26
26
|
|
27
27
|
```
|
28
28
|
[--sure], [--no-sure] # By pass are you sure prompt.
|
29
|
+
[--wait], [--no-wait] # Wait for completion
|
30
|
+
# Default: true
|
29
31
|
[--verbose], [--no-verbose]
|
30
32
|
[--mute], [--no-mute]
|
31
33
|
[--noop], [--no-noop]
|
32
|
-
[--cluster=CLUSTER] # Cluster. Overrides ufo/settings.yml.
|
34
|
+
[--cluster=CLUSTER] # Cluster. Overrides .ufo/settings.yml.
|
33
35
|
```
|
34
36
|
|
@@ -19,7 +19,7 @@ updates the FROM `Dockerfile` image with the generated image from `Dockerfile.ba
|
|
19
19
|
ufo docker base
|
20
20
|
ufo docker base --no-push # do not push the image to the registry
|
21
21
|
|
22
|
-
Docker image `tongueroo/
|
22
|
+
Docker image `tongueroo/demo-ufo:base-2016-10-21T15-50-57-88071f5` built.
|
23
23
|
|
24
24
|
## Concept
|
25
25
|
|
@@ -31,23 +31,23 @@ There are pros and cons of using this approach. Remember there are 2 hard probl
|
|
31
31
|
|
32
32
|
## Demo
|
33
33
|
|
34
|
-
To demonstrate this command, there's a `docker-cache` branch in the [tongueroo/
|
34
|
+
To demonstrate this command, there's a `docker-cache` branch in the [tongueroo/demo-ufo](https://github.com/tongueroo/demo-ufo/tree/docker-cache) repo.
|
35
35
|
|
36
36
|
Let's see the command in action:
|
37
37
|
|
38
38
|
ufo docker base
|
39
39
|
Building docker image with:
|
40
|
-
docker build -t tongueroo/
|
40
|
+
docker build -t tongueroo/demo-ufo:base-2017-06-12T14-36-44-2af505e -f Dockerfile.base .
|
41
41
|
...
|
42
|
-
Pushed tongueroo/
|
42
|
+
Pushed tongueroo/demo-ufo:base-2017-06-12T14-36-44-2af505e docker image. Took 28s.
|
43
43
|
The Dockerfile FROM statement has been updated with the latest base image:
|
44
|
-
tongueroo/
|
44
|
+
tongueroo/demo-ufo:base-2017-06-12T14-36-44-2af505e
|
45
45
|
|
46
46
|
Some of the output has been excluded so we can focus on the important parts to point out. First notice that the commmand simply shells out to the docker command and calls:
|
47
47
|
|
48
|
-
docker build -t tongueroo/
|
48
|
+
docker build -t tongueroo/demo-ufo:base-2017-06-12T14-36-44-2af505e -f Dockerfile.base .
|
49
49
|
|
50
|
-
It is using the docker `-f Dockerfile.base` option to build the base image. It names the image with `tongueroo/
|
50
|
+
It is using the docker `-f Dockerfile.base` option to build the base image. It names the image with `tongueroo/demo-ufo:base-2017-06-12T14-36-44-2af505e`. The image tag contains useful information: the timestamp when the image was built and the exact git sha of the code. The image gets push to a registry immediately.
|
51
51
|
|
52
52
|
Notice at the very end, the *current* `Dockerfile`'s FROM statement has been updated with the newly built base Docker image automatically. This saves you from forgetting to copying and pasting it the `Dockerfile` yourself.
|
53
53
|
|
@@ -11,19 +11,19 @@ reference: true
|
|
11
11
|
|
12
12
|
Build docker image.
|
13
13
|
|
14
|
-
The `ufo docker build` builds a Docker image using the Dockerfile in the current project folder. This simply is a wrapper command that shells out and calls the `docker` command. We're use the [tongueroo/
|
14
|
+
The `ufo docker build` builds a Docker image using the Dockerfile in the current project folder. This simply is a wrapper command that shells out and calls the `docker` command. We're use the [tongueroo/demo-ufo](https://github.com/tongueroo/demo-ufo) project and it's Dockerfile for demonstration. Example:
|
15
15
|
|
16
16
|
ufo docker build
|
17
17
|
|
18
18
|
You'll see that it calls:
|
19
19
|
|
20
|
-
docker build -t tongueroo/
|
20
|
+
docker build -t tongueroo/demo-ufo:ufo-2017-06-11T22-18-03-a18aa30 -f Dockerfile .
|
21
21
|
|
22
22
|
You should see similar output (some of the output has been truncated for conciseness):
|
23
23
|
|
24
24
|
$ ufo docker build
|
25
25
|
Building docker image with:
|
26
|
-
docker build -t tongueroo/
|
26
|
+
docker build -t tongueroo/demo-ufo:ufo-2017-06-11T22-18-03-a18aa30 -f Dockerfile .
|
27
27
|
Sending build context to Docker daemon 734.2 kB
|
28
28
|
Step 1 : FROM ruby:2.3.3
|
29
29
|
---> 0e1db669d557
|
@@ -50,7 +50,7 @@ You should see similar output (some of the output has been truncated for concise
|
|
50
50
|
---> 8547bb48b21f
|
51
51
|
Removing intermediate container b1b26e68d957
|
52
52
|
Successfully built 8547bb48b21f
|
53
|
-
Docker image tongueroo/
|
53
|
+
Docker image tongueroo/demo-ufo:ufo-2017-06-11T22-18-03-a18aa30 built. Took 33s.
|
54
54
|
$
|
55
55
|
|
56
56
|
The docker image tag that is generated contains a useful timestamp and the current HEAD git sha of the project that you are on.
|
@@ -61,14 +61,14 @@ By default when you are running `ufo docker build` directly it does not push the
|
|
61
61
|
|
62
62
|
You should see it being pushed at the end:
|
63
63
|
|
64
|
-
Docker image tongueroo/
|
65
|
-
The push refers to a repository [docker.io/tongueroo/
|
64
|
+
Docker image tongueroo/demo-ufo:ufo-2017-06-11T22-22-32-a18aa30 built. Took 34s.
|
65
|
+
The push refers to a repository [docker.io/tongueroo/demo-ufo]
|
66
66
|
ef375857f165: Pushed
|
67
67
|
4d791d7cde66: Pushed
|
68
68
|
277ff31e79b4: Layer already exists
|
69
69
|
a361a4de05df: Layer already exists
|
70
70
|
ufo-2017-06-11T22-22-32-a18aa30: digest: sha256:c5385a5084e87643bd943eb120e110321c59e8acd30736ba7b5223eb1143baa8 size: 3464
|
71
|
-
Pushed tongueroo/
|
71
|
+
Pushed tongueroo/demo-ufo:ufo-2017-06-11T22-22-32-a18aa30 docker image. Took 9s.
|
72
72
|
|
73
73
|
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 you can use the `aws ecr get-login` command.
|
74
74
|
|
@@ -78,9 +78,9 @@ You can specify docker build options with the `UFO_DOCKER_BUILD_OPTIONS` environ
|
|
78
78
|
|
79
79
|
$ UFO_DOCKER_BUILD_OPTIONS="--build-arg RAILS_ENV=production" ufo docker build
|
80
80
|
Building docker image with:
|
81
|
-
docker build --build-arg RAILS_ENV=production -t tongueroo/
|
81
|
+
docker build --build-arg RAILS_ENV=production -t tongueroo/demo-ufo:ufo-2018-05-19T11-52-16-6714713 -f Dockerfile .
|
82
82
|
...
|
83
|
-
Docker image tongueroo/
|
83
|
+
Docker image tongueroo/demo-ufo:ufo-2018-05-19T11-52-16-6714713 built. Took 2s.
|
84
84
|
|
85
85
|
|
86
86
|
## Options
|
@@ -15,22 +15,22 @@ Ufo comes with a handy command to clean up old images that ufo generates. Ufo on
|
|
15
15
|
|
16
16
|
Say you currently have these images:
|
17
17
|
|
18
|
-
tongueroo/
|
19
|
-
tongueroo/
|
20
|
-
tongueroo/
|
21
|
-
tongueroo/
|
18
|
+
tongueroo/demo-ufo:ufo-2016-10-15T19-29-06-88071f5
|
19
|
+
tongueroo/demo-ufo:ufo-2016-10-16T19-29-06-88071f5
|
20
|
+
tongueroo/demo-ufo:ufo-2016-10-17T19-29-06-88071f5
|
21
|
+
tongueroo/demo-ufo:ufo-2016-10-18T19-29-06-88071f5
|
22
22
|
|
23
23
|
To clean them up and keep the 3 more recent:
|
24
24
|
|
25
|
-
$ ufo docker clean tongueroo/
|
25
|
+
$ ufo docker clean tongueroo/demo-ufo
|
26
26
|
Cleaning up docker images...
|
27
|
-
Running: docker rmi tongueroo/
|
27
|
+
Running: docker rmi tongueroo/demo-ufo:ufo-2016-10-15T19-29-06-88071f5
|
28
28
|
|
29
|
-
This will remove tongueroo/
|
29
|
+
This will remove tongueroo/demo-ufo:ufo-2016-10-15T19-29-06-88071f5.
|
30
30
|
|
31
31
|
By default the clean command keeps the most 3 recent docker images. If you would like to override this setting you can use the `--keep` option. Example:
|
32
32
|
|
33
|
-
ufo docker clean tongueroo/
|
33
|
+
ufo docker clean tongueroo/demo-ufo --keep 5
|
34
34
|
|
35
35
|
|
36
36
|
## Options
|
@@ -18,15 +18,15 @@ It is sometimes handy to grab the name of the Docker image that was just generat
|
|
18
18
|
ufo docker build # stores the docker image name in the .ufo/data folder
|
19
19
|
ufo docker name # fetches image name from .ufo/data folder
|
20
20
|
|
21
|
-
An example image name would look something like this: `tongueroo/
|
21
|
+
An example image name would look something like this: `tongueroo/demo-ufo:ufo-2018-02-15T19-29-06-88071f5`
|
22
22
|
|
23
23
|
Note, the `.ufo/data` folder is an internal data folder and it's structure can change in future releases.
|
24
24
|
|
25
25
|
If you want to generate a brand new name for whatever purpose, you can use the `--generate` flag. The generate does not write to the `.ufo/data` folder. It only generates a fresh name to stdout. If you run it multiple times, it will generate new names. You can notice this by seeing that the timestamp will always update:
|
26
26
|
|
27
|
-
ufo docker name --generate # example: tongueroo/
|
28
|
-
ufo docker name --generate # example: tongueroo/
|
29
|
-
ufo docker name --generate # example: tongueroo/
|
27
|
+
ufo docker name --generate # example: tongueroo/demo-ufo:ufo-2018-02-15T10-00-00-88071f5
|
28
|
+
ufo docker name --generate # example: tongueroo/demo-ufo:ufo-2018-02-15T10-00-08-88071f5
|
29
|
+
ufo docker name --generate # example: tongueroo/demo-ufo:ufo-2018-02-15T10-00-16-88071f5
|
30
30
|
|
31
31
|
|
32
32
|
## Options
|
@@ -13,8 +13,10 @@ docker subcommands
|
|
13
13
|
|
14
14
|
## Examples
|
15
15
|
|
16
|
+
ufo docker base
|
16
17
|
ufo docker build
|
17
|
-
ufo docker
|
18
|
+
ufo docker name
|
19
|
+
ufo docker push
|
18
20
|
|
19
21
|
## Subcommands
|
20
22
|
|
@@ -30,6 +32,6 @@ docker subcommands
|
|
30
32
|
[--verbose], [--no-verbose]
|
31
33
|
[--mute], [--no-mute]
|
32
34
|
[--noop], [--no-noop]
|
33
|
-
[--cluster=CLUSTER] # Cluster. Overrides ufo/settings.yml.
|
35
|
+
[--cluster=CLUSTER] # Cluster. Overrides .ufo/settings.yml.
|
34
36
|
```
|
35
37
|
|
data/docs/_reference/ufo-init.md
CHANGED
@@ -5,21 +5,24 @@ reference: true
|
|
5
5
|
|
6
6
|
## Usage
|
7
7
|
|
8
|
-
ufo
|
8
|
+
ufo init --image=IMAGE
|
9
9
|
|
10
10
|
## Description
|
11
11
|
|
12
12
|
Set up initial ufo files.
|
13
13
|
|
14
|
-
The `ufo init` command provides a way to quickly setup a project to be ufo ready. It creates a ufo folder with all the starter supporting files in order to use ufo. This page demonstrates how to use `ufo init`. The command requires
|
14
|
+
The `ufo init` command provides a way to quickly setup a project to be ufo ready. It creates a ufo folder with all the starter supporting files in order to use ufo. This page demonstrates how to use `ufo init`. The command requires the `--image` option. If the `--app` option is not provided, then it is inferred and set as the parent folder name. Example:
|
15
|
+
|
16
|
+
cd demo
|
17
|
+
ufo init --image tongueroo/demo-ufo # same as --app demo
|
15
18
|
|
16
19
|
## Examples
|
17
20
|
|
18
|
-
For this example we will use [tongueroo/
|
21
|
+
For this example we will use [tongueroo/demo-ufo](https://github.com/tongueroo/demo-ufo) which is a small test sinatra app. Let's run the command in our newly clone project.
|
19
22
|
|
20
|
-
$ git clone https://github.com/tongueroo/
|
21
|
-
$ cd
|
22
|
-
$ ufo init --app=
|
23
|
+
$ git clone https://github.com/tongueroo/demo-ufo.git
|
24
|
+
$ cd demo-ufo
|
25
|
+
$ ufo init --app=demo --image=tongueroo/demo-ufo
|
23
26
|
Setting up ufo project...
|
24
27
|
create .ufo/settings.yml
|
25
28
|
create .ufo/task_definitions.rb
|
@@ -36,17 +39,20 @@ For this example we will use [tongueroo/hi](https://github.com/tongueroo/hi) whi
|
|
36
39
|
|
37
40
|
ufo init --image httpd --app demo
|
38
41
|
ufo init --image 123456789012.dkr.ecr.us-west-2.amazonaws.com/myimage --app demo
|
39
|
-
ufo init --image tongueroo/
|
42
|
+
ufo init --image tongueroo/demo-ufo --app demo --launch-type fargate --execution-role-arn arn:aws:iam::123456789012:role/ecsTaskExecutionRole
|
43
|
+
ufo init --image httpd --app demo --vpc-id vpc-123
|
40
44
|
|
41
|
-
##
|
45
|
+
## Important options
|
42
46
|
|
43
|
-
The `app` is that application name that you want to show up on the ECS dashboard. It is encouraged to have the app name be a single word.
|
47
|
+
The `app` is that application name that you want to show up on the ECS dashboard. It is encouraged to have the app name be a single word. If the option is not provided, the app name is inferred and is the parent folder name.
|
44
48
|
|
45
49
|
The `image` is the base portion of image name that will be pushed to the docker registry, ie: DockerHub or AWS ECR. The image should **not** include the tag since the tag is generated upon a `ufo ship`. For example:
|
46
50
|
|
47
|
-
tongueroo/
|
51
|
+
tongueroo/demo-ufo => tongueroo/demo-ufo:ufo-2018-02-08T21-04-02-3c86158
|
52
|
+
|
53
|
+
The generated `tongueroo/demo-ufo:ufo-2018-02-08T21-04-02-3c86158` image name gets pushed to the docker registry.
|
48
54
|
|
49
|
-
The
|
55
|
+
The `--vpc-id` option is 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.
|
50
56
|
|
51
57
|
## Directory Structure
|
52
58
|
|
@@ -69,49 +75,54 @@ For a explanation of the folders and files refer to [Structure]({% link _docs/st
|
|
69
75
|
|
70
76
|
For ECS Fargate, the ECS task definition structure is a bit different. To initialize a project to support Fargate use the `--launch-type fargate` option. You'll be prompted for a execution role arn. This value gets added to the generated `.ufo/variables/base.rb` and used in the `.ufo/templates/main.json.erb`.
|
71
77
|
|
72
|
-
ufo init --image tongueroo/
|
78
|
+
ufo init --image tongueroo/demo-ufo --app demo --force --launch-type fargate
|
73
79
|
|
74
80
|
You can also generate the init ufo files and bypass the prompt by providing the `--execution-role-arn` option upfront.
|
75
81
|
|
76
|
-
ufo init --image tongueroo/
|
82
|
+
ufo init --image tongueroo/demo-ufo --app demo --force --launch-type fargate --execution-role-arn arn:aws:iam::123456789012:role/ecsTaskExecutionRole
|
77
83
|
|
78
84
|
Important: You will need to adjust adjust the generated `.ufo/params.yml` and set the subnet and security_group values which are required for Fargate.
|
79
85
|
|
86
|
+
For more information and a demo of Fargate support, check out the [Fargate Docs]({% link _docs/fargate.md %}).
|
87
|
+
|
80
88
|
## Custom Templates
|
81
89
|
|
82
90
|
If you would like the `ufo init` command to use your own custom templates, you can achieve this with the `--template` and `--template-mode` options. Example:
|
83
91
|
|
84
|
-
ufo init --app=
|
92
|
+
ufo init --app=demo --image=tongueroo/demo-ufo --template=tongueroo/ufo-custom-template
|
85
93
|
|
86
94
|
This will clone the repo on GitHub into the `~/.ufo/templates/tongueroo/ufo-custom-template` and use that as an additional template source. The default `--template-mode=additive` mode means that if there's a file in `tongueroo/ufo-custom-template` that exists it will use that in place of the default template files.
|
87
95
|
|
88
96
|
If you do not want to use any of the original default template files within the ufo gem at all, you can use the `--template-mode=replace` mode. Replace mode will only use templates from the provided `--template` option. Example:
|
89
97
|
|
90
|
-
ufo init --app=
|
98
|
+
ufo init --app=demo --image=tongueroo/demo-ufo --template=tongueroo/ufo-custom-template --template-mode=replace
|
91
99
|
|
92
100
|
You can also specific the full GitHub url. Example:
|
93
101
|
|
94
|
-
ufo init --app=
|
102
|
+
ufo init --app=demo --image=tongueroo/demo-ufo --template=https://github.com/tongueroo/ufo-custom-template
|
95
103
|
|
96
104
|
If you would like to use a local template that is not on GitHub, then created a top-level folder in `~/.ufo/templates` without a subfolder. Example:
|
97
105
|
|
98
|
-
ufo init --app=
|
106
|
+
ufo init --app=demo --image=tongueroo/demo-ufo --template=my-custom # uses ~/.ufo/templates/my-custom
|
99
107
|
|
100
108
|
|
101
109
|
## Options
|
102
110
|
|
103
111
|
```
|
104
112
|
[--force] # Bypass overwrite are you sure prompt for existing files.
|
105
|
-
--image=IMAGE # Docker image name without the tag. Example: tongueroo/
|
106
|
-
--app=APP
|
113
|
+
--image=IMAGE # Docker image name without the tag. Example: tongueroo/demo-ufo. Configures ufo/settings.yml
|
114
|
+
[--app=APP] # App name. Preferably one word. Used in the generated ufo/task_definitions.rb. If not specified then the app name is inferred as the folder name.
|
107
115
|
[--launch-type=LAUNCH_TYPE] # ec2 or fargate.
|
108
116
|
# Default: ec2
|
109
117
|
[--execution-role-arn=EXECUTION_ROLE_ARN] # execution role arn used by tasks, required for fargate.
|
110
118
|
[--template=TEMPLATE] # Custom template to use.
|
111
119
|
[--template-mode=TEMPLATE_MODE] # Template mode: replace or additive.
|
120
|
+
[--vpc-id=VPC_ID] # Vpc id. For settings/network/default.yml.
|
121
|
+
[--ecs-subnets=one two three] # Subnets for ECS tasks, defaults to --elb-subnets set to. For settings/network/default.yml
|
122
|
+
[--elb-subnets=one two three] # Subnets for ELB. For settings/network/default.yml
|
112
123
|
[--verbose], [--no-verbose]
|
113
124
|
[--mute], [--no-mute]
|
114
125
|
[--noop], [--no-noop]
|
115
|
-
[--cluster=CLUSTER] # Cluster. Overrides ufo/settings.yml.
|
126
|
+
[--cluster=CLUSTER] # Cluster. Overrides .ufo/settings.yml.
|
116
127
|
```
|
117
128
|
|
@@ -0,0 +1,38 @@
|
|
1
|
+
---
|
2
|
+
title: ufo network init
|
3
|
+
reference: true
|
4
|
+
---
|
5
|
+
|
6
|
+
## Usage
|
7
|
+
|
8
|
+
ufo network init
|
9
|
+
|
10
|
+
## Description
|
11
|
+
|
12
|
+
Creates network starter settings file.
|
13
|
+
|
14
|
+
## Examples
|
15
|
+
|
16
|
+
ufo network init # will use default vpc and subnets
|
17
|
+
ufo network init --vpc-id vpc-123
|
18
|
+
ufo network init --vpc-id vpc-123 --subnets subnet-aaa subnet-bbb
|
19
|
+
|
20
|
+
If the `--vpc-id` option is set and the `--subnets` is not, then ufo generates files with all the associated subnets from the specified vpc id.
|
21
|
+
|
22
|
+
You can also specify name of the settings file to create with the `--filename` option. Example.
|
23
|
+
|
24
|
+
ufo network init --vpc-id vpc-123 --filename dev
|
25
|
+
|
26
|
+
The above command creates a `.ufo/settings/network/dev.yml` file. You might want to then update your `.ufo/settings.yml` file and update the `network_profile` config to reference it.
|
27
|
+
|
28
|
+
|
29
|
+
## Options
|
30
|
+
|
31
|
+
```
|
32
|
+
[--force] # Bypass overwrite are you sure prompt for existing files.
|
33
|
+
[--subnets=one two three] # Subnets
|
34
|
+
[--vpc-id=VPC_ID] # Vpc id
|
35
|
+
[--filename=FILENAME] # Name of the settings file to create w/o extension.
|
36
|
+
# Default: default
|
37
|
+
```
|
38
|
+
|
@@ -0,0 +1,26 @@
|
|
1
|
+
---
|
2
|
+
title: ufo network
|
3
|
+
reference: true
|
4
|
+
---
|
5
|
+
|
6
|
+
## Usage
|
7
|
+
|
8
|
+
ufo network SUBCOMMAND
|
9
|
+
|
10
|
+
## Description
|
11
|
+
|
12
|
+
network subcommands
|
13
|
+
|
14
|
+
## Subcommands
|
15
|
+
|
16
|
+
* [ufo network init]({% link _reference/ufo-network-init.md %}) - Creates network starter settings file.
|
17
|
+
|
18
|
+
## Options
|
19
|
+
|
20
|
+
```
|
21
|
+
[--verbose], [--no-verbose]
|
22
|
+
[--mute], [--no-mute]
|
23
|
+
[--noop], [--no-noop]
|
24
|
+
[--cluster=CLUSTER] # Cluster. Overrides .ufo/settings.yml.
|
25
|
+
```
|
26
|
+
|