Skip to content

Instantly share code, notes, and snippets.

@shaunfink
Last active September 28, 2019 11:39
Show Gist options
  • Save shaunfink/5e58fd10c6f62311b42358d1768f28d1 to your computer and use it in GitHub Desktop.
Save shaunfink/5e58fd10c6f62311b42358d1768f28d1 to your computer and use it in GitHub Desktop.
### Homebrew Stuff
echo "\n### Updating Homebrew ###\n"
brew update
brew upgrade
brew doctor
brew cleanup
### Ruby Gem Stuff
echo "\n### Updating Ruby Gems ###\n"
gem update
### Python 3 Stuff
echo "\n### Updating Python 3 PIP Installs ###\n"
for i in $( pip3 list -o | awk 'NR > 2 {print $1}' ); do
pip3 install -U $i
done
### Python 2 Stuff
echo "\n### Updating Python 2 PIP Installs ###\n"
for i in $( pip list -o | awk 'NR > 2 {print $1}' ); do
pip install -U $i
done
### NPM Stuff
echo "\n### Updating NPM Packages ###\n"
npm update -g
### Docker Stuff
echo "\n### Updating Docker Images ###\n"
# Start Docker if not running
if ( ! docker ps -q > /dev/null ); then
# On Mac OS this would be the terminal command to launch Docker
open /Applications/Docker.app
# Wait until Docker daemon is running and has completed initialisation
while ( ! docker ps -q > /dev/null ); do
# Docker takes a few seconds to initialize
echo "Waiting for Docker to launch..."
sleep 5
done
fi
# Update docker images once it's running
# https://bytefreaks.net/applications/docker/how-to-update-all-pulled-docker-images-that-are-tagged-as-latest
if ( docker ps -q > /dev/null ); then
# Pull all images only tagged Latest
# docker images --format "{{.Repository}}:{{.Tag}}" | grep ':latest' | xargs -L1 docker pull
# Removes the untagged images and pulls all by tag
docker images --format "{{.Repository}}:{{.Tag}}" | grep --invert-match '<none>' | xargs -L1 docker pull
fi
# ### Atom Updates
# echo "\n### Updating Atom Plugins ###\n"
# apm update -c false
# ### cf plugin updates
# echo "\n### Updating CF CLI PLugins ###\n"
# for i in $(cf plugins | awk '{print $1}' | uniq | sed '1,3d;N;$!P;$!D;$d'); do
# cf install-plugin $i -f
# done
echo "\n### Done! ###\n"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment