ufo 4.5.2 → 4.5.3

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: 87163ab28792dadd633294978d4add5e0aec9c88e8d9063a9ae5661dc5d08964
4
- data.tar.gz: 9259a17a58ddacf67007d2bc59b6ab2a9bbc48e70ea6d646675ac4e0ceb95e38
3
+ metadata.gz: 882615890a0eb95cf707cb6c001833e5b8631b8bacc75422712c0adc225f49af
4
+ data.tar.gz: c0cafd3bc2b4886ebf74eb1fd4a660d51571cdb332ca68504e17e05f39b8e94f
5
5
  SHA512:
6
- metadata.gz: 4f0ca5903c773c9203f56529799e400a94ab2a48d8f7a89ed76e6c13dc68f2b91dc849b449af7c534d3ab0eda9800c64c495a889831d3bcba74d9e50cf756218
7
- data.tar.gz: e93e17948eb44453f94816a64a2bd96b9d5f306fd1f4aa7473047b4714df175bf4d1cbb55592a7494e76c9a3ed00d351840246a6989d92933f3318438ad3873d
6
+ metadata.gz: 893d769390f42685a3046d44e8399f63548a971dd324462c0c7ddff7b000cd829ae7a48266ad51581747d3a0d52f0105d1cfb4e579390cac90c1e20f70ddec68
7
+ data.tar.gz: 53f5cb6aa31c5c08bb0c1ec24eb0994084b79f7f397ba5bb6d17db1b4aa3eb237c899cce34faf165838d373d0286dfcadf00b49e305cf2f621078e24533e3370
data/CHANGELOG.md CHANGED
@@ -3,6 +3,12 @@
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.5.3]
7
+ - fix error exit code when unable to find task definition
8
+ - fix upgrade for empty base setting
9
+ - improve ufo destroy confirm message
10
+ - #82 allow prepend_cluster
11
+
6
12
  ## [4.5.2]
7
13
  - add append_nothing option
8
14
 
@@ -3,11 +3,11 @@ title: Dynamic Dockerfile.erb
3
3
  nav_order: 32
4
4
  ---
5
5
 
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 as-is.
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.
7
7
 
8
8
  ## Example
9
9
 
10
- The Dockerfile.erb has access to variables defined in `dockerfile_variables.yml`. The variables should defined underneath an `UFO_ENV` key. Examples:
10
+ The Dockerfile.erb has access to variables defined in `dockerfile_variables.yml`. The variables should be defined underneath a `UFO_ENV` key. Examples:
11
11
 
12
12
  .ufo/settings/dockerfile_variables.yml:
13
13
 
@@ -29,7 +29,7 @@ FROM <%= @base_image %>
29
29
  CMD ["bin/web"]
30
30
  ```
31
31
 
32
- When `UFO_ENV=production`, it'll produced the following.
32
+ When `UFO_ENV=production`, it'll produce the following.
33
33
 
34
34
  Dockerfile:
35
35
 
@@ -39,11 +39,11 @@ FROM 778899001122.dkr.ecr.us-west-1.amazonaws.com/demo/sinatr:base-2019-06-10T03
39
39
  CMD ["bin/web"]
40
40
  ```
41
41
 
42
- The above example is demonstrates a good use-case. You may want a different FROM statement in your Dockerfile on a per-environment basis. In this case, we're using different ECR repositories from different AWS accounts for development vs production. The FROM statement changes based on which AWS account you're using.
42
+ The above example demonstrates a good use-case. You may want a different FROM statement in your Dockerfile on a per-environment basis. In this case, we're using different ECR repositories from different AWS accounts for development vs. production. The FROM statement changes based on which AWS account you're using.
43
43
 
44
44
  ## General Steps
45
45
 
46
- The generl steps are:
46
+ The general steps are:
47
47
 
48
48
  1. Create a Dockerfile.erb with `<%= @base_image %>`
49
49
  2. Run: `ufo docker base` to generate `dockerfile_variables.yml`
@@ -55,6 +55,6 @@ Remember when using the Dockerfile.erb, the Dockerfile is generated and overwrit
55
55
 
