mikoshi 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
 - data/.rubocop.yml +3 -0
 - data/README.md +3 -0
 - data/lib/mikoshi/cli.rb +7 -2
 - data/lib/mikoshi/plan/service.rb +4 -2
 - data/lib/mikoshi/util/except_keys.rb +16 -0
 - data/lib/mikoshi/version.rb +1 -1
 - metadata +3 -2
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA1:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 56bb8fdf71e768f178771479a4cd619c69393ff3
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 1db7396f7a154aa01873b9a0d120be26895c131d
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 2e26bed49e82178f2e09e6b909c5532823c6430b5d778e52d5e2e786fcab8d4dec1badf6a7c5e441918bbb42c1e5f99138108aad9db688d021c99ffe8912c87e
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 4ac04275fc78b7bda44b91cefebfc1cacfe333fc3ccc4260413421820c61bb44e620c2b0e70895125087157f93b3c5973b0261fa6ff158bc702b6b76399ae66a
         
     | 
    
        data/.rubocop.yml
    CHANGED
    
    
    
        data/README.md
    CHANGED
    
    
    
        data/lib/mikoshi/cli.rb
    CHANGED
    
    | 
         @@ -41,9 +41,14 @@ module Mikoshi 
     | 
|
| 
       41 
41 
     | 
    
         
             
                desc 'deploy', 'Deploy task definition and service'
         
     | 
| 
       42 
42 
     | 
    
         
             
                method_option :task_definition, type: :string, desc: 'task_definition name', aliases: '-t'
         
     | 
| 
       43 
43 
     | 
    
         
             
                method_option :service, type: :string, desc: 'service name', aliases: '-s'
         
     | 
| 
      
 44 
     | 
    
         
            +
                method_option :group, type: :string, desc: 'service and task definition name(if both are same)', aliases: '-g'
         
     | 
| 
      
 45 
     | 
    
         
            +
             
     | 
| 
       44 
46 
     | 
    
         
             
                def deploy
         
     | 
| 
       45 
     | 
    
         
            -
                   
     | 
| 
       46 
     | 
    
         
            -
                   
     | 
| 
      
 47 
     | 
    
         
            +
                  task_definition = options[:group] || options[:task_definition] || nil
         
     | 
| 
      
 48 
     | 
    
         
            +
                  service = options[:group] || options[:service] || nil
         
     | 
| 
      
 49 
     | 
    
         
            +
             
     | 
| 
      
 50 
     | 
    
         
            +
                  update_task_definition(task_definition) if task_definition
         
     | 
| 
      
 51 
     | 
    
         
            +
                  update_service(service) if service
         
     | 
| 
       47 
52 
     | 
    
         
             
                end
         
     | 
| 
       48 
53 
     | 
    
         | 
| 
       49 
54 
     | 
    
         
             
                no_tasks do
         
     | 
    
        data/lib/mikoshi/plan/service.rb
    CHANGED
    
    | 
         @@ -1,12 +1,14 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            # frozen_string_literal: true
         
     | 
| 
       2 
2 
     | 
    
         | 
| 
       3 
     | 
    
         
            -
            require 'active_support/core_ext/hash/except'
         
     | 
| 
       4 
3 
     | 
    
         
             
            require 'mikoshi/plan'
         
     | 
| 
      
 4 
     | 
    
         
            +
            require 'mikoshi/util/except_keys'
         
     | 
| 
       5 
5 
     | 
    
         | 
| 
       6 
6 
     | 
    
         
             
            module Mikoshi
         
     | 
| 
       7 
7 
     | 
    
         
             
              class Plan
         
     | 
| 
       8 
8 
     | 
    
         
             
                class Service < Base
         
     | 
| 
       9 
9 
     | 
    
         
             
                  TASK_DEFINITION_WITH_REVISION = %r{\A\S+:\d+\z}
         
     | 
| 
      
 10 
     | 
    
         
            +
                  IGNORE_OPTIONS_WHEN_UPDATE =
         
     | 
