awes_cli 0.0.12 → 0.0.16

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: 45e8bc63d693bc56a8caec4132ef4247015a8dab5d5700de58ac5bfdcf2f6469
4
- data.tar.gz: f59ff2761788a4cae909c66f90c260d6043ea34aea9d9c84d0f6397a9efe5ac4
3
+ metadata.gz: 976175671147866776438637c2ee06daff8e55aeb7627905d209426a384dc8fd
4
+ data.tar.gz: 6924c13fc2614d6a0c7742c6c9e2cc3503bac0a78ae2e1248d77b3b06a61f35c
5
5
  SHA512:
6
- metadata.gz: a14dc4135709022157dab1a44e474fc6fe3d0f71c683e7c039dbdcdd433df045fbddcaa6a46b597c1547b3e686c2d21ffbfdc66b7a79a40359addcf50e2af50d
7
- data.tar.gz: d8eec4b98797c893c10703c77138c0f4f3fd6dd8f846821ba5d96eb68d5835d80e123a7e2ae14ac045e32fadf8a1b1a469e909099844669b640bbc3c53a2f977
6
+ metadata.gz: 9787637eb5cb323ffc6283803d0548413715b7aa3af315a5f27bb46793a689ce36d9d29bf8e9a9f04afed1d98846f0291c55db25ed99d83662b766b63c44fd48
7
+ data.tar.gz: 8dec561e51b237892c635271a667d3819c31c1fe2a44c7bc26b4b0542a39c91a0c0ba0157dfb2c32396d5d2aa11daf88ddffb4f708a1363cb531ae69f41bef70
@@ -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
@@ -159,14 +159,14 @@ class DeployConfig
159
159
  env_key = env_name[1..-1]
160
160
  env_val = override_envs[env_key] || ENV[env_key] || k8s_deployment_envs[env_key]
161
161
  next if env_val.nil?
162
- yaml_file.gsub!(env_name, "'#{env_val}'")
162
+ yaml_file.gsub!(/\$#{env_key}\s*$/, "'#{env_val}'")
163
163
  end
164
164
 
165
165
  gcr_url = "gcr.io/#{options[:project_id]}/#{options[:image_repo] || options[:app_name]}"
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] && 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.12
4
+ version: 0.0.16
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