kuby-core 0.11.3 → 0.11.9
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/CHANGELOG.md +22 -0
 - data/lib/kuby.rb +4 -2
 - data/lib/kuby/commands.rb +2 -0
 - data/lib/kuby/docker/dev_spec.rb +7 -0
 - data/lib/kuby/docker/metadata.rb +1 -1
 - data/lib/kuby/plugin_registry.rb +1 -1
 - data/lib/kuby/plugins/rails_app/generators/kuby.rb +9 -1
 - data/lib/kuby/plugins/rails_app/mysql.rb +5 -0
 - data/lib/kuby/plugins/rails_app/plugin.rb +2 -0
 - data/lib/kuby/plugins/rails_app/postgres.rb +19 -0
 - data/lib/kuby/plugins/rails_app/sqlite.rb +13 -0
 - data/lib/kuby/version.rb +2 -2
 - 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: c8dee9ccc32bf324c552b229219f3d8b704b3dfd5324da1a955e929f2789c4ac
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: e5fc43a0320adc589ac1be2f4cfdb6802016ee962cfa7bf33fee9a8a48eab53e
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 3a639a3e57d19629cdb5934bb7bc259c1b0de1d7f48c81683fb746664cba3c1d0526c5be2e2fbe752dd6604c5bce3b770f7231cdac738df4c0123a1730025af0
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 2eb4703287635c6455956f295d000a8911454c2ba05d1edaf40bbdb060368ce4a38d44a6e9394db95fcf2a2ef764598ddf5ed399eb58aed0b5d3423e139765bc
         
     | 
    
        data/CHANGELOG.md
    CHANGED
    
    | 
         @@ -1,3 +1,25 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            ## 0.11.9
         
     | 
| 
      
 2 
     | 
    
         
            +
            * Use correct Docker Hub registry URL (index.docker.io).
         
     | 
| 
      
 3 
     | 
    
         
            +
             
     | 
| 
      
 4 
     | 
    
         
            +
            ## 0.11.8
         
     | 
| 
      
 5 
     | 
    
         
            +
            * Alias Rails `config_map` to `env`.
         
     | 
| 
      
 6 
     | 
    
         
            +
             
     | 
| 
      
 7 
     | 
    
         
            +
            ## 0.11.7
         
     | 
| 
      
 8 
     | 
    
         
            +
            * Properly namespace constant lookup for `Kubernetes::MissingPluginError`.
         
     | 
| 
      
 9 
     | 
    
         
            +
            * Add missing `#storage` method for Postgres plugin.
         
     | 
| 
      
 10 
     | 
    
         
            +
             
     | 
| 
      
 11 
     | 
    
         
            +
            ## 0.11.6
         
     | 
| 
      
 12 
     | 
    
         
            +
            * Fix Rails generator.
         
     | 
| 
      
 13 
     | 
    
         
            +
              - Causing `undefined method 'module_parent_name'`. Apparently `module_parent_name` wasn't introduced until Rails 6.
         
     | 
| 
      
 14 
     | 
    
         
            +
             
     | 
| 
      
 15 
     | 
    
         
            +
            ## 0.11.5
         
     | 
| 
      
 16 
     | 
    
         
            +
            * Raise friendlier error when attempting to add Docker credentials in the development environment.
         
     | 
| 
      
 17 
     | 
    
         
            +
            * Raise friendlier error when attempting to set a username and password for SQLite databases.
         
     | 
| 
      
 18 
     | 
    
         
            +
             
     | 
| 
      
 19 
     | 
    
         
            +
            ## 0.11.4
         
     | 
| 
      
 20 
     | 
    
         
            +
            * Fix bug causing crash when running CLI commands.
         
     | 
| 
      
 21 
     | 
    
         
            +
              - Turns out was caused by adding a Sorbet type annotation inside an anonymous singleton class and forgetting to extend `T::Sig`. Thanks @lazyatom!
         
     | 
| 
      
 22 
     | 
    
         
            +
             
     | 
| 
       1 
23 
     | 
    
         
             
            ## 0.11.3
         
     | 
| 
       2 
24 
     | 
    
         
             
            * I've gone back and forth a few times on this, but I decided to put the initializer code back into the Rails generator.
         
     | 
| 
       3 
