Skip to content

Commit

Permalink
bugfix-deployment-bugs (#439)
Browse files Browse the repository at this point in the history
* need -y flag on `package-cleanup`

Took 33 minutes

* don't cleanup ecs-config containers.

Took 10 minutes

* Call docker_clean before pulling or building ecs-install

Took 35 seconds
  • Loading branch information
padthaitofuhot committed Jun 4, 2018
1 parent b0482c3 commit f317406
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 10 deletions.
2 changes: 1 addition & 1 deletion tools/zerofill.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
process() {

echo "Reducing ephemera"
sudo package-cleanup --oldkernels --count=1
sudo package-cleanup -y --oldkernels --count=1
sudo yum -y clean all

echo "Truncating /var/logs"
Expand Down
3 changes: 3 additions & 0 deletions ui/build_image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ case $context in

esac

o "Cleaning up..."
docker_clean

o "Checking Alpine Linux mirror"
alpine_mirror_test="${alpine_mirror}/MIRRORS.txt"
if ! is_file_http_accessible "${alpine_mirror_test}" 2>&1 >/dev/null; then
Expand Down
10 changes: 1 addition & 9 deletions ui/libexec/dockerutils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -110,17 +110,9 @@ docker_clean() {

o " [exited containers] "
if ! [ -z "$(sudo docker ps -q -f status=exited)" ]; then
sudo docker rm -vf $(sudo docker ps -q -f status=exited) >/dev/null
sudo docker rm -vf $(sudo docker ps -q -f status=exited | grep -v ecs-config) >/dev/null
fi

# o " [local build images] "
# if ! [ -z "$(sudo docker images | grep local.$(hostname -s) | awk '{print $3}')" ]; then
# sudo docker rmi -f $(sudo docker images | grep local.$(hostname -s) | awk '{print $3}') >/dev/null
# fi
# if ! [ -z "$(sudo docker images | grep dev.$(hostname -s) | awk '{print $3}')" ]; then
# sudo docker rmi -f $(sudo docker images | grep dev.$(hostname -s) | awk '{print $3}') >/dev/null
# fi

o " [dangling layers] "
if ! [ -z "$(sudo docker images -q --filter "dangling=true")" ]; then
sudo docker rmi $(sudo docker images -q --filter "dangling=true") >/dev/null
Expand Down
3 changes: 3 additions & 0 deletions ui/pull_image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ else
repo_path="${image_release}"
fi

o "Cleaning up..."
docker_clean

o "Pulling image ${repo_path}"
sudo docker pull ${repo_path} || img_pull_fail

Expand Down

0 comments on commit f317406

Please sign in to comment.