cuber 1.5.0 → 1.7.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/lib/cuber/cli.rb +1 -0
- data/lib/cuber/commands/ctl.rb +14 -0
- data/lib/cuber/cuberfile_parser.rb +5 -0
- data/lib/cuber/cuberfile_validator.rb +6 -0
- data/lib/cuber/templates/deployment.yml.erb +6 -1
- data/lib/cuber/version.rb +1 -1
- data/lib/cuber.rb +1 -0
- metadata +3 -2
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA256:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 687fb6dcbc68029a3b5f526d40afbea27d7a81c99d0609abeb294175daee01c0
         | 
| 4 | 
            +
              data.tar.gz: 201bef4d047a5bee19fe884414ec90b282f1606a8340cdb5ab6e7be4f6f585f5
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: ae0bcb075fe4ebe29f607c01b95de94308bcfb586e12498a5c369ae0162d362d8661581d90bb3b9a4e759f9fe3489ffe5760f203bc98ad4cca7c674405ff4b76
         | 
| 7 | 
            +
              data.tar.gz: 30c8adb2b0ec54586b3402a5b5b9778c2ea4094c5f164e96de01641538dd9808e356e5f481fb18393f4276f614927b8bc81a69a8d308f00f3533416b29834f53
         | 
    
        data/lib/cuber/cli.rb
    CHANGED
    
    
| @@ -15,6 +15,7 @@ module Cuber | |
| 15 15 | 
             
                  @cron = {}
         | 
| 16 16 | 
             
                  @secrets = {}
         | 
| 17 17 | 
             
                  @env = {}
         | 
| 18 | 
            +
                  @health = nil
         | 
| 18 19 | 
             
                  @lb = {}
         | 
| 19 20 | 
             
                  @ingress = nil
         | 
| 20 21 | 
             
                  @ssl = nil
         | 
| @@ -75,6 +76,10 @@ module Cuber | |
| 75 76 | 
             
                def env key, value, secret: false
         | 
| 76 77 | 
             
                  secret ? (@secrets[key] = value) : (@env[key] = value)
         | 
| 77 78 | 
             
                end
         | 
| 79 | 
            +
                
         | 
| 80 | 
            +
                def health url
         | 
| 81 | 
            +
                  @health = url
         | 
| 82 | 
            +
                end
         | 
| 78 83 |  | 
| 79 84 | 
             
                def lb key, value
         | 
| 80 85 | 
             
                  @lb[key] = value
         | 
| @@ -20,6 +20,7 @@ module Cuber | |
| 20 20 | 
             
                  validate_procs
         | 
| 21 21 | 
             
                  validate_cron
         | 
| 22 22 | 
             
                  validate_env
         | 
| 23 | 
            +
                  validate_health
         | 
| 23 24 | 
             
                  validate_lb
         | 
| 24 25 | 
             
                  validate_ingress
         | 
| 25 26 | 
             
                  validate_ssl
         | 
| @@ -103,6 +104,11 @@ module Cuber | |
| 103 104 | 
             
                    @errors << "env \"#{key}\" name can only include uppercase letters, digits or underscores" if key !~ /\A[A-Z_]+[A-Z0-9_]*\z/
         | 
| 104 105 | 
             
                  end
         | 
| 105 106 | 
             
                end
         | 
| 107 | 
            +
                
         | 
| 108 | 
            +
                def validate_health
         | 
| 109 | 
            +
                  return unless @options[:health]
         | 
| 110 | 
            +
                  @errors << 'health checks must be an http url' unless URI.parse(@options[:health]).kind_of? URI::HTTP
         | 
| 111 | 
            +
                end
         | 
| 106 112 |  | 
| 107 113 | 
             
                def validate_lb
         | 
| 108 114 | 
             
                  @options[:lb].each do |key, value|
         | 
| @@ -164,10 +164,15 @@ spec: | |
| 164 164 | 
             
                      value: "8080"
         | 
| 165 165 | 
             
                    ports:
         | 
| 166 166 | 
             
                    - containerPort: 8080
         | 
| 167 | 
            +
                    <%- end -%>
         | 
| 168 | 
            +
                    <%- if procname.to_s == 'web' && @options[:health] -%>
         | 
| 167 169 | 
             
                    readinessProbe:
         | 
| 168 170 | 
             
                      httpGet:
         | 
| 169 | 
            -
                        path:  | 
| 171 | 
            +
                        path: <%= URI.parse(@options[:health]).path.to_json %>
         | 
| 170 172 | 
             
                        port: 8080
         | 
| 173 | 
            +
                        httpHeaders:
         | 
| 174 | 
            +
                          - name: Host
         | 
| 175 | 
            +
                            value: <%= URI.parse(@options[:health]).host.to_json %>
         | 
| 171 176 | 
             
                    <%- end -%>
         | 
| 172 177 | 
             
                  <%- if @options[:migrate] && @options[:migrate][:check] -%>
         | 
| 173 178 | 
             
                  initContainers:
         | 
    
        data/lib/cuber/version.rb
    CHANGED
    
    
    
        data/lib/cuber.rb
    CHANGED
    
    
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: cuber
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 1. | 
| 4 | 
            +
              version: 1.7.0
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Cuber
         | 
| 8 8 | 
             
            autorequire: 
         | 
| 9 9 | 
             
            bindir: bin
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date: 2022- | 
| 11 | 
            +
            date: 2022-11-02 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies: []
         | 
| 13 13 | 
             
            description: 
         | 
| 14 14 | 
             
            email: 
         | 
| @@ -23,6 +23,7 @@ files: | |
| 23 23 | 
             
            - cuber.gemspec
         | 
| 24 24 | 
             
            - lib/cuber.rb
         | 
| 25 25 | 
             
            - lib/cuber/cli.rb
         | 
| 26 | 
            +
            - lib/cuber/commands/ctl.rb
         | 
| 26 27 | 
             
            - lib/cuber/commands/deploy.rb
         | 
| 27 28 | 
             
            - lib/cuber/commands/info.rb
         | 
| 28 29 | 
             
            - lib/cuber/commands/logs.rb
         |