awes_cli 0.0.13 → 0.0.17

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: 5b9a73dc5dbf7745e69146f02c3374ce6a957e43281ae0503c9ad80c53aa17ce
4
- data.tar.gz: de4640754c3386a108a1d998932d58f79c7314c1d2d10d36d6c45e0e1f22460e
3
+ metadata.gz: ae356ef2d3af8d4b50abe527873238f1f1f9d605e9c30360593574caf3fb32d7
4
+ data.tar.gz: 83a3518d0a80ecc9c0630c182a9f27fe9ff91484872dab852ac5e9d40d2c5845
5
5
  SHA512:
6
- metadata.gz: a989510de0b482da03abda2787c0d0a3c4b9b9930bff1b3ed63af0849c205535398beba98789f9d8a43fff67e4af8fd9c28dbfd22b2a315395f1a21f1e842b59
7
- data.tar.gz: 2125e83e81a46dc3edced849a9a79fab44c786113cdd6a50a66d022b7a90de86045d95cdb25c3aa8b3b6437cd2122bd98f89a75ad467dfc3f36d76735b924115
6
+ metadata.gz: 340b7a3aff0a95b635178a0c2c556227649e471bbd76b7535a01a89570f6788e7cfb83c72f6ad0f011f76a857d23d5c4e82ddc8897089bc5f2368f0390bc164d
7
+ data.tar.gz: 829d803fafe6b122941b97067a78ff5703ecfb3b2508a7f0e14d0a9d0cd6e0c0ab5c2b7773a4ac2e1d329fafc608d0b638e557a2d9c883a59b9320c3469c1dc2
@@ -5,7 +5,7 @@ class BuildAppImage
5
5
  def main
6
6
  options = get_options
7
7
 
8
- gcr_url = "gcr.io/#{options[:project_id]}/#{options[:app_name]}"
8
+ gcr_url = "gcr.io/#{options[:project_id]}/#{options[:image_repo]}"
9
9
 
10
10
  image_url = build_image(gcr_url, options)
11
11
  end
@@ -14,7 +14,7 @@ class BuildAppImage
14
14
  def get_options
15
15
  options = {}
16
16
 
17
- require_options_keys = [:project_id, :app_name]
17
+ require_options_keys = [:project_id, :image_repo]
18
18
 
19
19
  opt_parser = OptionParser.new do |opts|
20
20
  opts.banner = "Usage: ather build [options]"
@@ -27,8 +27,8 @@ class BuildAppImage
27
27
  options[:project_id] = val
28
28
  end
29
29
 
30
- opts.on("--app-name APP_NAME", "K8s app name [required or set env var APP_NAME]") do |val|
31
- options[:app_name] = val
30
+ opts.on("--image-repo IMAGE_REPO", "Image repo to deploy [required or set env var IMAGE_REPO]") do |val|
31
+ options[:image_repo] = val
32
32
  end
33
33
 
34
34
  opts.on("-h", "--help", "Prints this help") do
@@ -76,7 +76,6 @@ class BuildAppImage
76
76
  opt_image_url = options[:image_tag] && "#{gcr_url}:#{options[:image_tag]}"
77
77
 
78
78
  opt_image_url && shell_cmd("gcloud container images add-tag --quiet #{time_image_url} #{opt_image_url}")
79
-
80
- opt_image_url
79
+ shell_cmd("echo \"IMAGE_TAG=#{commit_image_tag}\" >> build.env")
81
80
  end
82
81
  end
data/lib/deploy_app.rb CHANGED
@@ -6,7 +6,7 @@ class DeployApp
6
6
  options = get_options
7
7
  take_approval(options)
8
8
 
9
- gcr_url = "gcr.io/#{options[:project_id]}/#{options[:app_name]}"
9
+ gcr_url = "gcr.io/#{options[:project_id]}/#{options[:image_repo] || options[:app_name]}"
10
10
 
11
11
  if(!options[:image_tag].nil?)
12
12
  image_url = validate_image_tag_exists?(gcr_url, options[:image_tag])
@@ -34,6 +34,10 @@ class DeployApp
34
34
  options[:image_tag] = val
35
35
  end
36
36
 
37
+ opts.on("--image-repo IMAGE_REPO", "Image repo to deploy [optional] default to K8s app name") do |val|
38
+ options[:image_repo] = val
39
+ end
40
+
37
41
  opts.on("--project-id PROJECT_ID", "GCP project id [required or set env var PROJECT_ID]") do |val|
38
42
  options[:project_id] = val
39
43
  end
data/lib/deploy_config.rb CHANGED
@@ -166,7 +166,7 @@ class DeployConfig
166
166
  opt_image_url = options[:image_tag] && "#{gcr_url}:#{options[:image_tag]}"
167
167
 
168
168
  image_url = "#{gcr_url}:current"
169
- image_url = spec[:image] if validate_image_tag_exists?(spec[:image])
169
+ image_url = spec[:image] if spec[:image].empty? && validate_image_tag_exists?(spec[:image])
170
170
  image_url = opt_image_url if validate_image_tag_exists?(opt_image_url)
171
171
 
172
172
  if !validate_image_tag_exists?(image_url)
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.13
4
+ version: 0.0.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - Umar Siddiqui
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-08-23 00:00:00.000000000 Z
11
+ date: 2021-10-25 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Ather cli tool
14
14
  email: umar.siddiqui@atherenergy.com