awes_cli 0.0.3 → 0.0.9
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/deploy_config.rb +25 -5
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 912c0b612f6528b10417d66d062b3646f0526552c95af03c0d084a1f6f814256
|
4
|
+
data.tar.gz: 1932373450158a805b021a178067e1ec36163d64bf0675f90929eb7dd7ba44f7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 48e7098342c9676b5b7e37f95622925835b4f076b823363433912eadc7312356efc4592275c8120f5794ca525d681e1ab3711b3819f970ee59c6fdf82bddb38c
|
7
|
+
data.tar.gz: 353e9d9422aab3511da8f2c0492ea1386edc2dfa5cc0de08b4a182cc4cf51cfa789d4a94a91bf497f21f24097a932187e2f320bf6e1b507ffee625b3bfe233a5
|
data/lib/deploy_config.rb
CHANGED
@@ -119,7 +119,23 @@ class DeployConfig
|
|
119
119
|
end
|
120
120
|
|
121
121
|
def validate_image_tag_exists?(image_url)
|
122
|
-
|
122
|
+
system("gcloud container images describe #{image_url}")
|
123
|
+
end
|
124
|
+
|
125
|
+
def build_image(image_url, gcr_url, options)
|
126
|
+
commit_image_tag = ENV['CI_COMMIT_SHORT_SHA'] || `git rev-parse --short HEAD`
|
127
|
+
time_image_tag=`TZ=IST-5:30 date +'%Y.%m.%d.%HH.%MM.%SS'`
|
128
|
+
commit_image_url = "#{gcr_url}:#{commit_image_tag}".strip
|
129
|
+
time_image_url = "#{gcr_url}:#{time_image_tag}".strip
|
130
|
+
|
131
|
+
project_id = options[:project_id]
|
132
|
+
|
133
|
+
shell_cmd("gcloud builds submit --project #{project_id} --timeout=20m --tag #{time_image_url} || true")
|
134
|
+
|
135
|
+
shell_cmd("gcloud container images add-tag --quiet #{time_image_url} #{commit_image_url}")
|
136
|
+
|
137
|
+
shell_cmd("gcloud container images add-tag --quiet #{time_image_url} #{image_url}")
|
138
|
+
|
123
139
|
image_url
|
124
140
|
end
|
125
141
|
|
@@ -146,12 +162,16 @@ class DeployConfig
|
|
146
162
|
|
147
163
|
gcr_url = "gcr.io/#{options[:project_id]}/#{options[:app_name]}"
|
148
164
|
|
149
|
-
opt_image_url = options[:image_tag] && "#{gcr_url}:#{options[:image_tag]}"
|
165
|
+
# opt_image_url = options[:image_tag] && "#{gcr_url}:#{options[:image_tag]}"
|
150
166
|
|
151
|
-
image_url = opt_image_url || spec[:image] || "#{gcr_url}:current"
|
152
|
-
|
167
|
+
# image_url = opt_image_url || spec[:image] || "#{gcr_url}:current"
|
168
|
+
image_url = "#{gcr_url}:current"
|
169
|
+
|
170
|
+
if !validate_image_tag_exists?(image_url)
|
171
|
+
build_image(image_url, gcr_url, options)
|
172
|
+
end
|
153
173
|
|
154
|
-
yaml_file
|
174
|
+
yaml_file.gsub!(/\$IMAGE_URL/, image_url)
|
155
175
|
|
156
176
|
FileUtils.mkdir_p('./tmp')
|
157
177
|
|
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.9
|
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-
|
11
|
+
date: 2021-08-18 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Ather cli tool
|
14
14
|
email: umar.siddiqui@atherenergy.com
|