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 +4 -4
- data/CHANGELOG.md +6 -0
- data/docs/_docs/extras/dockerfile-erb.md +6 -6
- data/docs/_docs/upgrading/upgrade4.5.md +0 -2
- data/lib/ufo/base.rb +4 -0
- data/lib/ufo/core.rb +1 -1
- data/lib/ufo/destroy.rb +2 -2
- data/lib/ufo/ps.rb +1 -1
- data/lib/ufo/scale.rb +1 -1
- data/lib/ufo/stack/helper.rb +7 -9
- data/lib/ufo/upgrade/upgrade43to45.rb +1 -0
- data/lib/ufo/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 882615890a0eb95cf707cb6c001833e5b8631b8bacc75422712c0adc225f49af
|
4
|
+
data.tar.gz: c0cafd3bc2b4886ebf74eb1fd4a660d51571cdb332ca68504e17e05f39b8e94f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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
|
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
|
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
|
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
|
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
|
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
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/
|
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: #{
|
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 #{
|
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?
|
data/lib/ufo/stack/helper.rb
CHANGED
@@ -17,8 +17,7 @@ class Ufo::Stack
|
|
17
17
|
end
|
18
18
|
|
19
19
|
def adjust_stack_name(cluster, service)
|
20
|
-
|
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 "
|
30
|
-
[
|
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
|
33
|
-
#
|
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
|
-
|
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
|
data/lib/ufo/version.rb
CHANGED
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.
|
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-
|
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
|