awes_cli 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/deploy_config.rb +21 -2
- 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: b72f73478620b53b20cb928c317b045af6cb29fa54052b9d5a8d7e3fc9363e43
|
4
|
+
data.tar.gz: 67afc453ad192bd671ed0432095992cf65bc865329819961983f3942ecdf0e73
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d43cd9ab7326927042cbcdb6bd000b24f38c0ff2561e2cb006e2a32b34bdf515a9c72640c2ade40ec97f68f74ef2cea9003e02bf34c98800503425d8eea21228
|
7
|
+
data.tar.gz: b4533486ec19c1acd89cca1fe641daec2bb8d0ed701c2b030b57a8982d011b3f808fbe888dce26826784f4ef05cec46d619896d59df235b629de8f2b158af3e1
|
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
|
|
@@ -149,7 +165,10 @@ class DeployConfig
|
|
149
165
|
opt_image_url = options[:image_tag] && "#{gcr_url}:#{options[:image_tag]}"
|
150
166
|
|
151
167
|
image_url = opt_image_url || spec[:image] || "#{gcr_url}:current"
|
152
|
-
|
168
|
+
|
169
|
+
if !validate_image_tag_exists?(image_url)
|
170
|
+
build_image(image_url, gcr_url, options)
|
171
|
+
end
|
153
172
|
|
154
173
|
yaml_file['$IMAGE_URL'] = image_url
|
155
174
|
|
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.4
|
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-04 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Ather cli tool
|
14
14
|
email: umar.siddiqui@atherenergy.com
|