awes_cli 0.0.25 → 0.0.26

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
  SHA256:
3
- metadata.gz: e45de21aa2807bd1e0d36671b120836b878a3fc3637b87020b65c3a24ef25213
4
- data.tar.gz: 5a7952c65198f19e96412253c8a03e75cde414aedfdaa455227f2740c72645de
3
+ metadata.gz: 11b0868a3e61a6958996552fbaefaa668910307bf3c9467ee33aec2149597f0f
4
+ data.tar.gz: 2091c68dba8d1d3f73d73097b0280e6d6f5d1ff70d6ccb025355f7a8f78a22eb
5
5
  SHA512:
6
- metadata.gz: 16b4b1c840286cd11ca5c658f28a3388a811de313f40b98c640360116ecd46f07209aa45954cd9aac1e2ede841dba4e6e3d9ec286473c9235804d9ee0ff3636b
7
- data.tar.gz: 9927493efbc0938dff1d43c1dc3f994f6ab24077406f0cdd6ede2c6b9436035494f53c15c468149cff0fcb1edb3650bd9d23f56d8826fa65a30eaa678c672527
6
+ metadata.gz: c11381bc920e749aca8e4116bc1a8b55cd7274f199a3150ae34848f9ee953689f537f159f230230b1b7680c133a9791a095ff004089e5052e81b90abb93296bc
7
+ data.tar.gz: 45253514a729909c54ee2e48f0b549be76023ef0eb0a1a5eedb71d5f54561b6e19a4fc6d591f2192db88e66ac68a3700854419b6eea45ba1e190941d323f5f27
@@ -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
- shell_cmd("gcloud builds submit --project #{project_id} --timeout=20m --tag #{time_image_url} || true")
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
- shell_cmd("gcloud builds submit --project #{project_id} --timeout=20m --tag #{time_image_url} || true")
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
- shell_cmd("gcloud builds submit --project #{project_id} --timeout=20m --tag #{time_image_url} || true")
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.25
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: 2022-08-08 00:00:00.000000000 Z
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.4
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: []