awes_cli 0.0.25 → 0.0.26
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/build_app_image.rb +19 -2
- data/lib/deploy_app.rb +15 -2
- data/lib/deploy_config.rb +15 -2
- metadata +6 -6
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA256:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 11b0868a3e61a6958996552fbaefaa668910307bf3c9467ee33aec2149597f0f
         | 
| 4 | 
            +
              data.tar.gz: 2091c68dba8d1d3f73d73097b0280e6d6f5d1ff70d6ccb025355f7a8f78a22eb
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: c11381bc920e749aca8e4116bc1a8b55cd7274f199a3150ae34848f9ee953689f537f159f230230b1b7680c133a9791a095ff004089e5052e81b90abb93296bc
         | 
| 7 | 
            +
              data.tar.gz: 45253514a729909c54ee2e48f0b549be76023ef0eb0a1a5eedb71d5f54561b6e19a4fc6d591f2192db88e66ac68a3700854419b6eea45ba1e190941d323f5f27
         | 
    
        data/lib/build_app_image.rb
    CHANGED
    
    | @@ -15,10 +15,15 @@ class BuildAppImage | |
| 15 15 | 
             
                  options = {}
         | 
| 16 16 |  | 
| 17 17 | 
             
                  require_options_keys = [:project_id, :image_repo]
         | 
| 18 | 
            +
                  optional_options_keys = [:cluster_location, :img_worker_pool]
         | 
| 18 19 |  | 
| 19 20 | 
             
                  opt_parser = OptionParser.new do |opts|
         | 
| 20 21 | 
             
                    opts.banner = "Usage: ather build [options]"
         | 
| 21 22 |  | 
| 23 | 
            +
                    opts.on("--img-worker-pool IMG_WORKER_POOL", "Img worker pool to build [optional]") do |val|
         | 
| 24 | 
            +
                      options[:img_worker_pool] = val
         | 
| 25 | 
            +
                    end
         | 
| 26 | 
            +
                    
         | 
| 22 27 | 
             
                    opts.on("--image-tag IMAGE_TAG", "Addtional Image tag to build [optional]") do |val|
         | 
| 23 28 | 
             
                      options[:image_tag] = val
         | 
| 24 29 | 
             
                    end
         | 
| @@ -31,6 +36,10 @@ class BuildAppImage | |
| 31 36 | 
             
                      options[:image_repo] = val
         | 
| 32 37 | 
             
                    end
         | 
| 33 38 |  | 
| 39 | 
            +
                    opts.on("--cluster-location CLUSTER_LOCATION", "App name [required or set env var CLUSTER_LOCATION]") do |val|
         | 
| 40 | 
            +
                      options[:cluster_location] = val
         | 
| 41 | 
            +
                    end
         | 
| 42 | 
            +
             | 
| 34 43 | 
             
                    opts.on("-h", "--help", "Prints this help") do
         | 
| 35 44 | 
             
                      puts opts
         | 
| 36 45 | 
             
                      exit
         | 
| @@ -48,6 +57,13 @@ class BuildAppImage | |
| 48 57 | 
             
                    end
         | 
| 49 58 | 
             
                  end
         | 
| 50 59 |  | 
| 60 | 
            +
                  optional_options_keys.each do |key|
         | 
| 61 | 
            +
                    options[key] ||= ENV[key.to_s.upcase]
         | 
| 62 | 
            +
                    if options[key].nil?
         | 
| 63 | 
            +
                      options.delete(key)
         | 
| 64 | 
            +
                    end
         | 
| 65 | 
            +
                  end
         | 
| 66 | 
            +
             | 
| 51 67 | 
             
                  options
         | 
| 52 68 | 
             
                end
         | 
| 53 69 |  | 
| @@ -68,8 +84,9 @@ class BuildAppImage | |
| 68 84 | 
             
                  time_image_url = "#{gcr_url}:#{time_image_tag}".strip
         | 
| 69 85 |  | 
| 70 86 | 
             
                  project_id = options[:project_id]
         | 
| 71 | 
            -
             | 
| 72 | 
            -
                   | 
| 87 | 
            +
                  worker_pool = options.key?(:img_worker_pool) && !options[:img_worker_pool].empty? ? "--worker-pool projects/#{project_id}/locations/#{options[:cluster_location]}/workerPools/#{options[:img_worker_pool]}" : ""
         | 
