ufo 1.0.0 → 1.0.1

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
  SHA1:
3
- metadata.gz: dfca9e6d1cee650f151b4ad478f5fd3fb48ab840
4
- data.tar.gz: 76d021b7c76d3215fe4fbddd07785c26d889c31c
3
+ metadata.gz: e3d8f1f8c2b21980b90a1b68dfb5d79387c24aa1
4
+ data.tar.gz: 0e9a2a98ed9672e1afcbab2b227cb1ddf451b879
5
5
  SHA512:
6
- metadata.gz: 23b34f792eeff2b250a5215a2b44c99405aa04cc33bc985c1f5ccbc6ee66587b25bc98f869e4cc3f8c03a4710a38db5147457c606cdcafedc9ca700ea420cdee
7
- data.tar.gz: 5eb6c95ab9839e658f9cd4dae7275d4d1bf0c6c784f92d169e4c036e85fd341b0a36d6412707dd0e681a7978c2f2553c12d6cd9b1644650896423326b8ee310a
6
+ metadata.gz: 293470c3e6910644e4ab203af44f7b46a6b424f34adefe3fda97e430382c88043ef99f6d521dafa61d3ed9cab530f15e3430e23bee32484154272d666998ea14
7
+ data.tar.gz: d0a9fa4d3043a1cf834658299fef0f1cb142194d819ace3cc89967bee9888882776e254e5e7c4a84af258b54f6bf5517c861d4731734eb62b12f967c7266b291
@@ -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
+ ## [1.0.1]
7
+
8
+ * simplify `ufo task` command option
9
+
6
10
  ## [1.0.0]
7
11
 
8
12
  * add `ufo task` command
data/README.md CHANGED
@@ -253,16 +253,14 @@ Sometimes you do not want to run a long running `service` but a one time task. R
253
253
  ufo task hi-migrate-prod
254
254
  ```
255
255
 
256
- You will need to define a task definition for the migrate command also in `ufo/task_definitions.rb`. If you only need to override the Docker command and can re-use an existing task definition like `hi-web-prod`. You can use the `--override-command` option:
256
+ You will need to define a task definition for the migrate command also in `ufo/task_definitions.rb`. If you only need to override the Docker command and can re-use an existing task definition like `hi-web-prod`. You can use the `--command` option:
257
257
 
258
258
  ```
259
- ufo task hi-web-prod --override-command '["bin/migrate"]'
260
- ufo task hi-web-prod --override-command bin/migrate
261
- ufo task hi-web-prod --override-command "bin/with_env bundle exec rake db:migrate:redo VERSION=xxx"
262
- ufo task hi-web-prod --override-command '["bin/with_env", "bundle", "exec", "rake", "db:migrate:redo", "VERSION=xxx"]''
259
+ ufo task hi-web-prod --command bin/migrate
260
+ ufo task hi-web-prod --command bin/with_env bundle exec rake db:migrate:redo VERSION=xxx
263
261
  ```
264
262
 
265
- The `--override-command` option takes a string. If the string has brackets in it then it will be evaluated as an Array but the option must be a string.
263
+ The `--command` option takes a string. If the string has brackets in it then it will be evaluated as an Array but the option must be a string.
266
264
 
267
265
  ## Scale
268
266
 
@@ -112,7 +112,7 @@ module Ufo
112
112
  desc "task [TASK_DEFINITION]", "runs a one time task"
113
113
  long_desc Help.task
114
114
  option :docker, type: :boolean, desc: "Enable docker build and push", default: true
115
- option :command, desc: "Override the command used for the container"
115
+ option :command, type: :array, desc: "Override the command used for the container"
116
116
  def task(task_definition)
117
117
  build_docker(options)
118
118
  register_task(task_definition, options)
@@ -145,17 +145,12 @@ To run a one time task with ECS:
145
145
 
146
146
  $ ufo task hi-migrate-prod
147
147
 
148
- You can also override the command used by the Docker container in the task definitions via override-command.
148
+ You can also override the command used by the Docker container in the task definitions via command.
149
149
 
150
- ufo task hi-web-prod --override-command bin/migrate
150
+ ufo task hi-web-prod --command bin/migrate
151
151
 
152
- ufo task hi-web-prod --override-command '["bin/migrate"]'
152
+ ufo task hi-web-prod --command bin/with_env bundle exec rake db:migrate:redo VERSION=xxx
153
153
 
154
- ufo task hi-web-prod --override-command "bin/with_env bundle exec rake db:migrate:redo VERSION=xxx"
155
-
156
- ufo task hi-web-prod --override-command '["bin/with_env","bundle","exec","rake","db:migrate:redo","VERSION=xxx"]''
157
-
158
- The `--override-command` option takes a string. If the string has brackets in it then it will be evaluated as an Array but the optoin must be a string. Also there can be no spaces in the string.
159
154
  EOL
160
155
  end
161
156
 
@@ -24,8 +24,7 @@ module Ufo
24
24
  private
25
25
  # only using the overrides to override the container command
26
26
  def overrides
27
- command = @options[:command]
28
- command = eval(command) if command.include?('[') # command is in Array form
27
+ command = @options[:command] # Thor parser ensure this is always an array
29
28
  container_definition = get_original_container_definition
30
29
  {
31
30
  container_overrides: [
@@ -1,3 +1,3 @@
1
1
  module Ufo
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ufo
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tung Nguyen