ufo 3.2.1 → 3.2.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2cd2207a0617cee46aeb0459643f5fcd3fa2605ea7e0052020bd310e987dc38b
4
- data.tar.gz: f3bf371e109599f6ea57418abbd3b87dba06400144c97028af46d32ad7a2fd0c
3
+ metadata.gz: f2b8040ac25daf8bb18e20492774df63394ebde64beaa05146146c12565f32c4
4
+ data.tar.gz: b9466b234f2c5d6a6b9cc4e838247546757e94ef8b4e11f1164e7517bf83147c
5
5
  SHA512:
6
- metadata.gz: 0d391674506d0f5b68cd4e403a6a6d14141c52069244f991a4b280e69d013c0d7ce6be8a8a66b6a05bedb4600d2b28b171ec9aab6820113e2c00aaf1208368d5
7
- data.tar.gz: 3c857cfabc2c40297f40271c75fc728fe4a556f35534b4b9451b650c81d7216b6e6bf87ac1861e210322e06c4a179e0114fbde4ef158a120838033a5254c6a0d
6
+ metadata.gz: 6802b517797d2a056cb08d9c3ca07e1840caf281bcbfe12c103f1c1485b226e7da4c9cc6e804beb6581e37667e45152b76978a895c3cc8d4ab9c4bfd5a151544
7
+ data.tar.gz: 1ce8caef75586ed9cb21434bdc225605ef92418a1e643282e99ecdcba46d9817f153edd3d323978f4414bafbb71895146504601eef86d2670f257277f86e66ac
@@ -3,6 +3,11 @@
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
+ ## [3.2.2]
7
+ - add .ufo/data to gitignore for upgrade3
8
+ - allow system exit to normally happen for rendering error in the task definition
9
+ - docs grammar fixes
10
+
6
11
  ## [3.2.1]
7
12
  - ensure settings is always a hash even when settings.yml has nil
8
13
  - move cli_markdown as development dependency
@@ -2,13 +2,13 @@
2
2
  title: Auto Completion
3
3
  ---
4
4
 
5
- Ufo supports bash auto-completion. To set it up add this to your `~/.profile` or `.bashrc`:
5
+ Ufo supports bash auto-completion. To set it up add the following to your `~/.profile` or `.bashrc`:
6
6
 
7
7
  ```
8
8
  eval $(ufo completion_script)
9
9
  ```
10
10
 
11
- Don't forget to restart your shell.
11
+ Remember to restart your shell or source your profile file.
12
12
 
13
13
  Auto Completion examples:
14
14
 
@@ -2,7 +2,7 @@
2
2
  title: Automated Clean Up
3
3
  ---
4
4
 
5
- Ufo can be configured to automatically clean old images from the ECR registry after the deploy completes by configuring the your [settings.yml]({% link _docs/settings.md %}) file like so:
5
+ 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:
6
6
 
7
7
  ```yaml
8
8
  ecr_keep: 30
@@ -2,21 +2,21 @@
2
2
  title: Conventions
3
3
  ---
4
4
 
5
- Ufo uses a set of naming conventions. This helps enforce some best practices and also allows the ufo commands to be concise. Ufo allows you to easily override or bypass the conventions if you need it.
5
+ Ufo uses a set of naming conventions. This helps enforce some best practices and also allows the ufo commands to be concise. You can override or bypass the conventions easily.
6
6
 
7
7
  ## UFO_ENV to ECS Cluster Convention
8
8
 
9
- By default, the ECS cluster value is the same as UFO_ENV's value. So if `UFO_ENV=production` then the ECS Cluster is `production` and if `UFO_ENV=development` then the ECS Cluster is `development`. You can easily override this convention by specifying the `--cluster` CLI option. You can also override this behavior with [settings.yml]({% link _docs/settings.md %}) to spare you from having to type `--cluster` over and over.
9
+ By default, the ECS cluster value is the same as UFO_ENV's value. So if `UFO_ENV=production` then the ECS Cluster is `production` and if `UFO_ENV=development` then the ECS Cluster is `development`. You can override this convention by specifying the `--cluster` CLI option. You can also override this behavior with [settings.yml]({% link _docs/settings.md %}) to spare you from having to type `--cluster` repeatedly.
10
10
 
11
11
  ## Service and Task Names Convention
12
12
 
13
- Ufo assumes a convention that service\_name and the task\_name are the same. If you would like to override this convention then you can specify the task name.
13
+ Ufo assumes a convention that service\_name and the task\_name are the same. If you would like to override this convention, then you can specify the task name.
14
14
 
15
15
  ```
