Page MenuHomeSoftware Heritage

update_docker_image.ps1.erb
No OneTemporary

update_docker_image.ps1.erb

# 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

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

Event Timeline