| 88 | 
            +
                  
         | 
| 89 | 
            +
                  shell_cmd("gcloud builds submit --project #{project_id} --timeout=20m --tag #{time_image_url} #{worker_pool} || true")
         | 
| 73 90 |  | 
| 74 91 | 
             
                  shell_cmd("gcloud container images add-tag --quiet #{time_image_url} #{commit_image_url}")
         | 
| 75 92 |  | 
    
        data/lib/deploy_app.rb
    CHANGED
    
    | @@ -24,6 +24,7 @@ class DeployApp | |
| 24 24 | 
             
                  options = {}
         | 
| 25 25 |  | 
| 26 26 | 
             
                  require_options_keys = [:project_id, :app_name, :namespace, :cluster, :cluster_location]
         | 
| 27 | 
            +
                  optional_options_keys = [:img_worker_pool]
         | 
| 27 28 |  | 
| 28 29 | 
             
                  opt_parser = OptionParser.new do |opts|
         | 
| 29 30 | 
             
                    opts.banner = "Usage: ather deploy app [options]"
         | 
| @@ -32,6 +33,10 @@ class DeployApp | |
| 32 33 | 
             
                      options[:approve] = flag
         | 
| 33 34 | 
             
                    end
         | 
| 34 35 |  | 
| 36 | 
            +
                    opts.on("--img-worker-pool IMG_WORKER_POOL", "Img worker pool to build [optional]") do |val|
         | 
| 37 | 
            +
                      options[:img_worker_pool] = val
         | 
| 38 | 
            +
                    end
         | 
| 39 | 
            +
             | 
| 35 40 | 
             
                    opts.on("--image-tag IMAGE_TAG", "Image tag to deploy [optional]") do |val|
         | 
| 36 41 | 
             
                      options[:image_tag] = val
         | 
| 37 42 | 
             
                    end
         | 
| @@ -77,6 +82,13 @@ class DeployApp | |
| 77 82 | 
             
                    end
         | 
| 78 83 | 
             
                  end
         | 
| 79 84 |  | 
| 85 | 
            +
                  optional_options_keys.each do |key|
         | 
| 86 | 
            +
                    options[key] ||= ENV[key.to_s.upcase]
         | 
| 87 | 
            +
                    if options[key].nil?
         | 
| 88 | 
            +
                      options.delete(key)
         | 
| 89 | 
            +
                    end
         | 
| 90 | 
            +
                  end
         | 
| 91 | 
            +
             | 
| 80 92 | 
             
                  options
         | 
| 81 93 | 
             
                end
         | 
| 82 94 |  | 
| @@ -116,8 +128,9 @@ class DeployApp | |
| 116 128 | 
             
                  time_image_url = "#{gcr_url}:#{time_image_tag}".strip
         | 
| 117 129 |  | 
| 118 130 | 
             
                  project_id = options[:project_id]
         | 
| 119 | 
            -
             | 
| 120 | 
            -
                   | 
| 131 | 
            +
                  worker_pool = options.key?(:img_worker_pool) && !options[:img_worker_pool].empty? ? "--worker-pool projects/#{project_id}/locations/#{options[:cluster_location]}/workerPools/#{options[:img_worker_pool]}" : ""
         | 
| 132 | 
            +
                  
         | 
| 133 | 
            +
                  shell_cmd("gcloud builds submit --project #{project_id} --timeout=20m --tag #{time_image_url} #{worker_pool} || true")
         | 
| 121 134 |  | 
| 122 135 | 
             
                  shell_cmd("gcloud container images add-tag --quiet #{time_image_url} #{commit_image_url}")
         | 
| 123 136 |  | 
    
        data/lib/deploy_config.rb
    CHANGED
    
    | @@ -24,6 +24,7 @@ class DeployConfig | |
| 24 24 | 
             
                  options = {}
         | 
| 25 25 |  | 
| 26 26 | 
             
                  require_options_keys = [:project_id, :app_name, :namespace, :cluster, :cluster_location, :kuztomize_env]
         | 
| 27 | 
            +
                  optional_options_keys = [:cluster_location, :img_worker_pool]
         | 
| 27 28 |  | 
| 28 29 | 
             
                  opt_parser = OptionParser.new do |opts|
         | 
| 29 30 | 
             
                    opts.banner = "Usage: ather deploy config [options]"
         | 
