Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
stuartpb committed Jan 13, 2015
1 parent 27224d2 commit 3522d46
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
6 changes: 4 additions & 2 deletions hooks/built-app/20_stash-old-iid
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ set -eo pipefail; [[ -n "$PLUSHU_TRACE" ]] && set -x
app_dir="$PLUSHU_APPS_DIR/$1"

# remove any lingering old iid
[[ -e "$app_dir/build.old.iid" ]] &&
if [[ -e "$app_dir/build.old.iid" ]]; then
docker rmi "$(<"$app_dir/build.old.iid")" > /dev/null &&
rm -f "$app_dir/build.old.iid"
fi

[[ -e "$app_dir/build.iid" ]] &&
if [[ -e "$app_dir/build.iid" ]]; then
mv -f "$app_dir/build.iid" "$app_dir/build.old.iid"
fi
6 changes: 4 additions & 2 deletions hooks/release-app/20_stash-old-iid
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ set -eo pipefail; [[ -n "$PLUSHU_TRACE" ]] && set -x
app_dir="$PLUSHU_APPS_DIR/$1"

# remove any lingering old iid
[[ -e "$app_dir/release.old.iid" ]] &&
if [[ -e "$app_dir/release.old.iid" ]]; then
docker rmi "$(<"$app_dir/release.old.iid")" > /dev/null &&
rm -f "$app_dir/release.old.iid"
fi

# stash the current iid
[[ -e "$app_dir/release.iid" ]] &&
if [[ -e "$app_dir/release.iid" ]]; then
mv -f "$app_dir/release.iid" "$app_dir/release.old.iid"
fi
6 changes: 4 additions & 2 deletions hooks/start-local-app/75_cleanup-old-images
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@ set -eo pipefail; [[ -n "$PLUSHU_TRACE" ]] && set -x

app_dir="$PLUSHU_APPS_DIR/$1"

[[ -e "$app_dir/build.old.iid" ]] &&
if [[ -e "$app_dir/build.old.iid" ]]; then
docker rmi "$(<"$app_dir/build.old.iid")" > /dev/null &&
rm -f "$app_dir/build.old.iid"
fi

[[ -e "$app_dir/release.old.iid" ]] &&
if [[ -e "$app_dir/release.old.iid" ]]; then
docker rmi "$(<"$app_dir/release.old.iid")" > /dev/null &&
rm -f "$app_dir/release.old.iid"
fi

0 comments on commit 3522d46

Please sign in to comment.