Skip to content

Commit 631afe6

Browse files
committed
maniftest tag data
1 parent 897fdd9 commit 631afe6

File tree

3 files changed

+40
-3
lines changed

3 files changed

+40
-3
lines changed

app/lib/client/code/ecr_images.rb

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,31 @@ def untag_image(tag, image)
180180
delete_image(tag, image)
181181
end
182182

183+
def get_manifest_tag(image)
184+
tag = UC3S3::ConfigObjectsClient.client.get_ecs_release_manifest_stack_tag(image)
185+
return '' if tag.empty?
186+
187+
options = {
188+
repository_name: image,
189+
image_ids: [
190+
{
191+
image_tag: tag
192+
}
193+
]
194+
}
195+
options[:registry_id] = ENV.fetch('ECR_ACCOUNT', '') unless ENV.fetch('ECR_ACCOUNT', '').empty?
196+
resp = @client.describe_images(options)
197+
return '' if resp.image_details.nil?
198+
199+
date = ''
200+
resp.image_details.each do |img|
201+
date = img.image_pushed_at if img.image_pushed_at
202+
end
203+
return tag if date.nil?
204+
205+
{ title: "#{tag}* (#{date_format(date)})", value: tag }
206+
end
207+
183208
def get_image_tags_by_digest(image, tag, digest)
184209
arr = []
185210
return arr unless enabled

app/lib/client/resources/ecs.rb

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def list_services_data
7878
updated: date_format(dep.updated_at, convert_timezone: true),
7979
image: [image, digest],
8080
tags: @ecr_client.get_image_tags_by_digest(image_name, image_tag, digest),
81-
manifest_tag: UC3S3::ConfigObjectsClient.client.get_ecs_release_manifest_stack_tag(image_name)
81+
manifest_tag: @ecr_client.get_manifest_tag(image_name)
8282
}
8383
end
8484
end
@@ -280,7 +280,14 @@ def list_scheduled_tasks
280280
def retag_and_redeploy_service(service)
281281
return unless enabled
282282

283-
repo = service == 'ui' ? 'mrt-dashboard' : "mrt-#{service}"
283+
repo = case service
284+
when 'ui'
285+
'mrt-dashboard'
286+
when 'admintool'
287+
'mrt-admin-sinatra'
288+
else
289+
"mrt-#{service}"
290+
end
284291

285292
tag = UC3S3::ConfigObjectsClient.client.get_ecs_release_manifest_stack_tag(repo)
286293

app/public/admintool.css

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,11 +153,16 @@ span.val {
153153
display: block;
154154
}
155155

156-
td.image span.val:nth-of-type(2), td.digest {
156+
td.image span.val:nth-of-type(2) {
157157
max-width: 130px;
158158
display: inline-block;
159159
color: green;
160160
}
161+
td.digest {
162+
max-width: 100px;
163+
color: green;
164+
}
165+
161166
span.inline {
162167
display: inline;
163168
}

0 commit comments

Comments
 (0)