| @@ -32,6 +33,10 @@ class DeployConfig | |
| 32 33 | 
             
                      options[:approve] = flag
         | 
| 33 34 | 
             
                    end
         | 
| 34 35 |  | 
| 36 | 
            +
                    opts.on("--img-worker-pool IMG_WORKER_POOL", "Img worker pool to build [optional]") do |val|
         | 
| 37 | 
            +
                      options[:img_worker_pool] = val
         | 
| 38 | 
            +
                    end
         | 
| 39 | 
            +
             | 
| 35 40 | 
             
                    opts.on("--image-tag IMAGE_TAG", "Image tag to deploy [optional]") do |val|
         | 
| 36 41 | 
             
                      options[:image_tag] = val
         | 
| 37 42 | 
             
                    end
         | 
| @@ -81,6 +86,13 @@ class DeployConfig | |
| 81 86 | 
             
                    end
         | 
| 82 87 | 
             
                  end
         | 
| 83 88 |  | 
| 89 | 
            +
                  optional_options_keys.each do |key|
         | 
| 90 | 
            +
                    options[key] ||= ENV[key.to_s.upcase]
         | 
| 91 | 
            +
                    if options[key].nil?
         | 
| 92 | 
            +
                      options.delete(key)
         | 
| 93 | 
            +
                    end
         | 
| 94 | 
            +
                  end
         | 
| 95 | 
            +
             | 
| 84 96 | 
             
                  options
         | 
| 85 97 | 
             
                end
         | 
| 86 98 |  | 
| @@ -133,8 +145,9 @@ class DeployConfig | |
| 133 145 | 
             
                  time_image_url = "#{gcr_url}:#{time_image_tag}".strip
         | 
| 134 146 |  | 
| 135 147 | 
             
                  project_id = options[:project_id]
         | 
| 136 | 
            -
             | 
| 137 | 
            -
                   | 
| 148 | 
            +
                  worker_pool = options.key?(:img_worker_pool) && !options[:img_worker_pool].empty? ? "--worker-pool projects/#{project_id}/locations/#{options[:cluster_location]}/workerPools/#{options[:img_worker_pool]}" : ""
         | 
| 149 | 
            +
                  
         | 
| 150 | 
            +
                  shell_cmd("gcloud builds submit --project #{project_id} --timeout=20m --tag #{time_image_url} #{worker_pool} || true")
         | 
| 138 151 |  | 
| 139 152 | 
             
                  shell_cmd("gcloud container images add-tag --quiet #{time_image_url} #{commit_image_url}")
         | 
| 140 153 |  | 
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: awes_cli
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0.0. | 
| 4 | 
            +
              version: 0.0.26
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Umar Siddiqui
         | 
| 8 | 
            -
            autorequire:
         | 
| 8 | 
            +
            autorequire: 
         | 
| 9 9 | 
             
            bindir: bin
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date:  | 
| 11 | 
            +
            date: 2023-01-16 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies: []
         | 
| 13 13 | 
             
            description: Ather cli tool
         | 
| 14 14 | 
             
            email: umar.siddiqui@atherenergy.com
         | 
| @@ -26,7 +26,7 @@ homepage: https://rubygems.org/gems/awes_cli | |
| 26 26 | 
             
            licenses:
         | 
| 27 27 | 
             
            - MIT
         | 
| 28 28 | 
             
            metadata: {}
         | 
| 29 | 
            -
            post_install_message:
         | 
| 29 | 
            +
            post_install_message: 
         | 
| 30 30 | 
             
            rdoc_options: []
         | 
| 31 31 | 
             
            require_paths:
         | 
| 32 32 | 
             
            - lib
         | 
| @@ -41,8 +41,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement | |
| 41 41 | 
             
                - !ruby/object:Gem::Version
         | 
| 42 42 | 
             
                  version: '0'
         | 
| 43 43 | 
             
            requirements: []
         | 
| 44 | 
            -
            rubygems_version: 3.1 | 
| 45 | 
            -
            signing_key:
         | 
| 44 | 
            +
            rubygems_version: 3.0.3.1
         | 
| 45 | 
            +
            signing_key: 
         | 
| 46 46 | 
             
            specification_version: 4
         | 
| 47 47 | 
             
            summary: Ather cli tool
         | 
| 48 48 | 
             
            test_files: []
         |