25 
     | 
    
         | 
    
        data/lib/kuby.rb
    CHANGED
    
    | 
         @@ -59,8 +59,10 @@ module Kuby 
     | 
|
| 
       59 
59 
     | 
    
         
             
                        tls_enabled false
         
     | 
| 
       60 
60 
     | 
    
         | 
| 
       61 
61 
     | 
    
         
             
                        database do
         
     | 
| 
       62 
     | 
    
         
            -
                           
     | 
| 
       63 
     | 
    
         
            -
             
     | 
| 
      
 62 
     | 
    
         
            +
                          if requires_credentials?
         
     | 
| 
      
 63 
     | 
    
         
            +
                            user(DEFAULT_DB_USER)
         
     | 
| 
      
 64 
     | 
    
         
            +
                            password(DEFAULT_DB_PASSWORD)
         
     | 
| 
      
 65 
     | 
    
         
            +
                          end
         
     | 
| 
       64 
66 
     | 
    
         
             
                        end
         
     | 
| 
       65 
67 
     | 
    
         
             
                      end
         
     | 
| 
       66 
68 
     | 
    
         | 
    
        data/lib/kuby/commands.rb
    CHANGED
    
    | 
         @@ -19,6 +19,8 @@ module Kuby 
     | 
|
| 
       19 
19 
     | 
    
         
             
                # avoid the usual series of cryptic alias_method calls (note that there
         
     | 
| 
       20 
20 
     | 
    
         
             
                # is no singleton class version of #prepend in the Ruby language).
         
     | 
| 
       21 
