diff options
author | Maxim Kuvyrkov <maxim.kuvyrkov@linaro.org> | 2021-01-03 17:59:31 +0000 |
---|---|---|
committer | Maxim Kuvyrkov <maxim.kuvyrkov@linaro.org> | 2021-01-03 17:59:31 +0000 |
commit | 7654f42e2d36c49b388abc653c5017170eea3ce1 (patch) | |
tree | bfd4ae634249d9730432670c25df7a0bf7aa4eed /start-container-docker.sh | |
parent | 50781c0bdac875936dab082d1043f7f4a3317546 (diff) |
Docker image pull/use: Fix and improve
Change-Id: Ieb39c841151533d7553786f78f80fbb7a62857e2
Diffstat (limited to 'start-container-docker.sh')
-rwxr-xr-x | start-container-docker.sh | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/start-container-docker.sh b/start-container-docker.sh index bc3f6145..f306c34e 100755 --- a/start-container-docker.sh +++ b/start-container-docker.sh @@ -217,8 +217,8 @@ image=linaro/ci-${container_arch}-tcwg-build-ubuntu:${distro} stamp_dir=/home/shared/docker if ! [ -d "$stamp_dir" ]; then - sudo mkdir -p "$stamp_dir" - sudo chmod 0777 "$stamp_dir" + sudo mkdir -p "$stamp_dir" || mkdir -p "$stamp_dir" + sudo chmod 0777 "$stamp_dir" || chmod 0777 "$stamp_dir" fi # We use two stamp files per image: @@ -237,8 +237,8 @@ pull_image=false # that any change to master docker images will be deployed within a day. pull_if_older_than=$(($(date +%s) - 1*24*60*60)) # Use negative comparison to handle non-existent stamp files. -if ! [ "$(stat -c %Z "$image_stamp.pull" 2>/dev/null)" \ - -gt $pull_if_older_than ]; then +if ! [ "$(stat -c %Z "$image_stamp.pull")" \ + -gt $pull_if_older_than ] 2>/dev/null; then pull_image=true fi @@ -403,7 +403,7 @@ if $ssh_info; then fi # Update the time of image use, so that we don't remove the image in -# tcwg-cleanup-stale-containers . +# tcwg-cleanup-stale-containers. rm -f "$image_stamp.use" touch "$image_stamp.use" |