16
16
  ufo ship hi-web --task my-task
17
17
  ```
18
18
 
19
- This means that in the task_definition.rb you will also defined it with `my-task`. For example:
19
+ This means that in the task_definition.rb you will also define it with `my-task`. For example:
20
20
 
21
21
  ```ruby
22
22
  task_definition "my-task" do
@@ -4,14 +4,14 @@ title: Helpers
4
4
 
5
5
  The `task_definitions.rb` file has access to helper methods. These helper methods provide useful contextual information about the project.
6
6
 
7
- For example, one of the helper methods provides the exposed port in the Dockerfile of the project. This is useful if someone changes the exported port in the Dockerfile, he likely to forget to also update the ufo variable so it is referenced via the helper. Here is a list of the helpers:
7
+ For example, one of the helper methods provides the exposed port in the Dockerfile of the project. This is useful if someone changes the exported port in the Dockerfile, he will likely forget to also update the ufo variable. You can reference the port via the helper to prevent this from happening. Here is a list of the helpers:
8
8
 
9
9
  Helper | Description
10
10
  ------------- | -------------
11
11
  full\_image\_name | The full docker image name that ufo builds. The "base" portion of the docker image name is defined in `settings.yml`. For example, the base portion is `tongueroo/hi` and the full image name is `tongueroo/hi:ufo-[timestamp]-[sha]`. The base name does not include the generated Docker tag, which contains a timestamp and git sha of the Dockerfile that is used.
12
12
  dockerfile\_port | Exposed port extracted from the Dockerfile of the project. 
13
13
  env_vars(text) | This method takes a block of text that contains the env values in `key=value` format and converts that block of text to the proper task definition json format.
14
- env_file(path) | This method takes an `.env` file which contains a simple key value list of environment variables and converts the list to the proper task definition json format.
14
+ env_file(path) | This method takes a `.env` file which contains a simple key-value list of environment variables and converts the list to the proper task definition JSON format.
15
15
  task_definition_name | The name of the task_definition. So if the code looks like this `task_definition "demo-web" do`, the task_definition_name is "demo-web".
16
16
 
17
17
  To call the helper in task_definitions.rb you must add `helper.` in front. So `full_image_name` is called via `helper.full_image_name`.
@@ -18,7 +18,7 @@ gem "ufo"
18
18
 
19
19
  ## Install with Bolts Toolbelt
20
20
 
21
- If you want to quickly install ufo without having to worry about ufo's dependencies you can simply install the Bolts Toolbelt which has ufo included.
21
+ If you want to quickly install ufo without having to worry about ufo's dependencies you can install the Bolts Toolbelt which has ufo included.
22
22
 
23
23
  ```sh
24
24
  brew cask install boltopslabs/software/bolts
@@ -2,7 +2,7 @@
2
2
  title: Database Migrations
3
3
  ---
4
4
 
5
- A common task is to run database migrations with newer code before deploying the actual code. This is easily achieved with the `ufo task` command. Here's an example:
5
+ 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:
6
6
 
7
7
  ```sh
8
8
  ufo task hi-web --command bundle exec rake db:migrate
@@ -21,11 +21,11 @@ The `bin/migrate` script can look like this:
21
21
  bundle exec rake db:migrate
22
22
  ```
23
23
 
24
- The `ufo task` command is generalized so you can actually run any one-off task. It is not just limited to running migrations. The `ufo task` command performs the following:
24
+ The `ufo task` command is generalized so you can run any one-off task. It is not just limited to running migrations. The `ufo task` command performs the following:
25
25
 
26
26
  1. Builds the docker image and pushes it to a registry
27
27
  2. Registers the ECS Task definition
28
- 3. Runs an one-off ECS Task
28
+ 3. Runs a one-off ECS Task
29
29
 
30
30
  <a id="prev" class="btn btn-basic" href="{% link _docs/single-task.md %}">Back</a>
31
31
  <a id="next" class="btn btn-primary" href="{% link _docs/automated-cleanup.md %}">Next Step</a>
@@ -49,7 +49,7 @@ AWS_PROFILE=my-dev-profile => UFO_ENV=development
49
49
  AWS_PROFILE=whatever => UFO_ENV=development # since there are no profiles that match
50
50
  ```