21 
     | 
    
         
             
                singleton_class.send(:prepend, Module.new do
         
     | 
| 
      
 22 
     | 
    
         
            +
                  extend T::Sig
         
     | 
| 
      
 23 
     | 
    
         
            +
             
     | 
| 
       22 
24 
     | 
    
         
             
                  sig { params(args: T::Array[String]).void }
         
     | 
| 
       23 
25 
     | 
    
         
             
                  def run(args)
         
     | 
| 
       24 
26 
     | 
    
         
             
                    if idx = args.index('rails') || idx = args.index('rake')
         
     | 
    
        data/lib/kuby/docker/dev_spec.rb
    CHANGED
    
    | 
         @@ -115,6 +115,13 @@ module Kuby 
     | 
|
| 
       115 
115 
     | 
    
         
             
                    layer_stack.includes?(name)
         
     | 
| 
       116 
116 
     | 
    
         
             
                  end
         
     | 
| 
       117 
117 
     | 
    
         | 
| 
      
 118 
     | 
    
         
            +
                  sig {
         
     | 
| 
      
 119 
     | 
    
         
            +
                    params(block: T.nilable(T.proc.void)).returns(Credentials)
         
     | 
| 
      
 120 
     | 
    
         
            +
                  }
         
     | 
| 
      
 121 
     | 
    
         
            +
                  def credentials(&block)
         
     | 
| 
      
 122 
     | 
    
         
            +
                    raise 'Docker credentials are not supported in the development environment'
         
     | 
| 
      
 123 
     | 
    
         
            +
                  end
         
     | 
| 
      
 124 
     | 
    
         
            +
             
     | 
| 
       118 
125 
     | 
    
         
             
                  sig { returns(Dockerfile) }
         
     | 
| 
       119 
126 
     | 
    
         
             
                  def to_dockerfile
         
     | 
| 
       120 
127 
     | 
    
         
             
                    Dockerfile.new.tap do |df|
         
     | 
    
        data/lib/kuby/docker/metadata.rb
    CHANGED
    
    | 
         @@ -8,7 +8,7 @@ module Kuby 
     | 
|
| 
       8 
8 
     | 
    
         
             
                  extend T::Sig
         
     | 
| 
       9 
9 
     | 
    
         | 
| 
       10 
10 
     | 
    
         
             
                  DEFAULT_DISTRO = :debian
         
     | 
| 
       11 
     | 
    
         
            -
                  DEFAULT_REGISTRY_HOST = T.let('https:// 
     | 
| 
      
 11 
     | 
    
         
            +
                  DEFAULT_REGISTRY_HOST = T.let('https://index.docker.io'.freeze, String)
         
     | 
| 
       12 
12 
     | 
    
         
             
                  DEFAULT_REGISTRY_SCHEME = T.let('https', String)
         
     | 
| 
       13 
13 
     | 
    
         
             
                  LATEST_TAG = T.let('latest'.freeze, String)
         
     | 
| 
       14 
14 
     | 
    
         | 
    
        data/lib/kuby/plugin_registry.rb
    CHANGED
    
    | 
         @@ -12,7 +12,7 @@ module Kuby 
     | 
|
| 
       12 
12 
     | 
    
         
             
                  plugins_by_env = plugins[plugin_name]
         
     | 
| 
       13 
13 
     | 
    
         | 
| 
       14 
14 
     | 
    
         
             
                  unless plugins_by_env
         
     | 
| 
       15 
     | 
    
         
            -
                    raise MissingPluginError, "no plugin registered with name #{plugin_name}, "\
         
     | 
| 
      
 15 
     | 
    
         
            +
                    raise Kubernetes::MissingPluginError, "no plugin registered with name #{plugin_name}, "\
         
     | 
| 
       16 
16 
     | 
    
         
             
                      'do you need to add a gem to your Gemfile?'
         
     | 
| 
       17 
17 
     | 
    
         
             
                  end
         
     | 
| 
       18 
18 
     | 
    
         | 
| 
         @@ -14,6 +14,14 @@ class KubyGenerator < Rails::Generators::Base 
     | 
|
| 
       14 
14 
     | 
    
         
             
              end
         
     | 
| 
       15 
15 
     | 
    
         | 
| 
       16 
16 
     | 
    
         
             
              def create_config_file
         
     | 
| 
      
 17 
     | 
    
         
            +
                app_class = Rails.application.class
         
     | 
| 
      
 18 
     | 
    
         
            +
             
     | 
| 
      
 19 
     | 
    
         
            +
                app_name = if app_class.respond_to?(:module_parent_name)
         
     | 
| 
      
 20 
     | 
    
         
            +
                  app_class.module_parent_name
         
     | 
| 
      
 21 
     | 
    
         
            +
                else
         
     | 
| 
      
 22 
     | 
    
         
            +
                  app_class.parent_name
         
     | 
| 
      
 23 
     | 
    
         
            +
                end
         
     | 
| 
      
 24 
     | 
    
         
            +
             
     | 
| 
       17 
25 
     | 
    
         
             
                create_file(
         
     | 
| 
       18 
26 
     | 
    
         
             
                  'kuby.rb',
         
     | 
| 
       19 
27 
     | 
    
         
             
                  <<~END
         
     | 
| 
         @@ -21,7 +29,7 @@ class KubyGenerator < Rails::Generators::Base 
     | 
|
| 
       21 
29 
     | 
    
         
             
                    require 'active_support/encrypted_configuration'
         
     | 
| 
       22 
30 
     | 
    
         | 
| 
       23 
31 
     | 
    
         
             
                    # Define a production Kuby deploy environment
         
     | 
| 
       24 
     | 
    
         
            -
                    Kuby.define('#{ 
     | 
| 
      
 32 
     | 
    
         
            +
                    Kuby.define('#{app_name}') do
         
     | 
| 
       25 
33 
     | 
    
         
             
                      environment(:production) do
         
     | 
| 
       26 
34 
     | 
    
         
             
                        # Because the Rails environment isn't always loaded when
         
     | 
| 
       27 
35 
     | 
    
         
             
                        # your Kuby config is loaded, provide access to Rails
         
     | 
| 
         @@ -1,4 +1,5 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            # typed: false
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
       2 
3 
     | 
    
         
             
            require 'kube-dsl'
         
     | 
| 
       3 
4 
     | 
    
         
             
            require 'kuby/kube-db'
         
     | 
| 
       4 
5 
     | 
    
         | 
| 
         @@ -18,6 +19,10 @@ module Kuby 
     | 
|
| 
       18 
19 
     | 
    
         
             
                      password(config['password'])
         
     | 
| 
       19 
20 
     | 
    
         
             
                    end
         
     | 
| 
       20 
21 
     | 
    
         | 
| 
      
 22 
     | 
    
         
            +
                    def requires_credentials?
         
     | 
| 
      
 23 
     | 
    
         
            +
                      true
         
     | 
| 
      
 24 
     | 
    
         
            +
                    end
         
     | 
| 
      
 25 
     | 
    
         
            +
             
     | 
| 
       21 
26 
     | 
    
         
             
                    def name
         
     | 
| 
       22 
27 
     | 
    
         
             
                      :postgres
         
     | 
| 
       23 
28 
     | 
    
         
             
                    end
         
     | 
| 
         @@ -58,6 +63,20 @@ module Kuby 
     | 
|
| 
       58 
63 
     | 
    
         
             
                        end
         
     | 
| 
       59 
64 
     | 
    
         
             
                      end
         
     | 
| 
       60 
65 
     | 
    
         
             
                    end
         
     | 
| 
      
 66 
     | 
    
         
            +
                    
         
     | 
| 
      
 67 
     | 
    
         
            +
                    def storage(amount)
         
     | 
| 
      
 68 
     | 
    
         
            +
                      database do
         
     | 
| 
      
 69 
     | 
    
         
            +
                        spec do
         
     | 
| 
      
 70 
     | 
    
         
            +
                          storage do
         
     | 
| 
      
 71 
     | 
    
         
            +
                            resources do
         
     | 
| 
      
 72 
     | 
    
         
            +
                              requests do
         
     | 
| 
      
 73 
     | 
    
         
            +
                                set :storage, amount
         
     | 
| 
      
 74 
     | 
    
         
            +
                              end
         
     | 
| 
      
 75 
     | 
    
         
            +
                            end
         
     | 
| 
      
 76 
     | 
    
         
            +
                          end
         
     | 
| 
      
 77 
     | 
    
         
            +
                        end
         
     | 
| 
      
 78 
     | 
    
         
            +
                      end
         
     | 
| 
      
 79 
     | 
    
         
            +
                    end        
         
     | 
| 
       61 
80 
     | 
    
         | 
| 
       62 
81 
     | 
    
         
             
                    def secret(&block)
         
     | 
| 
       63 
82 
     | 
    
         
             
                      context = self
         
     | 
| 
         @@ -1,4 +1,5 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            # typed: true
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
       2 
3 
     | 
    
         
             
            module Kuby
         
     | 
| 
       3 
4 
     | 
    
         
             
              module Plugins
         
     | 
| 
       4 
5 
     | 
    
         
             
                module RailsApp
         
     | 
| 
         @@ -14,6 +15,18 @@ module Kuby 
     | 
|
| 
       14 
15 
     | 
    
         
             
                      environment.docker.package_phase.add(:sqlite_client)
         
     | 
| 
       15 
16 
     | 
    
         
             
                    end
         
     | 
| 
       16 
17 
     | 
    
         | 
| 
      
 18 
     | 
    
         
            +
                    def requires_credentials?
         
     | 
| 
      
 19 
     | 
    
         
            +
                      false
         
     | 
| 
      
 20 
     | 
    
         
            +
                    end
         
     | 
| 
      
 21 
     | 
    
         
            +
             
     | 
| 
      
 22 
     | 
    
         
            +
                    def user(_user)
         
     | 
| 
      
 23 
     | 
    
         
            +
                      raise 'SQLite databases do not require a username or password'
         
     | 
| 
      
 24 
     | 
    
         
            +
                    end
         
     | 
| 
      
 25 
     | 
    
         
            +
             
     | 
| 
      
 26 
     | 
    
         
            +
                    def password(_password)
         
     | 
| 
      
 27 
     | 
    
         
            +
                      raise 'SQLite databases do not require a username or password'
         
     | 
| 
      
 28 
     | 
    
         
            +
                    end
         
     | 
| 
      
 29 
     | 
    
         
            +
             
     | 
| 
       17 
30 
     | 
    
         
             
                    def name
         
     | 
| 
       18 
31 
     | 
    
         
             
                      :sqlite
         
     | 
| 
       19 
32 
     | 
    
         
             
                    end
         
     | 
    
        data/lib/kuby/version.rb
    CHANGED
    
    
    
        metadata
    CHANGED
    
    | 
         @@ -1,14 +1,14 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: kuby-core
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 0.11. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.11.9
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Cameron Dutro
         
     | 
| 
       8 
8 
     | 
    
         
             
            autorequire:
         
     | 
| 
       9 
9 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       10 
10 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
     | 
    
         
            -
            date: 2020-10- 
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2020-10-29 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: colorize
         
     |