56
56
  Why not use [build args](https://www.jeffgeerling.com/blog/2017/use-arg-dockerfile-dynamic-image-specification)?
57
57
 
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.
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
60
  {% include prev_next.md %}
@@ -45,8 +45,6 @@ Version | Setting
45
45
  4.4 | stack_naming: append_cluster
46
46
  4.5 | stack_naming: append_ufo_env
47
47
 
48
- Support for `prepend_cluster` may be **removed** in future versions.
49
-
50
48
  ## Reasoning
51
49
 
52
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.
data/lib/ufo/base.rb CHANGED
@@ -27,5 +27,9 @@ No CloudFormation stack named #{@stack_name.color(:green)} found.
27
27
  Are sure it exists?
28
28
  EOL
29
29
  end
30
+
31
+ def full_service
32
+ [@service, Ufo.env_extra].compact.join("-")
33
+ end
30
34
  end
31
35
  end
data/lib/ufo/core.rb CHANGED
@@ -11,7 +11,7 @@ module Ufo
11
11
  puts "ERROR: Unable to find the task definition at #{task_definition_path}.".color(:red)
12
12
  puts "Are you sure you have defined it in ufo/template_definitions.rb and it has been generated correctly in .ufo/output?".color(:red)
13
13
  puts "If you are calling `ufo deploy` directly, you might want to generate the task definition first with `ufo tasks build`."
14
- exit
14
+ exit 1
15
15
  end
16
16
  end
17
17
 
data/lib/ufo/destroy.rb CHANGED
@@ -32,8 +32,8 @@ module Ufo
32
32
 
33
33
  def are_you_sure?
34
34
  return true if @options[:sure]
35
- puts "You are about to destroy #{@service.color(:green)} service on the #{@cluster.color(:green)} cluster."
36
- print "Are you sure you want to do this? (y/n) "
35
+ puts "You are about to destroy the #{@stack_name.color(:green)} stack. This contains the #{@service.color(:green)} service on the #{@cluster.color(:green)} cluster."
36
+ print "Are you sure you want to do this? (y/N) "
37
37
  answer = $stdin.gets.strip
38
38
  answer =~ /^y/
39
39
  end
data/lib/ufo/ps.rb CHANGED
@@ -29,7 +29,7 @@ module Ufo
29
29
 
30
30
  def summary
31
31
  return unless @options[:summary]
32
- puts "=> Service: #{@service}"
32
+ puts "=> Service: #{full_service}"
33
33
  puts " Service name: #{service.service_name}"
34
34
  puts " Status: #{service.status}"
35
35
  puts " Running count: #{service.running_count}"
data/lib/ufo/scale.rb CHANGED
@@ -18,7 +18,7 @@ module Ufo
18
18
  cluster: @cluster,
19
19
  desired_count: @count
20
20
  )
21
- puts "Scale #{@service.color(:green)} service in #{@cluster.color(:green)} cluster to #{@count}" unless @options[:mute]
21
+ puts "Scale #{full_service.color(:green)} service in #{@cluster.color(:green)} to #{@count}" unless @options[:mute]
22
22
  end
23
23
 
24
24
  def service_exists?
@@ -17,8 +17,7 @@ class Ufo::Stack
17
17
  end
18
18
 
19
19
  def adjust_stack_name(cluster, service)
20
- upgraded_namings = %w[append_ufo_env append_env append_cluster append_nothing prepend_nothing]
21
- unless upgraded_namings.include?(settings[:stack_naming])
20
+ if settings[:stack_naming].nil?
22
21
  puts "WARN: In ufo v4.5 the UFO_ENV value gets appends to the end of the CloudFormation stack name. This means a new stack gets created. You must upgrade to using the new stack and delete the old stack manually. More info: https://ufoships.com/docs/upgrading/upgrade4.5/".color(:yellow)
23
22
  puts "To get rid of this warning you can add `stack_naming: append_ufo_env` to your `.ufo/settings.yml config. New versions of ufo init do this automatically."
24
23
  puts "Pausing for 20 seconds."
@@ -26,17 +25,16 @@ class Ufo::Stack
26
25
  end
27
26
 
28
27
  parts = case settings[:stack_naming]
29
- when "append_ufo_env" # ufo v4.6
30
- [service, Ufo.env, Ufo.env_extra]
28
+ when "prepend_cluster" # ufo v4.3 and below
29
+ [cluster, service, Ufo.env_extra] # legacy
31
30
  when "append_env", "append_cluster" # ufo v4.5
32
- # append_env will be removed in the next major version in favor of apend_cluster.
33
- # To avoid confusiong with append_ufo_env
31
+ # append_env will be removed in the next major version in favor of append_cluster to avoid confusion with
32
+ # append_ufo_env
34
33
  [service, cluster, Ufo.env_extra]
35
34
  when "append_nothing", "prepend_nothing"
36
35
  [service, Ufo.env_extra]
37
- else
38
- # legacy, to be removed in next major version
39
- [cluster, service, Ufo.env_extra]
36
+ else # new default. ufo v4.5 and above
37
+ [service, Ufo.env, Ufo.env_extra]
40
38
  end
41
39
  parts.reject {|x| x==''}.compact.join('-') # stack_name
42
40
  end
@@ -16,6 +16,7 @@ class Ufo::Upgrade
16
16
  end
17
17
 
18
18
  puts "Upgrading to ufo v4.5..."
19
+ settings["base"] ||= {}
19
20
  settings["base"]["stack_naming"] = "append_ufo_env"
20
21
  text = YAML.dump(settings)
21
22
  IO.write(settings_path, text)
data/lib/ufo/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Ufo
2
- VERSION = "4.5.2"
2
+ VERSION = "4.5.3"
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: 4.5.2
4
+ version: 4.5.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tung Nguyen
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-06-14 00:00:00.000000000 Z
11
+ date: 2019-07-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-cloudformation