51
51
 
52
- Notice how `AWS_PROFILE=whatever` results in `UFO_ENV=development`. This is because there are not matching aws_profiles in the `settings.yml`. More info on settings is available at [settings]({% link _docs/settings.md %}).
52
+ 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 %}).
53
53
 
54
54
  <a id="prev" class="btn btn-basic" href="{% link _docs/settings.md %}">Back</a>
55
55
  <a id="next" class="btn btn-primary" href="{% link _docs/variables.md %}">Next Step</a>
@@ -28,7 +28,7 @@ Shared variables also support a concept called layering. The `variables/base.rb
28
28
  @environment = helper.env_file(".env")
29
29
  ```
30
30
 
31
- When `ufo ship` is ran with `UFO_ENV=production` he `variables/production.rb` will be evaluated and layered on top of the variables defined in `base.rb:
31
+ When `ufo ship` is ran with `UFO_ENV=production` he `variables/production.rb` will be evaluated and layered on top of the variables defined in `base.rb`:
32
32
 
33
33
  `.ufo/variables/production.rb`:
34
34
 
@@ -39,7 +39,7 @@ When `ufo ship` is ran with `UFO_ENV=production` he `variables/production.rb` wi
39
39
  ])
40
40
  ```
41
41
 
42
- When `ufo ship` is ran with `UFO_ENV=development` the `variables/development.rb` will be evaluated and layered on top of the variables defined in `base.rb:
42
+ When `ufo ship` is ran with `UFO_ENV=development` the `variables/development.rb` will be evaluated and layered on top of the variables defined in `base.rb`:
43
43
 
44
44
 
45
45
  `.ufo/variables/development.rb`:
@@ -27,9 +27,13 @@ module Ufo
27
27
  begin
28
28
  instance_eval(source_code, @template_definitions_path)
29
29
  rescue Exception => e
30
- task_definition_error(e)
31
- puts "\nFull error:"
32
- raise
30
+ if e.class == SystemExit # allow exit to happen normally
31
+ raise
32
+ else
33
+ task_definition_error(e)
34
+ puts "\nFull error:"
35
+ raise
36
+ end
33
37
  end
34
38
  end
35
39
 
@@ -39,17 +39,17 @@ module Ufo
39
39
  data = YAML.load(content)
40
40
  # If key is is accidentally set to nil it screws up the merge_base later.
41
41
  # So ensure that all keys with nil value are set to {}
42
- data.each do |ufo_env, _setting|
43
- data[ufo_env] ||= {}
42
+ data.each do |env, _setting|
43
+ data[env] ||= {}
44
44
  end
45
45
  data
46
46
  end
47
47
 
48
48
  # automatically add base settings to the rest of the environments
49
49
  def merge_base(all_envs)
50
- base = all_envs["base"]
51
- all_envs.each do |ufo_env, env_settings|
52
- all_envs[ufo_env] = base.merge(env_settings) unless ufo_env == "base"
50
+ base = all_envs["base"] || {}
51
+ all_envs.each do |env, settings|
52
+ all_envs[env] = base.merge(settings) unless env == "base"
53
53
  end
54
54
  all_envs
55
55
  end
@@ -35,9 +35,11 @@ module Ufo
35
35
 
36
36
  def upgrade_gitignore
37
37
  lines = IO.readlines(".gitignore")
38
- text = lines.map do |line|
39
- line.sub(/[\/]?ufo/, '.ufo')
40
- end.join
38
+ lines.map! do |line|
39
+ line.sub(/[\/]?ufo/, '.ufo')
40
+ end
41
+ lines << [".ufo/data\n"] # new ignore rule
42
+ text = lines.join
41
43
  IO.write(".gitignore", text)
42
44
  end
43
45
 
@@ -1,3 +1,3 @@
1
1
  module Ufo
2
- VERSION = "3.2.1"
2
+ VERSION = "3.2.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ufo
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.1
4
+ version: 3.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tung Nguyen
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-02-27 00:00:00.000000000 Z
11
+ date: 2018-03-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-cloudwatchlogs