| 
      
 11 
     | 
    
         
            +
                    %i[client_token load_balancers placement_constraints placement_strategy role service_name].freeze
         
     | 
| 
       10 
12 
     | 
    
         | 
| 
       11 
13 
     | 
    
         
             
                  def initialize(yaml_path: nil, client: nil)
         
     | 
| 
       12 
14 
     | 
    
         
             
                    super
         
     | 
| 
         @@ -30,7 +32,7 @@ module Mikoshi 
     | 
|
| 
       30 
32 
     | 
    
         
             
                  def update_service
         
     | 
| 
       31 
33 
     | 
    
         
             
                    invoke_before_update_hooks
         
     | 
| 
       32 
34 
     | 
    
         | 
| 
       33 
     | 
    
         
            -
                    @client.update_service(@data[:service]. 
     | 
| 
      
 35 
     | 
    
         
            +
                    @client.update_service(@data[:service].except_keys(IGNORE_OPTIONS_WHEN_UPDATE))
         
     | 
| 
       34 
36 
     | 
    
         
             
                    wait_until_services_stable
         
     | 
| 
       35 
37 
     | 
    
         | 
| 
       36 
38 
     | 
    
         
             
                    invoke_after_update_hooks
         
     | 
| 
         @@ -0,0 +1,16 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            # frozen_string_literal: true
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            require 'active_support/core_ext/hash/except'
         
     | 
| 
      
 4 
     | 
    
         
            +
             
     | 
| 
      
 5 
     | 
    
         
            +
            class Hash
         
     | 
| 
      
 6 
     | 
    
         
            +
              def except_keys(keys_enum)
         
     | 
| 
      
 7 
     | 
    
         
            +
                return dup.except!(keys_enum) unless keys_enum.respond_to?(:each)
         
     | 
| 
      
 8 
     | 
    
         
            +
             
     | 
| 
      
 9 
     | 
    
         
            +
                clone = dup
         
     | 
| 
      
 10 
     | 
    
         
            +
                keys_enum.each do |key|
         
     | 
| 
      
 11 
     | 
    
         
            +
                  clone.except!(key)
         
     | 
| 
      
 12 
     | 
    
         
            +
                end
         
     | 
| 
      
 13 
     | 
    
         
            +
             
     | 
| 
      
 14 
     | 
    
         
            +
                clone
         
     | 
| 
      
 15 
     | 
    
         
            +
              end
         
     | 
| 
      
 16 
     | 
    
         
            +
            end
         
     | 
    
        data/lib/mikoshi/version.rb
    CHANGED
    
    
    
        metadata
    CHANGED
    
    | 
         @@ -1,14 +1,14 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: mikoshi
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 0. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.4.0
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Yusuke Nakamura
         
     | 
| 
       8 
8 
     | 
    
         
             
            autorequire: 
         
     | 
| 
       9 
9 
     | 
    
         
             
            bindir: exe
         
     | 
| 
       10 
10 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
     | 
    
         
            -
            date: 2017- 
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2017-06-02 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: activesupport
         
     | 
| 
         @@ -160,6 +160,7 @@ files: 
     | 
|
| 
       160 
160 
     | 
    
         
             
            - lib/mikoshi/plan.rb
         
     | 
| 
       161 
161 
     | 
    
         
             
            - lib/mikoshi/plan/service.rb
         
     | 
| 
       162 
162 
     | 
    
         
             
            - lib/mikoshi/plan/task_definition.rb
         
     | 
| 
      
 163 
     | 
    
         
            +
            - lib/mikoshi/util/except_keys.rb
         
     | 
| 
       163 
164 
     | 
    
         
             
            - lib/mikoshi/version.rb
         
     | 
| 
       164 
165 
     | 
    
         
             
            - mikoshi.gemspec
         
     | 
| 
       165 
166 
     | 
    
         
             
            homepage: https://github.com/unasuke/mikoshi
         
     |