Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F9124589
update_docker_image.ps1.erb
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
856 B
Subscribers
None
update_docker_image.ps1.erb
View Options
# Pulls a docker image.
# Returns 0 if there a change.
# Returns 2 if there is no change.
# Returns 3 if something when wrong.
#
param
(
[string]$DockerImage
)
Write-Information "Before - Looking for image"
$before=$(&
<%=
@docker_command
%>
inspect --type image --format='{{.Id}}' ${DockerImage} 2>$null)
Write-Information "Pulling image"
&
<%=
@docker_command
%>
pull ${DockerImage}
Write-Information "Inspecting image"
$after=$(&
<%=
@docker_command
%>
inspect --type image --format='{{.Id}}' ${DockerImage} 2>$null)
If (!$after) {
Write-Information "Docker image ${DockerImage} failed to pull!"
Exit 3
} ElseIf ($after -eq $before) {
Write-Information "No updates to ${DockerImage} available. Currently on ${after}."
Exit 2
} Else {
Write-Information "${DockerImage} updated. Changed from ${before} to ${after}."
Exit 0
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Jun 21, 7:17 PM (2 w, 4 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3402006
Attached To
R205 puppet-puppetlabs-docker
Event Timeline
Log In to Comment